Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
pypdel.f
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file pypdel.f
1 
2 C*********************************************************************
3 
4 C...PYPDEL
5 C...Gives electron (or muon, or tau) parton distribution.
6 
7  SUBROUTINE pypdel(KFA,X,Q2,XPEL)
8 
9 C...Double precision and integer declarations.
10  IMPLICIT DOUBLE PRECISION(a-h, o-z)
11  IMPLICIT INTEGER(i-n)
12  INTEGER pyk,pychge,pycomp
13 C...Commonblocks.
14  common/pydat1/mstu(200),paru(200),mstj(200),parj(200)
15  common/pydat2/kchg(500,4),pmas(500,4),parf(2000),vckm(4,4)
16  common/pypars/mstp(200),parp(200),msti(200),pari(200)
17  common/pyint1/mint(400),vint(400)
18  SAVE /pydat1/,/pydat2/,/pypars/,/pyint1/
19 C...Local arrays.
20  dimension xpel(-25:25),xpga(-6:6),sxp(0:6)
21 
22 C...Interface to PDFLIB.
23  common/w50513/xmin,xmax,q2min,q2max
24  SAVE /w50513/
25  DOUBLE PRECISION xx,qq,upv,dnv,usea,dsea,str,chm,bot,top,glu,
26  &value(20),xmin,xmax,q2min,q2max
27  CHARACTER*20 parm(20)
28  DATA value/20*0d0/,parm/20*' '/
29 
30 C...Some common constants.
31  DO 100 kfl=-25,25
32  xpel(kfl)=0d0
33  100 CONTINUE
34  aem=paru(101)
35  pme=pmas(11,1)
36  IF(kfa.EQ.13) pme=pmas(13,1)
37  IF(kfa.EQ.15) pme=pmas(15,1)
38  xl=log(max(1d-10,x))
39  x1l=log(max(1d-10,1d0-x))
40  hle=log(max(3d0,q2/pme**2))
41  hbe2=(aem/paru(1))*(hle-1d0)
42 
43 C...Electron inside electron, see R. Kleiss et al., in Z physics at
44 C...LEP 1, CERN 89-08, p. 34
45  IF(mstp(59).LE.1) THEN
46  hde=1d0+(aem/paru(1))*(1.5d0*hle+1.289868d0)+(aem/paru(1))**2*
47  & (-2.164868d0*hle**2+9.840808d0*hle-10.130464d0)
48  hee=hbe2*(1d0-x)**(hbe2-1d0)*sqrt(max(0d0,hde))-
49  & 0.5d0*hbe2*(1d0+x)+hbe2**2/8d0*((1d0+x)*(-4d0*x1l+3d0*xl)-
50  & 4d0*xl/(1d0-x)-5d0-x)
51  ELSE
52  hee=hbe2*(1d0-x)**(hbe2-1d0)*exp(0.172784d0*hbe2)/
53  & pygamm(1d0+hbe2)-0.5d0*hbe2*(1d0+x)+hbe2**2/8d0*((1d0+x)*
54  & (-4d0*x1l+3d0*xl)-4d0*xl/(1d0-x)-5d0-x)
55  ENDIF
56 C...Zero distribution for very large x and rescale it for intermediate.
57  IF(x.GT.1d0-1d-10) THEN
58  hee=0d0
59  ELSEIF(x.GT.1d0-1d-7) THEN
60  hee=hee*1000d0**hbe2/(1000d0**hbe2-1d0)
61  ENDIF
62  xpel(kfa)=x*hee
63 
64 C...Photon and (transverse) W- inside electron.
65  aemp=pyalem(pme*sqrt(max(0d0,q2)))/paru(2)
66  IF(mstp(13).LE.1) THEN
67  hlg=hle
68  ELSE
69  hlg=log(max(1d0,(parp(13)/pme**2)*(1d0-x)/x**2))
70  ENDIF
71  xpel(22)=aemp*hlg*(1d0+(1d0-x)**2)
72  hlw=log(1d0+q2/pmas(24,1)**2)/(4d0*paru(102))
73  xpel(-24)=aemp*hlw*(1d0+(1d0-x)**2)
74 
75 C...Electron or positron inside photon inside electron.
76  IF(kfa.EQ.11.AND.mstp(12).EQ.1) THEN
77  xfsea=0.5d0*(aemp*(hle-1d0))**2*(4d0/3d0+x-x**2-4d0*x**3/3d0+
78  & 2d0*x*(1d0+x)*xl)
79  xpel(11)=xpel(11)+xfsea
80  xpel(-11)=xfsea
81 
82 C...Initialize PDFLIB photon parton distributions.
83  IF(mstp(56).EQ.2) THEN
84  parm(1)='NPTYPE'
85  value(1)=3
86  parm(2)='NGROUP'
87  value(2)=mstp(55)/1000
88  parm(3)='NSET'
89  value(3)=mod(mstp(55),1000)
90  IF(mint(93).NE.3000000+mstp(55)) THEN
91 C CALL PDFSET(PARM,VALUE)
92  mint(93)=3000000+mstp(55)
93  ENDIF
94  ENDIF
95 
96 C...Quarks and gluons inside photon inside electron:
97 C...numerical convolution required.
98  DO 110 kfl=0,6
99  sxp(kfl)=0d0
100  110 CONTINUE
101  sumxpp=0d0
102  iter=-1
103  120 iter=iter+1
104  sumxp=sumxpp
105  nstp=2**(iter-1)
106  IF(iter.EQ.0) nstp=2
107  DO 130 kfl=0,6
108  sxp(kfl)=0.5d0*sxp(kfl)
109  130 CONTINUE
110  wtstp=0.5d0/nstp
111  IF(iter.EQ.0) wtstp=0.5d0
112 C...Pick grid of x_{gamma} values logarithmically even.
113  DO 150 istp=1,nstp
114  IF(iter.EQ.0) THEN
115  xle=xl*(istp-1)
116  ELSE
117  xle=xl*(istp-0.5d0)/nstp
118  ENDIF
119  xe=min(1d0-1d-10,exp(xle))
120  xg=min(1d0-1d-10,x/xe)
121 C...Evaluate photon inside electron parton distribution for convolution.
122  xpgp=1d0+(1d0-xe)**2
123  IF(mstp(13).LE.1) THEN
124  xpgp=xpgp*hle
125  ELSE
126  xpgp=xpgp*log(max(1d0,(parp(13)/pme**2)*(1d0-xe)/xe**2))
127  ENDIF
128 C...Evaluate photon parton distributions for convolution.
129  IF(mstp(56).EQ.1) THEN
130  IF(mstp(55).EQ.1) THEN
131  CALL pypdga(xg,q2,xpga)
132  ELSEIF(mstp(55).GE.5.AND.mstp(55).LE.8) THEN
133  q2mx=q2
134  p2mx=0.36d0
135  IF(mstp(55).GE.7) p2mx=4.0d0
136  IF(mstp(57).EQ.0) q2mx=p2mx
137  p2=0d0
138  IF(vint(120).LT.0d0) p2=vint(120)**2
139  CALL pyggam(mstp(55)-4,xg,q2mx,p2,mstp(60),f2gam,xpga)
140  vint(231)=p2mx
141  ELSEIF(mstp(55).GE.9.AND.mstp(55).LE.12) THEN
142  q2mx=q2
143  p2mx=0.36d0
144  IF(mstp(55).GE.11) p2mx=4.0d0
145  IF(mstp(57).EQ.0) q2mx=p2mx
146  p2=0d0
147  IF(vint(120).LT.0d0) p2=vint(120)**2
148  CALL pyggam(mstp(55)-8,xg,q2mx,p2,mstp(60),f2gam,xpga)
149  vint(231)=p2mx
150  ENDIF
151  DO 140 kfl=0,5
152  sxp(kfl)=sxp(kfl)+wtstp*xpgp*xpga(kfl)
153  140 CONTINUE
154  ELSEIF(mstp(56).EQ.2) THEN
155 C...Call PDFLIB parton distributions.
156  xx=xg
157  qq=sqrt(max(0d0,q2min,q2))
158  IF(mstp(57).EQ.0) qq=sqrt(q2min)
159 C CALL STRUCTM(XX,QQ,UPV,DNV,USEA,DSEA,STR,CHM,BOT,TOP,GLU)
160  sxp(0)=sxp(0)+wtstp*xpgp*glu
161  sxp(1)=sxp(1)+wtstp*xpgp*dnv
162  sxp(2)=sxp(2)+wtstp*xpgp*upv
163  sxp(3)=sxp(3)+wtstp*xpgp*str
164  sxp(4)=sxp(4)+wtstp*xpgp*chm
165  sxp(5)=sxp(5)+wtstp*xpgp*bot
166  sxp(6)=sxp(6)+wtstp*xpgp*top
167  ENDIF
168  150 CONTINUE
169  sumxpp=sxp(0)+2d0*sxp(1)+2d0*sxp(2)
170  IF(iter.LE.2.OR.(iter.LE.7.AND.abs(sumxpp-sumxp).GT.
171  & parp(14)*(sumxpp+sumxp))) goto 120
172 
173 C...Put convolution into output arrays.
174  fconv=aemp*(-xl)
175  xpel(0)=fconv*sxp(0)
176  DO 160 kfl=1,6
177  xpel(kfl)=fconv*sxp(kfl)
178  xpel(-kfl)=xpel(kfl)
179  160 CONTINUE
180  ENDIF
181 
182  RETURN
183  END