EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
pystel.F
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file pystel.F
1  SUBROUTINE pystel(X,Q2,XPEL)
2 
3 C...Gives electron structure function.
4  common/ludat1/mstu(200),paru(200),mstj(200),parj(200)
5  common/ludat2/kchg(500,3),pmas(500,4),parf(2000),vckm(4,4)
6  common/pypars/mstp(200),parp(200),msti(200),pari(200)
7  common/pyint1/mint(400),vint(400)
8  SAVE /ludat1/,/ludat2/
9  SAVE /pypars/,/pyint1/
10  dimension xpel(-25:25),xpga(-6:6),sxp(0:6)
11 
12 C...Interface to PDFLIB.
13  common/w50513/xmin,xmax,q2min,q2max
14  SAVE /w50513/
15  DOUBLE PRECISION xx,qq,upv,dnv,usea,dsea,str,chm,bot,top,glu,
16  &value(20),xmin,xmax,q2min,q2max
17  CHARACTER*20 parm(20)
18  DATA value/20*0d0/,parm/20*' '/
19 
20 C...Some common constants.
21  DO 100 kfl=-25,25
22  xpel(kfl)=0.
23  100 CONTINUE
24  aem=paru(101)
25  pme=pmas(11,1)
26  xl=log(max(1e-10,x))
27  x1l=log(max(1e-10,1.-x))
28  hle=log(max(3.,q2/pme**2))
29  hbe2=(aem/paru(1))*(hle-1.)
30 
31 C...Electron inside electron, see R. Kleiss et al., in Z physics at
32 C...LEP 1, CERN 89-08, p. 34
33  IF(mstp(59).LE.1) THEN
34  hde=1.+(aem/paru(1))*(1.5*hle+1.289868)+(aem/paru(1))**2*
35  & (-2.164868*hle**2+9.840808*hle-10.130464)
36  hee=hbe2*(1.-x)**(hbe2-1.)*sqrt(max(0.,hde))-
37  & 0.5*hbe2*(1.+x)+hbe2**2/8.*((1.+x)*(-4.*x1l+3.*xl)-
38  & 4.*xl/(1.-x)-5.-x)
39  ELSE
40  hee=hbe2*(1.-x)**(hbe2-1.)*exp(0.172784*hbe2)/pygamm(1.+hbe2)-
41  & 0.5*hbe2*(1.+x)+hbe2**2/8.*((1.+x)*(-4.*x1l+3.*xl)-
42  & 4.*xl/(1.-x)-5.-x)
43  ENDIF
44  IF(x.GT.0.9999.AND.x.LE.0.999999) THEN
45  hee=hee*100.**hbe2/(100.**hbe2-1.)
46  ELSEIF(x.GT.0.999999) THEN
47  hee=0.
48  ENDIF
49  xpel(11)=x*hee
50 
51 C...Photon and (transverse) W- inside electron.
52  aemp=ulalem(pme*sqrt(max(0.,q2)))/paru(2)
53  IF(mstp(13).LE.1) THEN
54  hlg=hle
55  ELSE
56  hlg=log(max(1.,(parp(13)/pme**2)*(1.-x)/x**2))
57  ENDIF
58  xpel(22)=aemp*hlg*(1.+(1.-x)**2)
59  hlw=log(1.+q2/pmas(24,1)**2)/(4.*paru(102))
60  xpel(-24)=aemp*hlw*(1.+(1.-x)**2)
61 
62 C...Electron or positron inside photon inside electron.
63  IF(mstp(12).EQ.1) THEN
64  xfsea=0.5*(aemp*(hle-1.))**2*(4./3.+x-x**2-4.*x**3/3.+
65  & 2.*x*(1.+x)*xl)
66  xpel(11)=xpel(11)+xfsea
67  xpel(-11)=xfsea
68 
69 C...Initialize PDFLIB photon structure functions.
70  IF(mstp(56).EQ.2) THEN
71  parm(1)='NPTYPE'
72  value(1)=3
73  parm(2)='NGROUP'
74  value(2)=mstp(55)/1000
75  parm(3)='NSET'
76  value(3)=mod(mstp(55),1000)
77  IF(mint(93).NE.3000000+mstp(55)) THEN
78  CALL pdfset(parm,value)
79  mint(93)=3000000+mstp(55)
80  ENDIF
81  ENDIF
82 
83 C...Quarks and gluons inside photon inside electron:
84 C...numerical convolution required.
85  DO 110 kfl=0,6
86  sxp(kfl)=0.
87  110 CONTINUE
88  sumxpp=0.
89  iter=-1
90  120 iter=iter+1
91  sumxp=sumxpp
92  nstp=2**(iter-1)
93  IF(iter.EQ.0) nstp=2
94  DO 130 kfl=0,6
95  sxp(kfl)=0.5*sxp(kfl)
96  130 CONTINUE
97  wtstp=0.5/nstp
98  IF(iter.EQ.0) wtstp=0.5
99 C...Pick grid of x_{gamma} values logarithmically even.
100  DO 150 istp=1,nstp
101  IF(iter.EQ.0) THEN
102  xle=xl*(istp-1)
103  ELSE
104  xle=xl*(istp-0.5)/nstp
105  ENDIF
106  xe=min(0.999999,exp(xle))
107  xg=min(0.999999,x/xe)
108 C...Evaluate photon inside electron structure function for convolution.
109  xpgp=1.+(1.-xe)**2
110  IF(mstp(13).LE.1) THEN
111  xpgp=xpgp*hle
112  ELSE
113  xpgp=xpgp*log(max(1.,(parp(13)/pme**2)*(1.-xe)/xe**2))
114  ENDIF
115 C...Evaluate photon structure functions for convolution.
116  IF(mstp(56).EQ.1) THEN
117  CALL pystga(xg,q2,xpga)
118  DO 140 kfl=0,5
119  sxp(kfl)=sxp(kfl)+wtstp*xpgp*xpga(kfl)
120  140 CONTINUE
121  ELSEIF(mstp(56).EQ.2) THEN
122 C...Call PDFLIB structure functions.
123  xx=xg
124  qq=sqrt(max(0.,sngl(q2min),q2))
125  IF(mstp(57).EQ.0) qq=sqrt(q2min)
126  CALL structm(xx,qq,upv,dnv,usea,dsea,str,chm,bot,top,glu)
127  sxp(0)=sxp(0)+wtstp*xpgp*glu
128  sxp(1)=sxp(1)+wtstp*xpgp*dnv
129  sxp(2)=sxp(2)+wtstp*xpgp*upv
130  sxp(3)=sxp(3)+wtstp*xpgp*str
131  sxp(4)=sxp(4)+wtstp*xpgp*chm
132  sxp(5)=sxp(5)+wtstp*xpgp*bot
133  sxp(6)=sxp(6)+wtstp*xpgp*top
134  ENDIF
135  150 CONTINUE
136  sumxpp=sxp(0)+2.*sxp(1)+2.*sxp(2)
137  IF(iter.LE.2.OR.(iter.LE.7.AND.abs(sumxpp-sumxp).GT.
138  & parp(14)*(sumxpp+sumxp))) goto 120
139 
140 C...Put convolution into output arrays.
141  fconv=aemp*(-xl)
142  xpel(0)=fconv*sxp(0)
143  DO 160 kfl=1,6
144  xpel(kfl)=fconv*sxp(kfl)
145  xpel(-kfl)=xpel(kfl)
146  160 CONTINUE
147  ENDIF
148 
149  RETURN
150  END