Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
pydocu.f
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file pydocu.f
1 
2 C*********************************************************************
3 
4 C...PYDOCU
5 C...Handles the documentation of the process in MSTI and PARI,
6 C...and also computes cross-sections based on accumulated statistics.
7 
8  SUBROUTINE pydocu
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/pyjets/n,npad,k(4000,5),p(4000,5),v(4000,5)
16  common/pydat1/mstu(200),paru(200),mstj(200),parj(200)
17  common/pypars/mstp(200),parp(200),msti(200),pari(200)
18  common/pysubs/msel,mselpd,msub(500),kfin(2,-40:40),ckin(200)
19  common/pyint1/mint(400),vint(400)
20  common/pyint2/iset(500),kfpr(500,2),coef(500,20),icol(40,4,2)
21  common/pyint5/ngenpd,ngen(0:500,3),xsec(0:500,3)
22  SAVE /pyjets/,/pydat1/,/pysubs/,/pypars/,/pyint1/,/pyint2/,
23  &/pyint5/
24 
25 C...Calculate Monte Carlo estimates of cross-sections.
26  isub=mint(1)
27  IF(mstp(111).NE.-1) ngen(isub,3)=ngen(isub,3)+1
28  ngen(0,3)=ngen(0,3)+1
29  xsec(0,3)=0d0
30  DO 100 i=1,500
31  IF(i.EQ.96.OR.i.EQ.97) THEN
32  xsec(i,3)=0d0
33  ELSEIF(msub(95).EQ.1.AND.(i.EQ.11.OR.i.EQ.12.OR.i.EQ.13.OR.
34  & i.EQ.28.OR.i.EQ.53.OR.i.EQ.68)) THEN
35  xsec(i,3)=xsec(96,2)*ngen(i,3)/max(1d0,dble(ngen(96,1))*
36  & dble(ngen(96,2)))
37  ELSEIF(msub(95).EQ.1.AND.i.GE.381.AND.i.LE.386) THEN
38  xsec(i,3)=xsec(96,2)*ngen(i,3)/max(1d0,dble(ngen(96,1))*
39  & dble(ngen(96,2)))
40  ELSEIF(msub(i).EQ.0.OR.ngen(i,1).EQ.0) THEN
41  xsec(i,3)=0d0
42  ELSEIF(ngen(i,2).EQ.0) THEN
43  xsec(i,3)=xsec(i,2)*ngen(0,3)/(dble(ngen(i,1))*
44  & dble(ngen(0,2)))
45  ELSE
46  xsec(i,3)=xsec(i,2)*ngen(i,3)/(dble(ngen(i,1))*
47  & dble(ngen(i,2)))
48  ENDIF
49  xsec(0,3)=xsec(0,3)+xsec(i,3)
50  100 CONTINUE
51 
52 C...Rescale to known low-pT cross-section for standard QCD processes.
53  IF(msub(95).EQ.1) THEN
54  xsech=xsec(11,3)+xsec(12,3)+xsec(13,3)+xsec(28,3)+xsec(53,3)+
55  & xsec(68,3)+xsec(95,3)
56  xsecw=xsec(97,2)/max(1d0,dble(ngen(97,1)))
57  IF(xsech.GT.1d-20.AND.xsecw.GT.1d-20) THEN
58  fac=xsecw/xsech
59  xsec(11,3)=fac*xsec(11,3)
60  xsec(12,3)=fac*xsec(12,3)
61  xsec(13,3)=fac*xsec(13,3)
62  xsec(28,3)=fac*xsec(28,3)
63  xsec(53,3)=fac*xsec(53,3)
64  xsec(68,3)=fac*xsec(68,3)
65  xsec(95,3)=fac*xsec(95,3)
66  xsec(0,3)=xsec(0,3)-xsech+xsecw
67  ENDIF
68  ENDIF
69 
70 C...Save information for gamma-p and gamma-gamma.
71  IF(mint(121).GT.1) THEN
72  iga=mint(122)
73  CALL pysave(2,iga)
74  CALL pysave(5,0)
75  ENDIF
76 
77 C...Reset information on hard interaction.
78  DO 110 j=1,200
79  msti(j)=0
80  pari(j)=0d0
81  110 CONTINUE
82 
83 C...Copy integer valued information from MINT into MSTI.
84  DO 120 j=1,32
85  msti(j)=mint(j)
86  120 CONTINUE
87  IF(mint(121).GT.1) msti(9)=mint(122)
88 
89 C...Store cross-section variables in PARI.
90  pari(1)=xsec(0,3)
91  pari(2)=xsec(0,3)/mint(5)
92  pari(7)=vint(97)
93  pari(9)=vint(99)
94  pari(10)=vint(100)
95  vint(98)=vint(98)+vint(100)
96  IF(mstp(142).EQ.1) pari(2)=xsec(0,3)/vint(98)
97 
98 C...Store kinematics variables in PARI.
99  pari(11)=vint(1)
100  pari(12)=vint(2)
101  IF(isub.NE.95) THEN
102  DO 130 j=13,26
103  pari(j)=vint(30+j)
104  130 CONTINUE
105  pari(29)=vint(39)
106  pari(30)=vint(40)
107  pari(31)=vint(141)
108  pari(32)=vint(142)
109  pari(33)=vint(41)
110  pari(34)=vint(42)
111  pari(35)=pari(33)-pari(34)
112  pari(36)=vint(21)
113  pari(37)=vint(22)
114  pari(38)=vint(26)
115  pari(39)=vint(157)
116  pari(40)=vint(158)
117  pari(41)=vint(23)
118  pari(42)=2d0*vint(47)/vint(1)
119  ENDIF
120 
121 C...Store information on scattered partons in PARI.
122  IF(isub.NE.95.AND.mint(7)*mint(8).NE.0) THEN
123  DO 140 is=7,8
124  i=mint(is)
125  pari(36+is)=p(i,3)/vint(1)
126  pari(38+is)=p(i,4)/vint(1)
127  pr=max(1d-20,p(i,5)**2+p(i,1)**2+p(i,2)**2)
128  pari(40+is)=sign(log(min((sqrt(pr+p(i,3)**2)+abs(p(i,3)))/
129  & sqrt(pr),1d20)),p(i,3))
130  pr=max(1d-20,p(i,1)**2+p(i,2)**2)
131  pari(42+is)=sign(log(min((sqrt(pr+p(i,3)**2)+abs(p(i,3)))/
132  & sqrt(pr),1d20)),p(i,3))
133  pari(44+is)=p(i,3)/sqrt(1d-20+p(i,1)**2+p(i,2)**2+p(i,3)**2)
134  pari(46+is)=pyangl(p(i,3),sqrt(p(i,1)**2+p(i,2)**2))
135  pari(48+is)=pyangl(p(i,1),p(i,2))
136  140 CONTINUE
137  ENDIF
138 
139 C...Store sum up transverse and longitudinal momenta.
140  pari(65)=2d0*pari(17)
141  IF(isub.LE.90.OR.isub.GE.95) THEN
142  DO 150 i=mstp(126)+1,n
143  IF(k(i,1).LE.0.OR.k(i,1).GT.10) goto 150
144  pt=sqrt(p(i,1)**2+p(i,2)**2)
145  pari(69)=pari(69)+pt
146  IF(i.LE.mint(52)) pari(66)=pari(66)+pt
147  IF(i.GT.mint(52).AND.i.LE.mint(53)) pari(68)=pari(68)+pt
148  150 CONTINUE
149  pari(67)=pari(68)
150  pari(71)=vint(151)
151  pari(72)=vint(152)
152  pari(73)=vint(151)
153  pari(74)=vint(152)
154  ELSE
155  pari(66)=pari(65)
156  pari(69)=pari(65)
157  ENDIF
158 
159 C...Store various other pieces of information into PARI.
160  pari(61)=vint(148)
161  pari(75)=vint(155)
162  pari(76)=vint(156)
163  pari(77)=vint(159)
164  pari(78)=vint(160)
165  pari(81)=vint(138)
166 
167 C...Store information on lepton -> lepton + gamma in PYGAGA.
168  msti(71)=mint(141)
169  msti(72)=mint(142)
170  pari(101)=vint(301)
171  pari(102)=vint(302)
172  DO 160 i=103,114
173  pari(i)=vint(i+202)
174  160 CONTINUE
175 
176 C...Set information for PYTABU.
177  IF(iset(isub).EQ.1.OR.iset(isub).EQ.3) THEN
178  mstu(161)=mint(21)
179  mstu(162)=0
180  ELSEIF(iset(isub).EQ.5) THEN
181  mstu(161)=mint(23)
182  mstu(162)=0
183  ELSE
184  mstu(161)=mint(21)
185  mstu(162)=mint(22)
186  ENDIF
187 
188  RETURN
189  END