Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
pypdfl.f
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file pypdfl.f
1 
2 C*********************************************************************
3 
4 C...PYPDFL
5 C...Gives proton parton distribution at small x and/or Q^2 according to
6 C...correct limiting behaviour.
7 
8  SUBROUTINE pypdfl(KF,X,Q2,XPQ)
9 
10 C...Double precision and integer declarations.
11  IMPLICIT DOUBLE PRECISION(a-h, o-z)
12  IMPLICIT INTEGER(i-n)
13  INTEGER pyk,pychge,pycomp
14 C...Commonblocks.
15  common/pydat1/mstu(200),paru(200),mstj(200),parj(200)
16  common/pydat2/kchg(500,4),pmas(500,4),parf(2000),vckm(4,4)
17  common/pypars/mstp(200),parp(200),msti(200),pari(200)
18  common/pyint1/mint(400),vint(400)
19  SAVE /pydat1/,/pydat2/,/pypars/,/pyint1/
20 C...Local arrays.
21  dimension xpq(-25:25),xpa(-25:25),xpb(-25:25),wtsb(-3:3)
22  DATA rmr/0.92d0/,rmp/0.38d0/,wtsb/0.5d0,1d0,1d0,5d0,1d0,1d0,0.5d0/
23 
24 C...Send everything but protons/neutrons/VMD pions directly to PYPDFU.
25  mint(92)=0
26  kfa=iabs(kf)
27  iacc=0
28  IF((kfa.EQ.2212.OR.kfa.EQ.2112).AND.mstp(57).GE.2) iacc=1
29  IF(kfa.EQ.211.AND.mstp(57).GE.3) iacc=1
30  IF(kfa.EQ.22.AND.mint(109).EQ.2.AND.mstp(57).GE.3) iacc=1
31  IF(iacc.EQ.0) THEN
32  CALL pypdfu(kf,x,q2,xpq)
33  RETURN
34  ENDIF
35 
36 C...Reset. Check x.
37  DO 100 kfl=-25,25
38  xpq(kfl)=0d0
39  100 CONTINUE
40  IF(x.LE.0d0.OR.x.GE.1d0) THEN
41  WRITE(mstu(11),5000) x
42  RETURN
43  ENDIF
44 
45 C...Define valence content.
46  kfc=kf
47  nv1=2
48  nv2=1
49  IF(kf.EQ.2212) THEN
50  kfv1=2
51  kfv2=1
52  ELSEIF(kf.EQ.-2212) THEN
53  kfv1=-2
54  kfv2=-1
55  ELSEIF(kf.EQ.2112) THEN
56  kfv1=1
57  kfv2=2
58  ELSEIF(kf.EQ.-2112) THEN
59  kfv1=-1
60  kfv2=-2
61  ELSEIF(kf.EQ.211) THEN
62  nv1=1
63  kfv1=2
64  kfv2=-1
65  ELSEIF(kf.EQ.-211) THEN
66  nv1=1
67  kfv1=-2
68  kfv2=1
69  ELSEIF(mint(105).LE.223) THEN
70  kfv1=1
71  wtv1=0.2d0
72  kfv2=2
73  wtv2=0.8d0
74  ELSEIF(mint(105).EQ.333) THEN
75  kfv1=3
76  wtv1=1.0d0
77  kfv2=1
78  wtv2=0.0d0
79  ELSEIF(mint(105).EQ.443) THEN
80  kfv1=4
81  wtv1=1.0d0
82  kfv2=1
83  wtv2=0.0d0
84  ENDIF
85 
86 C...Do naive evaluation and find min Q^2, boundary Q^2 and x_0.
87  mint30=mint(30)
88  CALL pypdfu(kfc,x,q2,xpa)
89  q2mn=max(3d0,vint(231))
90  q2b=2d0+0.052d0**2*exp(3.56d0*sqrt(max(0d0,-log(3d0*x))))
91  xmn=exp(-(log((q2mn-2d0)/0.052d0**2)/3.56d0)**2)/3d0
92 
93 C...Large Q2 and large x: naive call is enough.
94  IF(q2.GT.q2mn.AND.q2.GT.q2b) THEN
95  DO 110 kfl=-25,25
96  xpq(kfl)=xpa(kfl)
97  110 CONTINUE
98  mint(92)=1
99 
100 C...Small Q2 and large x: dampen boundary value.
101  ELSEIF(x.GT.xmn) THEN
102 
103 C...Evaluate at boundary and define dampening factors.
104  mint(30)=mint30
105  CALL pypdfu(kfc,x,q2mn,xpa)
106  fv=(q2*(q2mn+rmr)/(q2mn*(q2+rmr)))**(0.55d0*(1d0-x)/(1d0-xmn))
107  fs=(q2*(q2mn+rmp)/(q2mn*(q2+rmp)))**1.08d0
108 
109 C...Separate valence and sea parts of parton distribution.
110  IF(kfa.NE.22) THEN
111  xfv1=xpa(kfv1)-xpa(-kfv1)
112  xpa(kfv1)=xpa(-kfv1)
113  xfv2=xpa(kfv2)-xpa(-kfv2)
114  xpa(kfv2)=xpa(-kfv2)
115  ELSE
116  xpa(kfv1)=xpa(kfv1)-wtv1*vint(232)
117  xpa(-kfv1)=xpa(-kfv1)-wtv1*vint(232)
118  xpa(kfv2)=xpa(kfv2)-wtv2*vint(232)
119  xpa(-kfv2)=xpa(-kfv2)-wtv2*vint(232)
120  ENDIF
121 
122 C...Dampen valence and sea separately. Put back together.
123  DO 120 kfl=-25,25
124  xpq(kfl)=fs*xpa(kfl)
125  120 CONTINUE
126  IF(kfa.NE.22) THEN
127  xpq(kfv1)=xpq(kfv1)+fv*xfv1
128  xpq(kfv2)=xpq(kfv2)+fv*xfv2
129  ELSE
130  xpq(kfv1)=xpq(kfv1)+fv*wtv1*vint(232)
131  xpq(-kfv1)=xpq(-kfv1)+fv*wtv1*vint(232)
132  xpq(kfv2)=xpq(kfv2)+fv*wtv2*vint(232)
133  xpq(-kfv2)=xpq(-kfv2)+fv*wtv2*vint(232)
134  ENDIF
135  mint(92)=2
136 
137 C...Large Q2 and small x: interpolate behaviour.
138  ELSEIF(q2.GT.q2mn) THEN
139 
140 C...Evaluate at extremes and define coefficients for interpolation.
141  mint(30)=mint30
142  CALL pypdfu(kfc,xmn,q2mn,xpa)
143  vi232a=vint(232)
144  mint(30)=mint30
145  CALL pypdfu(kfc,x,q2b,xpb)
146  vi232b=vint(232)
147  fla=log(q2b/q2)/log(q2b/q2mn)
148  fva=(x/xmn)**0.45d0*fla
149  fsa=(x/xmn)**(-0.08d0)*fla
150  fb=1d0-fla
151 
152 C...Separate valence and sea parts of parton distribution.
153  IF(kfa.NE.22) THEN
154  xfva1=xpa(kfv1)-xpa(-kfv1)
155  xpa(kfv1)=xpa(-kfv1)
156  xfva2=xpa(kfv2)-xpa(-kfv2)
157  xpa(kfv2)=xpa(-kfv2)
158  xfvb1=xpb(kfv1)-xpb(-kfv1)
159  xpb(kfv1)=xpb(-kfv1)
160  xfvb2=xpb(kfv2)-xpb(-kfv2)
161  xpb(kfv2)=xpb(-kfv2)
162  ELSE
163  xpa(kfv1)=xpa(kfv1)-wtv1*vi232a
164  xpa(-kfv1)=xpa(-kfv1)-wtv1*vi232a
165  xpa(kfv2)=xpa(kfv2)-wtv2*vi232a
166  xpa(-kfv2)=xpa(-kfv2)-wtv2*vi232a
167  xpb(kfv1)=xpb(kfv1)-wtv1*vi232b
168  xpb(-kfv1)=xpb(-kfv1)-wtv1*vi232b
169  xpb(kfv2)=xpb(kfv2)-wtv2*vi232b
170  xpb(-kfv2)=xpb(-kfv2)-wtv2*vi232b
171  ENDIF
172 
173 C...Interpolate for valence and sea. Put back together.
174  DO 130 kfl=-25,25
175  xpq(kfl)=fsa*xpa(kfl)+fb*xpb(kfl)
176  130 CONTINUE
177  IF(kfa.NE.22) THEN
178  xpq(kfv1)=xpq(kfv1)+(fva*xfva1+fb*xfvb1)
179  xpq(kfv2)=xpq(kfv2)+(fva*xfva2+fb*xfvb2)
180  ELSE
181  xpq(kfv1)=xpq(kfv1)+wtv1*(fva*vi232a+fb*vi232b)
182  xpq(-kfv1)=xpq(-kfv1)+wtv1*(fva*vi232a+fb*vi232b)
183  xpq(kfv2)=xpq(kfv2)+wtv2*(fva*vi232a+fb*vi232b)
184  xpq(-kfv2)=xpq(-kfv2)+wtv2*(fva*vi232a+fb*vi232b)
185  ENDIF
186  mint(92)=3
187 
188 C...Small Q2 and small x: dampen boundary value and add term.
189  ELSE
190 
191 C...Evaluate at boundary and define dampening factors.
192  mint(30)=mint30
193  CALL pypdfu(kfc,xmn,q2mn,xpa)
194  fb=(xmn-x)*(q2mn-q2)/(xmn*q2mn)
195  fa=1d0-fb
196  fvc=(x/xmn)**0.45d0*(q2/(q2+rmr))**0.55d0
197  fva=fvc*fa*((q2mn+rmr)/q2mn)**0.55d0
198  fvb=fvc*fb*1.10d0*xmn**0.45d0*0.11d0
199  fsc=(x/xmn)**(-0.08d0)*(q2/(q2+rmp))**1.08d0
200  fsa=fsc*fa*((q2mn+rmp)/q2mn)**1.08d0
201  fsb=fsc*fb*0.21d0*xmn**(-0.08d0)*0.21d0
202 
203 C...Separate valence and sea parts of parton distribution.
204  IF(kfa.NE.22) THEN
205  xfv1=xpa(kfv1)-xpa(-kfv1)
206  xpa(kfv1)=xpa(-kfv1)
207  xfv2=xpa(kfv2)-xpa(-kfv2)
208  xpa(kfv2)=xpa(-kfv2)
209  ELSE
210  xpa(kfv1)=xpa(kfv1)-wtv1*vint(232)
211  xpa(-kfv1)=xpa(-kfv1)-wtv1*vint(232)
212  xpa(kfv2)=xpa(kfv2)-wtv2*vint(232)
213  xpa(-kfv2)=xpa(-kfv2)-wtv2*vint(232)
214  ENDIF
215 
216 C...Dampen valence and sea separately. Add constant terms.
217 C...Put back together.
218  DO 140 kfl=-25,25
219  xpq(kfl)=fsa*xpa(kfl)
220  140 CONTINUE
221  IF(kfa.NE.22) THEN
222  DO 150 kfl=-3,3
223  xpq(kfl)=xpq(kfl)+fsb*wtsb(kfl)
224  150 CONTINUE
225  xpq(kfv1)=xpq(kfv1)+(fva*xfv1+fvb*nv1)
226  xpq(kfv2)=xpq(kfv2)+(fva*xfv2+fvb*nv2)
227  ELSE
228  DO 160 kfl=-3,3
229  xpq(kfl)=xpq(kfl)+vint(281)*fsb*wtsb(kfl)
230  160 CONTINUE
231  xpq(kfv1)=xpq(kfv1)+wtv1*(fva*vint(232)+fvb*vint(281))
232  xpq(-kfv1)=xpq(-kfv1)+wtv1*(fva*vint(232)+fvb*vint(281))
233  xpq(kfv2)=xpq(kfv2)+wtv2*(fva*vint(232)+fvb*vint(281))
234  xpq(-kfv2)=xpq(-kfv2)+wtv2*(fva*vint(232)+fvb*vint(281))
235  ENDIF
236  xpq(21)=xpq(0)
237  mint(92)=4
238  ENDIF
239 
240 C...Format for error printout.
241  5000 FORMAT(' Error: x value outside physical range; x =',1p,d12.3)
242 
243  RETURN
244  END