Merging the VirtualMC branch to the main development branch (HEAD)
[u/mrichter/AliRoot.git] / HIJING / hipyset1_35 / lueevt_hijing.F
CommitLineData
e74335a4 1* $Id$
2
3C*********************************************************************
4
5 SUBROUTINE LUEEVT_HIJING(KFL,ECM)
6
7C...Purpose: to handle the generation of an e+e- annihilation jet event.
8 IMPLICIT DOUBLE PRECISION(D)
9#include "lujets_hijing.inc"
10#include "ludat1_hijing.inc"
11#include "ludat2_hijing.inc"
12
13C...Check input parameters.
14 IF(MSTU(12).GE.1) CALL LULIST_HIJING(0)
15 IF(KFL.LT.0.OR.KFL.GT.8) THEN
16 CALL LUERRM_HIJING(16
17 $ ,'(LUEEVT_HIJING:) called with unknown flavour code')
18 IF(MSTU(21).GE.1) RETURN
19 ENDIF
20 IF(KFL.LE.5) ECMMIN=PARJ(127)+2.02*PARF(100+MAX(1,KFL))
21 IF(KFL.GE.6) ECMMIN=PARJ(127)+2.02*PMAS(KFL,1)
22 IF(ECM.LT.ECMMIN) THEN
23 CALL LUERRM_HIJING(16
24 $ ,'(LUEEVT_HIJING:) called with too small CM energy')
25 IF(MSTU(21).GE.1) RETURN
26 ENDIF
27
28C...Check consistency of MSTJ options set.
29 IF(MSTJ(109).EQ.2.AND.MSTJ(110).NE.1) THEN
30 CALL LUERRM_HIJING(6,
31 & '(LUEEVT_HIJING:) MSTJ(109) value requires MSTJ(110) = 1')
32 MSTJ(110)=1
33 ENDIF
34 IF(MSTJ(109).EQ.2.AND.MSTJ(111).NE.0) THEN
35 CALL LUERRM_HIJING(6,
36 & '(LUEEVT_HIJING:) MSTJ(109) value requires MSTJ(111) = 0')
37 MSTJ(111)=0
38 ENDIF
39
40C...Initialize alpha_strong and total cross-section.
41 MSTU(111)=MSTJ(108)
42 IF(MSTJ(108).EQ.2.AND.(MSTJ(101).EQ.0.OR.MSTJ(101).EQ.1))
43 &MSTU(111)=1
44 PARU(112)=PARJ(121)
45 IF(MSTU(111).EQ.2) PARU(112)=PARJ(122)
46 IF(MSTJ(116).GT.0.AND.(MSTJ(116).GE.2.OR.ABS(ECM-PARJ(151)).GE.
47 & PARJ(139).OR.10*MSTJ(102)+KFL.NE.MSTJ(119))) CALL
48 $ LUXTOT_HIJING(KFL,ECM,XTOT)
49 IF(MSTJ(116).GE.3) MSTJ(116)=1
50
51C...Add initial e+e- to event record (documentation only).
52 NTRY=0
53 100 NTRY=NTRY+1
54 IF(NTRY.GT.100) THEN
55 CALL LUERRM_HIJING(14
56 $ ,'(LUEEVT_HIJING:) caught in an infinite loop')
57 RETURN
58 ENDIF
59 NC=0
60 IF(MSTJ(115).GE.2) THEN
61 NC=NC+2
62 CALL LU1ENT_HIJING(NC-1,11,0.5*ECM,0.,0.)
63 K(NC-1,1)=21
64 CALL LU1ENT_HIJING(NC,-11,0.5*ECM,PARU(1),0.)
65 K(NC,1)=21
66 ENDIF
67
68C...Radiative photon (in initial state).
69 MK=0
70 ECMC=ECM
71 IF(MSTJ(107).GE.1.AND.MSTJ(116).GE.1) CALL LURADK_HIJING(ECM,MK
72 $ ,PAK,THEK,PHIK,ALPK)
73 IF(MK.EQ.1) ECMC=SQRT(ECM*(ECM-2.*PAK))
74 IF(MSTJ(115).GE.1.AND.MK.EQ.1) THEN
75 NC=NC+1
76 CALL LU1ENT_HIJING(NC,22,PAK,THEK,PHIK)
77 K(NC,3)=MIN(MSTJ(115)/2,1)
78 ENDIF
79
80C...Virtual exchange boson (gamma or Z0).
81 IF(MSTJ(115).GE.3) THEN
82 NC=NC+1
83 KF=22
84 IF(MSTJ(102).EQ.2) KF=23
85 MSTU10=MSTU(10)
86 MSTU(10)=1
87 P(NC,5)=ECMC
88 CALL LU1ENT_HIJING(NC,KF,ECMC,0.,0.)
89 K(NC,1)=21
90 K(NC,3)=1
91 MSTU(10)=MSTU10
92 ENDIF
93
94C...Choice of flavour and jet configuration.
95 CALL LUXKFL_HIJING(KFL,ECM,ECMC,KFLC)
96 IF(KFLC.EQ.0) GOTO 100
97 CALL LUXJET_HIJING(ECMC,NJET,CUT)
98 KFLN=21
99 IF(NJET.EQ.4) CALL LUX4JT_HIJING(NJET,CUT,KFLC,ECMC,KFLN,X1,X2,X4,
100 &X12,X14)
101 IF(NJET.EQ.3) CALL LUX3JT_HIJING(NJET,CUT,KFLC,ECMC,X1,X3)
102 IF(NJET.EQ.2) MSTJ(120)=1
103
104C...Fill jet configuration and origin.
105 IF(NJET.EQ.2.AND.MSTJ(101).NE.5) CALL LU2ENT_HIJING(NC+1,KFLC,
106 $ -KFLC,ECMC)
107 IF(NJET.EQ.2.AND.MSTJ(101).EQ.5) CALL LU2ENT_HIJING(-(NC+1),KFLC,
108 $ -KFLC,ECMC)
109 IF(NJET.EQ.3) CALL LU3ENT_HIJING(NC+1,KFLC,21,-KFLC,ECMC,X1,X3)
110 IF(NJET.EQ.4.AND.KFLN.EQ.21) CALL LU4ENT_HIJING(NC+1,KFLC,KFLN
111 $ ,KFLN,-KFLC,ECMC,X1,X2,X4,X12,X14)
112 IF(NJET.EQ.4.AND.KFLN.NE.21) CALL LU4ENT_HIJING(NC+1,KFLC,-KFLN
113 $ ,KFLN,-KFLC,ECMC,X1,X2,X4,X12,X14)
114 DO 110 IP=NC+1,N
115 110 K(IP,3)=K(IP,3)+MIN(MSTJ(115)/2,1)+(MSTJ(115)/3)*(NC-1)
116
117C...Angular orientation according to matrix element.
118 IF(MSTJ(106).EQ.1) THEN
119 CALL LUXDIF_HIJING(NC,NJET,KFLC,ECMC,CHI,THE,PHI)
120 CALL LUDBRB_HIJING(NC+1,N,0.,CHI,0D0,0D0,0D0)
121 CALL LUDBRB_HIJING(NC+1,N,THE,PHI,0D0,0D0,0D0)
122 ENDIF
123
124C...Rotation and boost from radiative photon.
125 IF(MK.EQ.1) THEN
126 DBEK=-PAK/(ECM-PAK)
127 NMIN=NC+1-MSTJ(115)/3
128 CALL LUDBRB_HIJING(NMIN,N,0.,-PHIK,0D0,0D0,0D0)
129 CALL LUDBRB_HIJING(NMIN,N,ALPK,0.,DBEK*SIN(THEK),0D0,DBEK
130 $ *COS(THEK))
131 CALL LUDBRB_HIJING(NMIN,N,0.,PHIK,0D0,0D0,0D0)
132 ENDIF
133
134C...Generate parton shower. Rearrange along strings and check.
135 IF(MSTJ(101).EQ.5) THEN
136 CALL LUSHOW_HIJING(N-1,N,ECMC)
137 MSTJ14=MSTJ(14)
138 IF(MSTJ(105).EQ.-1) MSTJ(14)=0
139 IF(MSTJ(105).GE.0) MSTU(28)=0
140 CALL LUPREP_HIJING(0)
141 MSTJ(14)=MSTJ14
142 IF(MSTJ(105).GE.0.AND.MSTU(28).NE.0) GOTO 100
143 ENDIF
144
145C...Fragmentation/decay generation. Information for LUTABU_HIJING.
146 IF(MSTJ(105).EQ.1) CALL LUEXEC_HIJING
147 MSTU(161)=KFLC
148 MSTU(162)=-KFLC
149
150 RETURN
151 END