]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HIJING/hijing1_36/jetini.F
next50 trigger mask in AliHLTGlobalEsdConverterComponent
[u/mrichter/AliRoot.git] / HIJING / hijing1_36 / jetini.F
1 * $Id$
2 C
3 C
4 C
5 C
6 C
7         SUBROUTINE JETINI(JP,JT,I_TRIG)
8 C*******Initialize PYTHIA for jet production**********************
9 C       I_TRIG=0: for normal processes
10 C       I_TRIG=1: for triggered processes
11 C       JP: sequence number of the projectile
12 C       JT: sequence number of the target
13 C     For A+A collisions, one has to initilize pythia
14 C     separately for each type of collisions, pp, pn,np and nn,
15 C     or hp and hn for hA collisions. In this subroutine we use the following
16 C     catalogue for different type of collisions:
17 C     h+h: h+h (I_TYPE=1)
18 C     h+A: h+p (I_TYPE=1), h+n (I_TYPE=2)
19 C     A+h: p+h (I_TYPE=1), n+h (I_TYPE=2)
20 C     A+A: p+p (I_TYPE=1), p+n (I_TYPE=2), n+p (I_TYPE=3), n+n (I_TYPE=4)
21 C*****************************************************************
22         CHARACTER BEAM*16,TARG*16
23         DIMENSION XSEC0(8,0:200),COEF0(8,200,20),INI(8),
24      &          MINT44(8),MINT45(8)
25 #define BLANKET_SAVE
26 #include "hijcrdn.inc"
27 #include "hiparnt.inc"
28 #include "histrng.inc"
29 #include "hipyint.inc"
30 C
31 #include "ludat1_hijing.inc"
32 #include "ludat3_hijing.inc"
33 #include "pysubs_hijing.inc"
34 #include "pypars_hijing.inc"
35 #include "pyint1_hijing.inc"
36 #include "pyint2_hijing.inc"
37 #include "pyint5_hijing.inc"
38         DATA INI/8*0/I_LAST/-1/
39         SAVE
40 C
41         IHNT2(11)=JP
42         IHNT2(12)=JT
43         IF(IHNT2(5).NE.0 .AND. IHNT2(6).NE.0) THEN
44            I_TYPE=1
45         ELSE IF(IHNT2(5).NE.0 .AND. IHNT2(6).EQ.0) THEN
46            I_TYPE=1
47            IF(NFT(JT,4).EQ.2112) I_TYPE=2
48         ELSE IF(IHNT2(5).EQ.0 .AND. IHNT2(6).NE.0) THEN
49            I_TYPE=1
50            IF(NFP(JP,4).EQ.2112) I_TYPE=2
51         ELSE
52            IF(NFP(JP,4).EQ.2212 .AND. NFT(JT,4).EQ.2212) THEN
53               I_TYPE=1
54            ELSE IF(NFP(JP,4).EQ.2212 .AND. NFT(JT,4).EQ.2112) THEN
55               I_TYPE=2
56            ELSE IF(NFP(JP,4).EQ.2112 .AND. NFT(JT,4).EQ.2212) THEN
57               I_TYPE=3
58            ELSE
59               I_TYPE=4
60            ENDIF
61         ENDIF
62 c
63
64         IF(I_TRIG.NE.0) GO TO 160
65         IF(I_TRIG.EQ.I_LAST) GO TO 150
66         MSTP(2)=2
67 c                       ********second order running alpha_strong
68         MSTP(33)=1
69         PARP(31)=HIPR1(17)
70 C                       ********inclusion of K factor
71         MSTP(51)=3
72 C                       ********Duke-Owens set 1 structure functions
73         MSTP(61)=1
74 C                       ********INITIAL STATE RADIATION
75         MSTP(71)=1
76 C                       ********FINAL STATE RADIATION
77         IF(IHPR2(2).EQ.0.OR.IHPR2(2).EQ.2) MSTP(61)=0
78         IF(IHPR2(2).EQ.0.OR.IHPR2(2).EQ.1) MSTP(71)=0
79         MSTP(91) = 1
80 c
81         MSTP(81)=0
82 C                       ******** NO MULTIPLE INTERACTION
83         MSTP(82)=1
84 C                       *******STRUCTURE OF MUTLIPLE INTERACTION
85         MSTP(111)=0
86 C               ********frag off(have to be done by local call)
87         IF(IHPR2(10).EQ.0) MSTP(122)=0
88 C               ********No printout of initialization information
89         PARP(81)=HIPR1(8)
90         CKIN(5)=HIPR1(8)
91         CKIN(3)=HIPR1(8)
92         CKIN(4)=HIPR1(9)
93         IF(HIPR1(9).LE.HIPR1(8)) CKIN(4)=-1.0
94         CKIN(9)=-10.0
95         CKIN(10)=10.0
96         MSEL=0
97         DO 100 ISUB=1,200
98            MSUB(ISUB)=0
99  100    CONTINUE
100         MSUB(11)=1
101         MSUB(12)=1
102         MSUB(13)=1
103         MSUB(28)=1
104         MSUB(53)=1
105         MSUB(68)=1
106         MSUB(81)=1 
107         MSUB(82)=1
108         DO 110 J=1,MIN(8,MDCY(21,3))
109  110    MDME(MDCY(21,2)+J-1,1)=0
110         ISEL=4
111         IF(HINT1(1).GE.20.0 .and. IHPR2(18).EQ.1) ISEL=5
112         MDME(MDCY(21,2)+ISEL-1,1)=1
113 C                       ********QCD subprocesses
114         MSUB(14)=1
115         MSUB(18)=1
116         MSUB(29)=1
117 C                       ******* direct photon production
118  150    IF(INI(I_TYPE).NE.0) GO TO 800
119         GO TO 400
120 C
121 C       *****triggered subprocesses, jet, photon, heavy quark and DY
122 C
123  160    I_TYPE=4+I_TYPE
124         IF(I_TRIG.EQ.I_LAST) GO TO 260
125         PARP(81)=ABS(HIPR1(10))-0.25
126         CKIN(5)=ABS(HIPR1(10))-0.25
127         CKIN(3)=ABS(HIPR1(10))-0.25
128         CKIN(4)=ABS(HIPR1(10))+0.25
129         IF(HIPR1(10).LT.HIPR1(8)) CKIN(4)=-1.0
130 C       WRITE(6,*) "TRIGGERED", CKIN(3), CKIN(4), CKIN(5), IHPR2(3)
131 C
132 C ALICE
133 C
134         IF (HIPR1(50) .EQ. 1) THEN
135            MSTP(61) = 0
136            MSTP(71) = 0
137            MSTP(91) = 0
138         ENDIF
139
140 c
141         MSEL=0
142         DO 101 ISUB=1,200
143            MSUB(ISUB)=0
144  101    CONTINUE
145         IF(IHPR2(3).EQ.1) THEN
146            MSUB(11)=1
147            MSUB(12)=1
148            MSUB(13)=1
149            MSUB(28)=1
150            MSUB(53)=1
151            MSUB(68)=1
152            MSUB(81)=1
153            MSUB(82)=1
154            MSUB(14)=1
155            MSUB(18)=1
156            MSUB(29)=1
157            DO 102 J=1,MIN(8,MDCY(21,3))
158  102       MDME(MDCY(21,2)+J-1,1)=0
159            ISEL=4
160            IF(HINT1(1).GE.20.0 .and. IHPR2(18).EQ.1) ISEL=5
161            MDME(MDCY(21,2)+ISEL-1,1)=1
162 C                       ********QCD subprocesses
163         ELSE IF(IHPR2(3).EQ.2) THEN
164 C          WRITE(6,*) "DIRECT PHOTON PRODUCTION"
165            MSUB(14)=1
166            MSUB(18)=1
167            MSUB(29)=1
168 C               ********Direct photon production
169 c               q+qbar->g+gamma,q+qbar->gamma+gamma, q+g->q+gamma
170         ELSE IF(IHPR2(3).EQ.3) THEN
171            CKIN(3)=MAX(0.0,HIPR1(10))
172            CKIN(5)=HIPR1(8)
173            PARP(81)=HIPR1(8)
174            MSUB(81)=1
175            MSUB(82)=1
176            DO 105 J=1,MIN(8,MDCY(21,3))
177  105       MDME(MDCY(21,2)+J-1,1)=0
178            ISEL=4
179            IF(HINT1(1).GE.20.0 .and. IHPR2(18).EQ.1) ISEL=5
180            MDME(MDCY(21,2)+ISEL-1,1)=1
181 C             **********Heavy quark production
182         ENDIF
183 260     IF(INI(I_TYPE).NE.0) GO TO 800
184 C
185 C
186 400     INI(I_TYPE)=1
187         IF(IHPR2(10).EQ.0) MSTP(122)=0
188         IF(NFP(JP,4).EQ.2212) THEN
189                 BEAM='P'
190         ELSE IF(NFP(JP,4).EQ.-2212) THEN
191                 BEAM='P~'
192         ELSE IF(NFP(JP,4).EQ.2112) THEN
193                 BEAM='N'
194         ELSE IF(NFP(JP,4).EQ.-2112) THEN
195                 BEAM='N~'
196         ELSE IF(NFP(JP,4).EQ.211) THEN
197                 BEAM='PI+'
198         ELSE IF(NFP(JP,4).EQ.-211) THEN
199                 BEAM='PI-'
200         ELSE IF(NFP(JP,4).EQ.321) THEN
201                 BEAM='PI+'
202         ELSE IF(NFP(JP,4).EQ.-321) THEN
203                 BEAM='PI-'
204         ELSE
205                 WRITE(6,*) 'unavailable beam type', NFP(JP,4)
206         ENDIF
207         IF(NFT(JT,4).EQ.2212) THEN
208                 TARG='P'
209         ELSE IF(NFT(JT,4).EQ.-2212) THEN
210                 TARG='P~'
211         ELSE IF(NFT(JT,4).EQ.2112) THEN
212                 TARG='N'
213         ELSE IF(NFT(JT,4).EQ.-2112) THEN
214                 TARG='N~'
215         ELSE IF(NFT(JT,4).EQ.211) THEN
216                 TARG='PI+'
217         ELSE IF(NFT(JT,4).EQ.-211) THEN
218                 TARG='PI-'
219         ELSE IF(NFT(JT,4).EQ.321) THEN
220                 TARG='PI+'
221         ELSE IF(NFT(JT,4).EQ.-321) THEN
222                 TARG='PI-'
223         ELSE
224                 WRITE(6,*) 'unavailable target type', NFT(JT,4)
225         ENDIF
226 C
227         IHNT2(16)=1
228 C       ******************indicate for initialization use when
229 C                         structure functions are called in PYTHIA
230 C
231 C       WRITE(6,*) "CALL PYINIT WITH", CKIN(3), CKIN(4), MSTP(61), MSTP(71), MSTP(91)
232 C ALICE ->
233         IF (IHPR2(49) .EQ. 1) THEN
234 C SWITCH OFF MASSIVE FINAL QUARKS 
235            MSEL     = 0
236 C QCD on
237            MSUB(11) = 1
238            MSUB(12) = 1
239            MSUB(13) = 1
240            MSUB(28) = 1
241            MSUB(53) = 1
242            MSUB(68) = 1
243 C HF OFF
244            MSUB(81) = 0 
245            MSUB(82) = 0
246            MDME(127, 1) = 1
247            MDME(128, 1) = 1
248            MDME(129, 1) = 1
249 C g->QQbar off
250            MDME(130, 1) = 0
251            MDME(131, 1) = 0
252 C highest flavor in final state shower
253            MSTJ(45) = 3
254 C highest flavor in initial state shower and pdf
255            MSTP(54) = 3
256         ENDIF
257 C <- ALICE
258         CALL PYINIT_HIJING('CMS',BEAM,TARG,HINT1(1))
259         MINT4=MINT(44)
260         MINT5=MINT(45)
261         MINT44(I_TYPE)=MINT(44)
262         MINT45(I_TYPE)=MINT(45)
263         ATXS(0)=XSEC(0,1)
264         XSEC0(I_TYPE,0)=XSEC(0,1)
265         DO 500 I=1,200
266                 ATXS(I)=XSEC(I,1)
267                 XSEC0(I_TYPE,I)=XSEC(I,1)
268                 DO 500 J=1,20
269                         ATCO(I,J)=COEF(I,J)
270                         COEF0(I_TYPE,I,J)=COEF(I,J)
271 500     CONTINUE
272 C
273         IHNT2(16)=0
274 C
275         I_LAST=I_TRIG
276         RETURN
277 C               ********Store the initialization information for
278 C                               late use
279 C
280 C
281 800     MINT(44)=MINT44(I_TYPE)
282         MINT(45)=MINT45(I_TYPE)
283         MINT4=MINT(44)
284         MINT5=MINT(45)
285         XSEC(0,1)=XSEC0(I_TYPE,0)
286         ATXS(0)=XSEC(0,1)
287         DO 900 I=1,200
288                 XSEC(I,1)=XSEC0(I_TYPE,I)
289                 ATXS(I)=XSEC(I,1)
290         DO 900 J=1,20
291                 COEF(I,J)=COEF0(I_TYPE,I,J)
292                 ATCO(I,J)=COEF(I,J)
293 900     CONTINUE
294         I_LAST=I_TRIG
295         MINT(11)=NFP(JP,4)
296         MINT(12)=NFT(JT,4)
297         RETURN
298         END
299
300
301
302
303
304
305
306
307