EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
jetini.f
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file jetini.f
1 C
2 C
3 C
4 C
5 C
6  SUBROUTINE jetini(JP,JT,I_TRIG)
7 C*******Initialize PYTHIA for jet production**********************
8 C I_TRIG=0: for normal processes
9 C I_TRIG=1: for triggered processes
10 C JP: sequence number of the projectile
11 C JT: sequence number of the target
12 C For A+A collisions, one has to initilize pythia
13 C separately for each type of collisions, pp, pn,np and nn,
14 C or hp and hn for hA collisions. In this subroutine we use the following
15 C catalogue for different type of collisions:
16 C h+h: h+h (I_TYPE=1)
17 C h+A: h+p (I_TYPE=1), h+n (I_TYPE=2)
18 C A+h: p+h (I_TYPE=1), n+h (I_TYPE=2)
19 C A+A: p+p (I_TYPE=1), p+n (I_TYPE=2), n+p (I_TYPE=3), n+n (I_TYPE=4)
20 C*****************************************************************
21  CHARACTER beam*16,targ*16
22  dimension xsec0(8,0:200),coef0(8,200,20),ini(8),
23  & mint44(8),mint45(8)
24 
25  SAVE xsec0, coef0, ini, mint44, mint45 ! Uzhi
26 
27  common/hijcrdn/yp(3,300),yt(3,300)
28  SAVE /hijcrdn/
29  common/hiparnt/hipr1(100),ihpr2(50),hint1(100),ihnt2(50)
30  SAVE /hiparnt/
31  common/histrng/nfp(300,15),pp(300,15),nft(300,15),pt(300,15)
32  SAVE /histrng/
33  common/hipyint/mint4,mint5,atco(200,20),atxs(0:200)
34  SAVE /hipyint/
35 C
36  common/ludat1/mstu(200),paru(200),mstj(200),parj(200)
37  SAVE /ludat1/
38  common/ludat3/mdcy(500,3),mdme(2000,2),brat(2000),kfdp(2000,5)
39  SAVE /ludat3/
40  common/pyhisubs/msel,msub(200),kfin(2,-40:40),ckin(200)
41  SAVE /pyhisubs/
42  common/pyhipars/mstp(200),parp(200),msti(200),pari(200)
43  SAVE /pyhipars/
44  common/pyhiint1/mint(400),vint(400)
45  SAVE /pyhiint1/
46  common/pyhiint2/iset(200),kfpr(200,2),coef(200,20),icol(40,4,2)
47  SAVE /pyhiint2/
48  common/pyhiint5/ngen(0:200,3),xsec(0:200,3)
49  SAVE /pyhiint5/
50  DATA ini/8*0/i_last/-1/
51 
52  SAVE i_last ! Uzhi
53 
54 C
55  ihnt2(11)=jp
56  ihnt2(12)=jt
57  IF(ihnt2(5).NE.0 .AND. ihnt2(6).NE.0) THEN
58  i_type=1
59  ELSE IF(ihnt2(5).NE.0 .AND. ihnt2(6).EQ.0) THEN
60  i_type=1
61  IF(nft(jt,4).EQ.2112) i_type=2
62  ELSE IF(ihnt2(5).EQ.0 .AND. ihnt2(6).NE.0) THEN
63  i_type=1
64  IF(nfp(jp,4).EQ.2112) i_type=2
65  ELSE
66  IF(nfp(jp,4).EQ.2212 .AND. nft(jt,4).EQ.2212) THEN
67  i_type=1
68  ELSE IF(nfp(jp,4).EQ.2212 .AND. nft(jt,4).EQ.2112) THEN
69  i_type=2
70  ELSE IF(nfp(jp,4).EQ.2112 .AND. nft(jt,4).EQ.2212) THEN
71  i_type=3
72  ELSE
73  i_type=4
74  ENDIF
75  ENDIF
76 c
77  IF(i_trig.NE.0) go to 160
78  IF(i_trig.EQ.i_last) go to 150
79  mstp(2)=2
80 c ********second order running alpha_strong
81  mstp(33)=1
82  parp(31)=hipr1(17)
83 C ********inclusion of K factor
84  mstp(51)=3
85 C ********Duke-Owens set 1 structure functions
86  mstp(61)=1
87 C ********INITIAL STATE RADIATION
88  mstp(71)=1
89 C ********FINAL STATE RADIATION
90  IF(ihpr2(2).EQ.0.OR.ihpr2(2).EQ.2) mstp(61)=0
91  IF(ihpr2(2).EQ.0.OR.ihpr2(2).EQ.1) mstp(71)=0
92 c
93  mstp(81)=0
94 C ******** NO MULTIPLE INTERACTION
95  mstp(82)=1
96 C *******STRUCTURE OF MUTLIPLE INTERACTION
97  mstp(111)=0
98 C ********frag off(have to be done by local call)
99  IF(ihpr2(10).EQ.0) mstp(122)=0
100 C ********No printout of initialization information
101  parp(81)=hipr1(8)
102  ckin(5)=hipr1(8)
103  ckin(3)=hipr1(8)
104  ckin(4)=hipr1(9)
105  IF(hipr1(9).LE.hipr1(8)) ckin(4)=-1.0
106  ckin(9)=-10.0
107  ckin(10)=10.0
108  msel=0
109  DO 100 isub=1,200
110  msub(isub)=0
111  100 CONTINUE
112  msub(11)=1
113  msub(12)=1
114  msub(13)=1
115  msub(28)=1
116  msub(53)=1
117  msub(68)=1
118  msub(81)=1
119  msub(82)=1
120  DO 110 j=1,min(8,mdcy(21,3))
121  110 mdme(mdcy(21,2)+j-1,1)=0
122  isel=4
123  IF(hint1(1).GE.20.0 .and. ihpr2(18).EQ.1) isel=5
124  mdme(mdcy(21,2)+isel-1,1)=1
125 C ********QCD subprocesses
126  msub(14)=1
127  msub(18)=1
128  msub(29)=1
129 C ******* direct photon production
130  150 IF(ini(i_type).NE.0) go to 800
131  go to 400
132 C
133 C *****triggered subprocesses, jet, photon, heavy quark and DY
134 C
135  160 i_type=4+i_type
136  IF(i_trig.EQ.i_last) go to 260
137  parp(81)=abs(hipr1(10))-0.25
138  ckin(5)=abs(hipr1(10))-0.25
139  ckin(3)=abs(hipr1(10))-0.25
140  ckin(4)=abs(hipr1(10))+0.25
141  IF(hipr1(10).LT.hipr1(8)) ckin(4)=-1.0
142 c
143  msel=0
144  DO 101 isub=1,200
145  msub(isub)=0
146  101 CONTINUE
147  IF(ihpr2(3).EQ.1) THEN
148  msub(11)=1
149  msub(12)=1
150  msub(13)=1
151  msub(28)=1
152  msub(53)=1
153  msub(68)=1
154  msub(81)=1
155  msub(82)=1
156  msub(14)=1
157  msub(18)=1
158  msub(29)=1
159  DO 102 j=1,min(8,mdcy(21,3))
160  102 mdme(mdcy(21,2)+j-1,1)=0
161  isel=4
162  IF(hint1(1).GE.20.0 .and. ihpr2(18).EQ.1) isel=5
163  mdme(mdcy(21,2)+isel-1,1)=1
164 C ********QCD subprocesses
165  ELSE IF(ihpr2(3).EQ.2) THEN
166  msub(14)=1
167  msub(18)=1
168  msub(29)=1
169 C ********Direct photon production
170 c q+qbar->g+gamma,q+qbar->gamma+gamma, q+g->q+gamma
171  ELSE IF(ihpr2(3).EQ.3) THEN
172  ckin(3)=max(0.0,hipr1(10))
173  ckin(5)=hipr1(8)
174  parp(81)=hipr1(8)
175  msub(81)=1
176  msub(82)=1
177  DO 105 j=1,min(8,mdcy(21,3))
178  105 mdme(mdcy(21,2)+j-1,1)=0
179  isel=4
180  IF(hint1(1).GE.20.0 .and. ihpr2(18).EQ.1) isel=5
181  mdme(mdcy(21,2)+isel-1,1)=1
182 C **********Heavy quark production
183  ENDIF
184 260 IF(ini(i_type).NE.0) go to 800
185 C
186 C
187 400 ini(i_type)=1
188  IF(ihpr2(10).EQ.0) mstp(122)=0
189  IF(nfp(jp,4).EQ.2212) THEN
190  beam='P'
191  ELSE IF(nfp(jp,4).EQ.-2212) THEN
192  beam='P~'
193  ELSE IF(nfp(jp,4).EQ.2112) THEN
194  beam='N'
195  ELSE IF(nfp(jp,4).EQ.-2112) THEN
196  beam='N~'
197  ELSE IF(nfp(jp,4).EQ.211) THEN
198  beam='PI+'
199  ELSE IF(nfp(jp,4).EQ.-211) THEN
200  beam='PI-'
201  ELSE IF(nfp(jp,4).EQ.321) THEN
202  beam='PI+'
203  ELSE IF(nfp(jp,4).EQ.-321) THEN
204  beam='PI-'
205  ELSE
206  WRITE(6,*) 'unavailable beam type', nfp(jp,4)
207  ENDIF
208  IF(nft(jt,4).EQ.2212) THEN
209  targ='P'
210  ELSE IF(nft(jt,4).EQ.-2212) THEN
211  targ='P~'
212  ELSE IF(nft(jt,4).EQ.2112) THEN
213  targ='N'
214  ELSE IF(nft(jt,4).EQ.-2112) THEN
215  targ='N~'
216  ELSE IF(nft(jt,4).EQ.211) THEN
217  targ='PI+'
218  ELSE IF(nft(jt,4).EQ.-211) THEN
219  targ='PI-'
220  ELSE IF(nft(jt,4).EQ.321) THEN
221  targ='PI+'
222  ELSE IF(nft(jt,4).EQ.-321) THEN
223  targ='PI-'
224  ELSE
225  WRITE(6,*) 'unavailable target type', nft(jt,4)
226  ENDIF
227 C
228  ihnt2(16)=1
229 C ******************indicate for initialization use when
230 C structure functions are called in PYTHIA
231 C
232  CALL pyhiinit('CMS',beam,targ,hint1(1))
233  mint4=mint(44)
234  mint5=mint(45)
235  mint44(i_type)=mint(44)
236  mint45(i_type)=mint(45)
237  atxs(0)=xsec(0,1)
238  xsec0(i_type,0)=xsec(0,1)
239  DO 500 i=1,200
240  atxs(i)=xsec(i,1)
241  xsec0(i_type,i)=xsec(i,1)
242  DO 500 j=1,20
243  atco(i,j)=coef(i,j)
244  coef0(i_type,i,j)=coef(i,j)
245 500 CONTINUE
246 C
247  ihnt2(16)=0
248 C
249  RETURN
250 C ********Store the initialization information for
251 C late use
252 C
253 C
254 800 mint(44)=mint44(i_type)
255  mint(45)=mint45(i_type)
256  mint4=mint(44)
257  mint5=mint(45)
258  xsec(0,1)=xsec0(i_type,0)
259  atxs(0)=xsec(0,1)
260  DO 900 i=1,200
261  xsec(i,1)=xsec0(i_type,i)
262  atxs(i)=xsec(i,1)
263  DO 900 j=1,20
264  coef(i,j)=coef0(i_type,i,j)
265  atco(i,j)=coef(i,j)
266 900 CONTINUE
267  i_last=i_trig
268  mint(11)=nfp(jp,4)
269  mint(12)=nft(jt,4)
270  RETURN
271  END