Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
pyhiinit.f
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file pyhiinit.f
1  SUBROUTINE pyhiinit(FRAME,BEAM,TARGET,WIN)
2 
3 C...Initializes the generation procedure; finds maxima of the
4 C...differential cross-sections to be used for weighting.
5  common/ludat1/mstu(200),paru(200),mstj(200),parj(200)
6  SAVE /ludat1/
7  common/ludat2/kchg(500,3),pmas(500,4),parf(2000),vckm(4,4)
8  SAVE /ludat2/
9  common/ludat3/mdcy(500,3),mdme(2000,2),brat(2000),kfdp(2000,5)
10  SAVE /ludat3/
11  common/ludat4/chaf(500)
12  CHARACTER chaf*8
13  SAVE /ludat4/
14  common/pyhisubs/msel,msub(200),kfin(2,-40:40),ckin(200)
15  SAVE /pyhisubs/
16  common/pyhipars/mstp(200),parp(200),msti(200),pari(200)
17  SAVE /pyhipars/
18  common/pyhiint1/mint(400),vint(400)
19  SAVE /pyhiint1/
20  common/pyhiint2/iset(200),kfpr(200,2),coef(200,20),icol(40,4,2)
21  SAVE /pyhiint2/
22  common/pyhiint5/ngen(0:200,3),xsec(0:200,3)
23  SAVE /pyhiint5/
24  CHARACTER*(*) frame,beam,TARGET
25  CHARACTER chfram*8,chbeam*8,chtarg*8,chmo(12)*3,chlh(2)*6
26  DATA chmo/'Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep',
27  &'Oct','Nov','Dec'/, chlh/'lepton','hadron'/
28 
29 C...Write headers.
30 C IF(MSTP(122).GE.1) WRITE(MSTU(11),1000) MSTP(181),MSTP(182),
31 C &MSTP(185),CHMO(MSTP(184)),MSTP(183)
32  CALL lulist(0)
33 C IF(MSTP(122).GE.1) WRITE(MSTU(11),1100)
34 
35 C...Identify beam and target particles and initialize kinematics.
36  chfram=frame//' '
37  chbeam=beam//' '
38  chtarg=TARGET//' '
39  CALL pyhiinki(chfram,chbeam,chtarg,win)
40 
41 C...Select partonic subprocesses to be included in the simulation.
42  IF(msel.NE.0) THEN
43  DO 100 i=1,200
44  100 msub(i)=0
45  ENDIF
46  IF(mint(43).EQ.1.AND.(msel.EQ.1.OR.msel.EQ.2)) THEN
47 C...Lepton+lepton -> gamma/Z0 or W.
48  IF(mint(11)+mint(12).EQ.0) msub(1)=1
49  IF(mint(11)+mint(12).NE.0) msub(2)=1
50  ELSEIF(msel.EQ.1) THEN
51 C...High-pT QCD processes:
52  msub(11)=1
53  msub(12)=1
54  msub(13)=1
55  msub(28)=1
56  msub(53)=1
57  msub(68)=1
58  IF(mstp(82).LE.1.AND.ckin(3).LT.parp(81)) msub(95)=1
59  IF(mstp(82).GE.2.AND.ckin(3).LT.parp(82)) msub(95)=1
60  ELSEIF(msel.EQ.2) THEN
61 C...All QCD processes:
62  msub(11)=1
63  msub(12)=1
64  msub(13)=1
65  msub(28)=1
66  msub(53)=1
67  msub(68)=1
68  msub(91)=1
69  msub(92)=1
70  msub(93)=1
71  msub(95)=1
72  ELSEIF(msel.GE.4.AND.msel.LE.8) THEN
73 C...Heavy quark production.
74  msub(81)=1
75  msub(82)=1
76  DO 110 j=1,min(8,mdcy(21,3))
77  110 mdme(mdcy(21,2)+j-1,1)=0
78  mdme(mdcy(21,2)+msel-1,1)=1
79  ELSEIF(msel.EQ.10) THEN
80 C...Prompt photon production:
81  msub(14)=1
82  msub(18)=1
83  msub(29)=1
84  ELSEIF(msel.EQ.11) THEN
85 C...Z0/gamma* production:
86  msub(1)=1
87  ELSEIF(msel.EQ.12) THEN
88 C...W+/- production:
89  msub(2)=1
90  ELSEIF(msel.EQ.13) THEN
91 C...Z0 + jet:
92  msub(15)=1
93  msub(30)=1
94  ELSEIF(msel.EQ.14) THEN
95 C...W+/- + jet:
96  msub(16)=1
97  msub(31)=1
98  ELSEIF(msel.EQ.15) THEN
99 C...Z0 & W+/- pair production:
100  msub(19)=1
101  msub(20)=1
102  msub(22)=1
103  msub(23)=1
104  msub(25)=1
105  ELSEIF(msel.EQ.16) THEN
106 C...H0 production:
107  msub(3)=1
108  msub(5)=1
109  msub(8)=1
110  msub(102)=1
111  ELSEIF(msel.EQ.17) THEN
112 C...H0 & Z0 or W+/- pair production:
113  msub(24)=1
114  msub(26)=1
115  ELSEIF(msel.EQ.21) THEN
116 C...Z'0 production:
117  msub(141)=1
118  ELSEIF(msel.EQ.22) THEN
119 C...H+/- production:
120  msub(142)=1
121  ELSEIF(msel.EQ.23) THEN
122 C...R production:
123  msub(143)=1
124  ENDIF
125 
126 C...Count number of subprocesses on.
127  mint(44)=0
128  DO 120 isub=1,200
129  IF(mint(43).LT.4.AND.isub.GE.91.AND.isub.LE.96.AND.
130  &msub(isub).EQ.1) THEN
131  WRITE(mstu(11),1200) isub,chlh(mint(41)),chlh(mint(42))
132  stop
133  ELSEIF(msub(isub).EQ.1.AND.iset(isub).EQ.-1) THEN
134  WRITE(mstu(11),1300) isub
135  stop
136  ELSEIF(msub(isub).EQ.1.AND.iset(isub).LE.-2) THEN
137  WRITE(mstu(11),1400) isub
138  stop
139  ELSEIF(msub(isub).EQ.1) THEN
140  mint(44)=mint(44)+1
141  ENDIF
142  120 CONTINUE
143  IF(mint(44).EQ.0) THEN
144  WRITE(mstu(11),1500)
145  stop
146  ENDIF
147  mint(45)=mint(44)-msub(91)-msub(92)-msub(93)-msub(94)
148 
149 C...Maximum 4 generations; set maximum number of allowed flavours.
150  mstp(1)=min(4,mstp(1))
151  mstu(114)=min(mstu(114),2*mstp(1))
152  mstp(54)=min(mstp(54),2*mstp(1))
153 
154 C...Sum up Cabibbo-Kobayashi-Maskawa factors for each quark/lepton.
155  DO 140 i=-20,20
156  vint(180+i)=0.
157  ia=iabs(i)
158  IF(ia.GE.1.AND.ia.LE.2*mstp(1)) THEN
159  DO 130 j=1,mstp(1)
160  ib=2*j-1+mod(ia,2)
161  ipm=(5-isign(1,i))/2
162  idc=j+mdcy(ia,2)+2
163  130 IF(mdme(idc,1).EQ.1.OR.mdme(idc,1).EQ.ipm) vint(180+i)=
164  & vint(180+i)+vckm((ia+1)/2,(ib+1)/2)
165  ELSEIF(ia.GE.11.AND.ia.LE.10+2*mstp(1)) THEN
166  vint(180+i)=1.
167  ENDIF
168  140 CONTINUE
169 
170 C...Choose Lambda value to use in alpha-strong.
171  mstu(111)=mstp(2)
172  IF(mstp(3).GE.1) THEN
173  alam=parp(1)
174  IF(mstp(51).EQ.1) alam=0.2
175  IF(mstp(51).EQ.2) alam=0.29
176  IF(mstp(51).EQ.3) alam=0.2
177  IF(mstp(51).EQ.4) alam=0.4
178  IF(mstp(51).EQ.11) alam=0.16
179  IF(mstp(51).EQ.12) alam=0.26
180  IF(mstp(51).EQ.13) alam=0.36
181  parp(1)=alam
182  parp(61)=alam
183  paru(112)=alam
184  parj(81)=alam
185  ENDIF
186 
187 C...Initialize widths and partial widths for resonances.
188  CALL pyhiinre
189 
190 C...Reset variables for cross-section calculation.
191  DO 150 i=0,200
192  DO 150 j=1,3
193  ngen(i,j)=0
194  150 xsec(i,j)=0.
195  vint(108)=0.
196 
197 C...Find parametrized total cross-sections.
198  IF(mint(43).EQ.4) CALL pyhixtot
199 
200 C...Maxima of differential cross-sections.
201  IF(mstp(121).LE.0) CALL pyhimaxi
202 
203 C...Initialize possibility of overlayed events.
204  IF(mstp(131).NE.0) CALL pyhiovly(1)
205 
206 C...Initialize multiple interactions with variable impact parameter.
207  IF(mint(43).EQ.4.AND.(mint(45).NE.0.OR.mstp(131).NE.0).AND.
208  &mstp(82).GE.2) CALL pyhimult(1)
209 C IF(MSTP(122).GE.1) WRITE(MSTU(11),1600)
210 
211 C...Formats for initialization information.
212  1000 FORMAT(///20x,'The Lund Monte Carlo - PYHITHIA version ',i1,
213  &'.',i1/
214  &20x,'** Last date of change: ',i2,1x,a3,1x,i4,' **'/)
215  1100 FORMAT('1',18('*'),1x,'PYHIINIT: initialization of PYHITHIA ',
216  &'(hijing pythia) routines',1x,17('*'))
217  1200 FORMAT(1x,'Error: process number ',i3,' not meaningful for ',a6,
218  &'-',a6,' interactions.'/1x,'Execution stopped!')
219  1300 FORMAT(1x,'Error: requested subprocess',i4,' not implemented.'/
220  &1x,'Execution stopped!')
221  1400 FORMAT(1x,'Error: requested subprocess',i4,' not existing.'/
222  &1x,'Execution stopped!')
223  1500 FORMAT(1x,'Error: no subprocess switched on.'/
224  &1x,'Execution stopped.')
225  1600 FORMAT(/1x,22('*'),1x,'PYHIINIT: initialization completed',1x,
226  &22('*'))
227 
228  RETURN
229  END