5 SUBROUTINE HIJHRD(JP,JT,JOUT,JFLG,IOPJET0)
7 C IOPTJET=1, ALL JET WILL FORM SINGLE STRING SYSTEM
8 C 0, ONLY Q-QBAR JET FORM SINGLE STRING SYSTEM
9 C*******Perform jets production and fragmentation when JP JT *******
10 C scatter. JOUT-> number of hard scatterings precede this one *
11 C for the the same pair(JP,JT). JFLG->a flag to show whether *
12 C jets can be produced (with valence quark=1,gluon=2, q-qbar=3)*
13 C or not(0). Information of jets are in COMMON/ATTJET and *
14 C /MINJET. ABS(NFP(JP,6)) is the total number jets produced by *
15 C JP. If NFP(JP,6)<0 JP can not produce jet anymore. *
16 C*******************************************************************
17 DIMENSION IP(100,2),IPQ(50),IPB(50),IT(100,2),ITQ(50),ITB(50)
19 #include "hijcrdn.inc"
20 #include "hiparnt.inc"
22 #include "histrng.inc"
23 #include "hijjet1.inc"
24 #include "hijjet2.inc"
25 #include "hijjet4.inc"
26 C************************************ HIJING common block
27 #include "lujets_hijing.inc"
28 #include "ludat1_hijing.inc"
29 #include "pysubs_hijing.inc"
30 #include "pypars_hijing.inc"
31 #include "pyint1_hijing.inc"
32 #include "pyint2_hijing.inc"
33 #include "pyint5_hijing.inc"
34 #include "hipyint.inc"
36 C*********************************** LU common block
38 C SIZE OF COMMON BLOCK FOR # OF PARTON PER STRING
40 C SIZE OF COMMON BLOCK FOR # OF SINGLE STRINGS
42 C SIZE OF COMMON BLOCK FOR # OF PARTON PER SINGLE
49 IF(IOPJET.EQ.1.AND.(NFP(JP,6).NE.0.OR.NFT(JT,6).NE.0))
51 IF(JP.GT.IHNT2(1) .OR. JT.GT.IHNT2(3)) RETURN
52 IF(NFP(JP,6).LT.0 .OR. NFT(JT,6).LT.0) RETURN
53 C ******** JP or JT can not produce jet anymore
60 IF(EPP.LT.0.0) GO TO 1000
61 IF(EPM.LT.0.0) GO TO 1000
62 IF(ETP.LT.0.0) GO TO 1000
63 IF(ETM.LT.0.0) GO TO 1000
64 IF(EPP/(EPM+0.01).LE.ETP/(ETM+0.01)) RETURN
66 C ********for the first hard scattering of (JP,JT)
67 C have collision only when Ycm(JP)>Ycm(JT)
69 ECUT1=HIPR1(1)+HIPR1(8)+PP(JP,14)+PP(JP,15)
70 ECUT2=HIPR1(1)+HIPR1(8)+PT(JT,14)+PT(JT,15)
71 IF(PP(JP,4).LE.ECUT1) THEN
72 NFP(JP,6)=-ABS(NFP(JP,6))
75 IF(PT(JT,4).LE.ECUT2) THEN
76 NFT(JT,6)=-ABS(NFT(JT,6))
79 C *********must have enough energy to produce jets
85 IF(NFP(JP,10).EQ.0 .AND. NFT(JT,10).EQ.0) THEN
101 IF(XSEC(11,1).NE.0) ISUB11=1
102 IF(XSEC(12,1).NE.0) ISUB12=1
103 IF(XSEC(28,1).NE.0) ISUB28=1
104 MINT(44)=MINT4-ISUB11-ISUB12-ISUB28
105 MINT(45)=MINT5-ISUB11-ISUB12-ISUB28
106 XSEC(0,1)=ATXS(0)-ATXS(11)-ATXS(12)-ATXS(28)
116 C ********Scatter the valence quarks only once per NN
118 C afterwards only gluon can have hard scattering.
119 155 CALL PYTHIA_HIJING
121 IF(JJ.NE.1) GO TO 155
122 C *********one hard collision at a time
123 IF(K(7,2).EQ.-K(8,2)) THEN
124 QMASS2=(P(7,4)+P(8,4))**2-(P(7,1)+P(8,1))**2
125 & -(P(7,2)+P(8,2))**2-(P(7,3)+P(8,3))**2
126 QM=ULMASS_HIJING(K(7,2))
127 IF(QMASS2.LT.(2.0*QM+HIPR1(1))**2) GO TO 155
129 C ********q-qbar jets must has minimum mass HIPR1(1)
139 IF(PEP.LE.ECUT1) THEN
141 IF(MISP.LT.50) GO TO 155
142 NFP(JP,6)=-ABS(NFP(JP,6))
145 IF(PET.LE.ECUT2) THEN
147 IF(MIST.LT.50) GO TO 155
148 NFT(JT,6)=-ABS(NFT(JT,6))
151 C ******** if the remain energy<ECUT the proj or targ
152 C can not produce jet anymore
156 IF(WP.LT.0.0 .OR. WM.LT.0.0) THEN
158 IF(MISS.LT.50) GO TO 155
161 C ********the total W+, W- must be positive
163 AMPX=SQRT((ECUT1-HIPR1(8))**2+PXP**2+PYP**2+0.01)
164 AMTX=SQRT((ECUT2-HIPR1(8))**2+PXT**2+PYT**2+0.01)
166 IF(SW.LT.SXX.OR.VINT(43).LT.HIPR1(1)) THEN
168 IF(MISS.LT.50) GO TO 155
171 C ********the proj and targ remnants must have at least
172 C a CM energy that can produce two strings
173 C with minimum mass HIPR1(1)(see HIJSFT HIJFRG)
180 HINT1(46)=SQRT(P(7,1)**2+P(7,2)**2)
186 HINT1(56)=SQRT(P(8,1)**2+P(8,2)**2)
190 PINIRAD=(1.0-EXP(-2.0*(VINT(47)-HIDAT(1))))
191 & /(1.0+EXP(-2.0*(VINT(47)-HIDAT(1))))
193 IF(RLU_HIJING(0).LE.PINIRAD) I_INIRAD=1
194 IF(K(7,2).EQ.-K(8,2)) GO TO 190
195 IF(K(7,2).EQ.21.AND.K(8,2).EQ.21.AND.IOPJET.EQ.1) GO TO 190
196 C*******************************************************************
197 C gluon jets are going to be connectd with
198 C the final leading string of quark-aintquark
199 C*******************************************************************
218 IF(K(I,3).EQ.1 .OR. K(I,3).EQ.2.OR.
219 & ABS(K(I,2)).GT.30) GO TO 180
220 C************************************************************
222 HINT1(47)=HINT1(47)+P(I,1)
223 HINT1(48)=HINT1(48)+P(I,2)
224 HINT1(49)=HINT1(49)+P(I,3)
225 HINT1(50)=HINT1(50)+P(I,4)
228 HINT1(67)=HINT1(67)+P(I,1)
229 HINT1(68)=HINT1(68)+P(I,2)
230 HINT1(69)=HINT1(69)+P(I,3)
231 HINT1(70)=HINT1(70)+P(I,4)
233 C************************modifcation made on Apr 10. 1996*****
234 IF(K(I,2).GT.21.AND.K(I,2).LE.30) THEN
244 C************************************************************
246 C************************correction made on Oct. 14,1994*****
248 IF(K(I,3).EQ.7.OR.K(I,3).EQ.3) THEN
249 IF(K(I,3).EQ.7.AND.K(I,2).NE.21.AND.K(I,2).EQ.K(7,2)
250 & .AND.IS7.EQ.0) THEN
260 IF(K(I,3).EQ.3.AND.(K(I,2).NE.21.OR.
261 & I_INIRAD.EQ.0)) THEN
271 IF(K(I,2).NE.21) THEN
276 ELSE IF(K(I,2).LT.0) THEN
282 ELSE IF(K(I,3).EQ.8.OR.K(I,3).EQ.4) THEN
283 IF(K(I,3).EQ.8.AND.K(I,2).NE.21.AND.K(I,2).EQ.K(8,2)
284 & .AND.IS8.EQ.0) THEN
294 IF(K(I,3).EQ.4.AND.(K(I,2).NE.21.OR.
295 & I_INIRAD.EQ.0)) THEN
305 IF(K(I,2).NE.21) THEN
310 ELSE IF(K(I,2).LT.0) THEN
320 IF(LPQ.NE.LPB .OR. LTQ.NE.LTB) THEN
322 IF(MISS.LE.50) GO TO 155
323 WRITE(6,*) ' Q -QBAR NOT MATCHED IN HIJHRD'
327 C****The following will rearrange the partons so that a quark is***
328 C****allways followed by an anti-quark ****************************
332 IF(J.GT.JPP) GO TO 182
333 IF(IP(J,2).EQ.0) THEN
335 ELSE IF(IP(J,2).NE.0) THEN
339 IP(J,1)=IP(IPQ(LP),1)
340 IP(J,2)=IP(IPQ(LP),2)
345 ELSE IF(IP2.LT.0) THEN
348 C ********replace J with a quark
351 IP(J+1,1)=IP(IPB(LP),1)
352 IP(J+1,2)=IP(IPB(LP),2)
357 ELSE IF(IP2.LT.0) THEN
360 C ******** replace J+1 with anti-quark
367 IF(J.GT.JTT) GO TO 184
368 IF(IT(J,2).EQ.0) THEN
370 ELSE IF(IT(J,2).NE.0) THEN
374 IT(J,1)=IT(ITQ(LT),1)
375 IT(J,2)=IT(ITQ(LT),2)
380 ELSE IF(IT2.LT.0) THEN
383 C ********replace J with a quark
386 IT(J+1,1)=IT(ITB(LT),1)
387 IT(J+1,2)=IT(ITB(LT),2)
392 ELSE IF(IT2.LT.0) THEN
395 C ******** replace J+1 with anti-quark
402 IF(NPJ(JP)+JPP.GT.MXJT.OR.NTJ(JT)+JTT.GT.MXJT) THEN
404 WRITE(6,*) 'number of partons per string exceeds'
405 WRITE(6,*) 'the common block size'
408 C ********check the bounds of common blocks
410 KFPJ(JP,NPJ(JP)+J)=K(IP(J,1),2)
411 PJPX(JP,NPJ(JP)+J)=P(IP(J,1),1)
412 PJPY(JP,NPJ(JP)+J)=P(IP(J,1),2)
413 PJPZ(JP,NPJ(JP)+J)=P(IP(J,1),3)
414 PJPE(JP,NPJ(JP)+J)=P(IP(J,1),4)
415 PJPM(JP,NPJ(JP)+J)=P(IP(J,1),5)
419 KFTJ(JT,NTJ(JT)+J)=K(IT(J,1),2)
420 PJTX(JT,NTJ(JT)+J)=P(IT(J,1),1)
421 PJTY(JT,NTJ(JT)+J)=P(IT(J,1),2)
422 PJTZ(JT,NTJ(JT)+J)=P(IT(J,1),3)
423 PJTE(JT,NTJ(JT)+J)=P(IT(J,1),4)
424 PJTM(JT,NTJ(JT)+J)=P(IT(J,1),5)
428 C*****************************************************************
429 CThis is the case of a quark-antiquark jet it will fragment alone
430 C****************************************************************
432 IF(K(7,2).NE.21.AND.K(8,2).NE.21.AND.
433 & K(7,2)*K(8,2).GT.0) GO TO 155
438 IF(K(I,3).EQ.1.OR.K(I,3).EQ.2.OR.
439 & ABS(K(I,2)).GT.30) GO TO 200
440 IF(K(I,2).GT.21.AND.K(I,2).LE.30) THEN
450 C************************************************************
452 C************************correction made on Oct. 14,1994*****
454 IF(K(I,3).EQ.3.AND.(K(I,2).NE.21.OR.
455 & I_INIRAD.EQ.0)) THEN
462 IF(K(I,3).EQ.4.AND.(K(I,2).NE.21.OR.
463 & I_INIRAD.EQ.0)) THEN
473 IF(K(I,2).NE.21) THEN
478 ELSE IF(K(I,2).LT.0) THEN
487 IF(MISS.LE.50) GO TO 155
488 WRITE(6,*) LPQ,LPB, 'Q-QBAR NOT CONSERVED OR NOT MATCHED'
493 C**** The following will rearrange the partons so that a quark is***
494 C**** allways followed by an anti-quark ****************************
497 IF(J.GT.JPP) GO TO 222
498 IF(IP(J,2).EQ.0) GO TO 220
502 IP(J,1)=IP(IPQ(LP),1)
503 IP(J,2)=IP(IPQ(LP),2)
508 ELSE IF(IP2.LT.0) THEN
512 C ********replace J with a quark
515 IP(J+1,1)=IP(IPB(LP),1)
516 IP(J+1,2)=IP(IPB(LP),2)
521 ELSE IF(IP2.LT.0) THEN
524 C ******** replace J+1 with an anti-quark
534 IP(2*L0-3,1)=IP(IPQ(L0),1)
535 IP(2*L0-3,2)=IP(IPQ(L0),2)
540 ELSE IF(IP2.LT.0) THEN
547 IP(2*L0-2,1)=IP(IPB(L0),1)
548 IP(2*L0-2,2)=IP(IPB(L0),2)
553 ELSE IF(IP2.LT.0) THEN
558 C ********move all the qqbar pair to the front of
559 C the list, except the first pair
562 IP(2*LPQ-1,1)=IP(IPQ(1),1)
563 IP(2*LPQ-1,2)=IP(IPQ(1),2)
568 ELSE IF(IP2.LT.0) THEN
572 C ********move the first quark to the beginning of
573 C the last string system
576 IP(JPP,1)=IP(IPB(1),1)
577 IP(JPP,2)=IP(IPB(1),2)
582 ELSE IF(IP2.LT.0) THEN
586 C ********move the first anti-quark to the end of the
591 WRITE(6,*) 'number of jets forming single strings exceeds'
592 WRITE(6,*) 'the common block size'
597 WRITE(6,*) 'number of partons per single jet system'
598 WRITE(6,*) 'exceeds the common block size'
601 C ********check the bounds of common block size
609 K2SG(NSG,I)=K(IP(I,1),2)
610 IF(K2SG(NSG,I).LT.0) K1SG(NSG,I)=1
611 PXSG(NSG,I)=P(IP(I,1),1)
612 PYSG(NSG,I)=P(IP(I,1),2)
613 PZSG(NSG,I)=P(IP(I,1),3)
614 PESG(NSG,I)=P(IP(I,1),4)
615 PMSG(NSG,I)=P(IP(I,1),5)
619 C******* reset the energy-momentum of incoming particles ********
631 NFP(JP,6)=NFP(JP,6)+1
632 NFT(JT,6)=NFT(JT,6)+1
636 IF(IHPR2(10).EQ.0) RETURN
637 WRITE(6,*) 'Fatal HIJHRD error'
638 WRITE(6,*) JP, ' proj E+,E-',EPP,EPM,' status',NFP(JP,5)
639 WRITE(6,*) JT, ' targ E+,E_',ETP,ETM,' status',NFT(JT,5)