Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
pyeevt.f
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file pyeevt.f
1 
2 C*********************************************************************
3 
4 C...PYEEVT
5 C...Handles the generation of an e+e- annihilation jet event.
6 
7  SUBROUTINE pyeevt(KFL,ECM)
8 
9 C...Double precision and integer declarations.
10  IMPLICIT DOUBLE PRECISION(a-h, o-z)
11  IMPLICIT INTEGER(i-n)
12  INTEGER pyk,pychge,pycomp
13 C...Commonblocks.
14  common/pyjets/n,npad,k(4000,5),p(4000,5),v(4000,5)
15  common/pydat1/mstu(200),paru(200),mstj(200),parj(200)
16  common/pydat2/kchg(500,4),pmas(500,4),parf(2000),vckm(4,4)
17  SAVE /pyjets/,/pydat1/,/pydat2/
18 
19 C...Check input parameters.
20  IF(mstu(12).NE.12345) CALL pylist(0)
21  IF(kfl.LT.0.OR.kfl.GT.8) THEN
22  CALL pyerrm(16,'(PYEEVT:) called with unknown flavour code')
23  IF(mstu(21).GE.1) RETURN
24  ENDIF
25  IF(kfl.LE.5) ecmmin=parj(127)+2.02d0*parf(100+max(1,kfl))
26  IF(kfl.GE.6) ecmmin=parj(127)+2.02d0*pmas(kfl,1)
27  IF(ecm.LT.ecmmin) THEN
28  CALL pyerrm(16,'(PYEEVT:) called with too small CM energy')
29  IF(mstu(21).GE.1) RETURN
30  ENDIF
31 
32 C...Check consistency of MSTJ options set.
33  IF(mstj(109).EQ.2.AND.mstj(110).NE.1) THEN
34  CALL pyerrm(6,
35  & '(PYEEVT:) MSTJ(109) value requires MSTJ(110) = 1')
36  mstj(110)=1
37  ENDIF
38  IF(mstj(109).EQ.2.AND.mstj(111).NE.0) THEN
39  CALL pyerrm(6,
40  & '(PYEEVT:) MSTJ(109) value requires MSTJ(111) = 0')
41  mstj(111)=0
42  ENDIF
43 
44 C...Initialize alpha_strong and total cross-section.
45  mstu(111)=mstj(108)
46  IF(mstj(108).EQ.2.AND.(mstj(101).EQ.0.OR.mstj(101).EQ.1))
47  &mstu(111)=1
48  paru(112)=parj(121)
49  IF(mstu(111).EQ.2) paru(112)=parj(122)
50  IF(mstj(116).GT.0.AND.(mstj(116).GE.2.OR.abs(ecm-parj(151)).GE.
51  &parj(139).OR.10*mstj(102)+kfl.NE.mstj(119))) CALL pyxtee(kfl,ecm,
52  &xtot)
53  IF(mstj(116).GE.3) mstj(116)=1
54  parj(171)=0d0
55 
56 C...Add initial e+e- to event record (documentation only).
57  ntry=0
58  100 ntry=ntry+1
59  IF(ntry.GT.100) THEN
60  CALL pyerrm(14,'(PYEEVT:) caught in an infinite loop')
61  RETURN
62  ENDIF
63  mstu(24)=0
64  nc=0
65  IF(mstj(115).GE.2) THEN
66  nc=nc+2
67  CALL py1ent(nc-1,11,0.5d0*ecm,0d0,0d0)
68  k(nc-1,1)=21
69  CALL py1ent(nc,-11,0.5d0*ecm,paru(1),0d0)
70  k(nc,1)=21
71  ENDIF
72 
73 C...Radiative photon (in initial state).
74  mk=0
75  ecmc=ecm
76  IF(mstj(107).GE.1.AND.mstj(116).GE.1) CALL pyradk(ecm,mk,pak,
77  &thek,phik,alpk)
78  IF(mk.EQ.1) ecmc=sqrt(ecm*(ecm-2d0*pak))
79  IF(mstj(115).GE.1.AND.mk.EQ.1) THEN
80  nc=nc+1
81  CALL py1ent(nc,22,pak,thek,phik)
82  k(nc,3)=min(mstj(115)/2,1)
83  ENDIF
84 
85 C...Virtual exchange boson (gamma or Z0).
86  IF(mstj(115).GE.3) THEN
87  nc=nc+1
88  kf=22
89  IF(mstj(102).EQ.2) kf=23
90  mstu10=mstu(10)
91  mstu(10)=1
92  p(nc,5)=ecmc
93  CALL py1ent(nc,kf,ecmc,0d0,0d0)
94  k(nc,1)=21
95  k(nc,3)=1
96  mstu(10)=mstu10
97  ENDIF
98 
99 C...Choice of flavour and jet configuration.
100  CALL pyxkfl(kfl,ecm,ecmc,kflc)
101  IF(kflc.EQ.0) goto 100
102  CALL pyxjet(ecmc,njet,cut)
103  kfln=21
104  IF(njet.EQ.4) CALL pyx4jt(njet,cut,kflc,ecmc,kfln,x1,x2,x4,
105  &x12,x14)
106  IF(njet.EQ.3) CALL pyx3jt(njet,cut,kflc,ecmc,x1,x3)
107  IF(njet.EQ.2) mstj(120)=1
108 
109 C...Fill jet configuration and origin.
110  IF(njet.EQ.2.AND.mstj(101).NE.5) CALL py2ent(nc+1,kflc,-kflc,ecmc)
111  IF(njet.EQ.2.AND.mstj(101).EQ.5) CALL py2ent(-(nc+1),kflc,-kflc,
112  &ecmc)
113  IF(njet.EQ.3) CALL py3ent(nc+1,kflc,21,-kflc,ecmc,x1,x3)
114  IF(njet.EQ.4.AND.kfln.EQ.21) CALL py4ent(nc+1,kflc,kfln,kfln,
115  &-kflc,ecmc,x1,x2,x4,x12,x14)
116  IF(njet.EQ.4.AND.kfln.NE.21) CALL py4ent(nc+1,kflc,-kfln,kfln,
117  &-kflc,ecmc,x1,x2,x4,x12,x14)
118  IF(mstu(24).NE.0) goto 100
119  DO 110 ip=nc+1,n
120  k(ip,3)=k(ip,3)+min(mstj(115)/2,1)+(mstj(115)/3)*(nc-1)
121  110 CONTINUE
122 
123 C...Angular orientation according to matrix element.
124  IF(mstj(106).EQ.1) THEN
125  CALL pyxdif(nc,njet,kflc,ecmc,chi,the,phi)
126  CALL pyrobo(nc+1,n,0d0,chi,0d0,0d0,0d0)
127  CALL pyrobo(nc+1,n,the,phi,0d0,0d0,0d0)
128  ENDIF
129 
130 C...Rotation and boost from radiative photon.
131  IF(mk.EQ.1) THEN
132  dbek=-pak/(ecm-pak)
133  nmin=nc+1-mstj(115)/3
134  CALL pyrobo(nmin,n,0d0,-phik,0d0,0d0,0d0)
135  CALL pyrobo(nmin,n,alpk,0d0,dbek*sin(thek),0d0,dbek*cos(thek))
136  CALL pyrobo(nmin,n,0d0,phik,0d0,0d0,0d0)
137  ENDIF
138 
139 C...Generate parton shower. Rearrange along strings and check.
140  IF(mstj(101).EQ.5) THEN
141  CALL pyshow(n-1,n,ecmc)
142  mstj14=mstj(14)
143  IF(mstj(105).EQ.-1) mstj(14)=-1
144  IF(mstj(105).GE.0) mstu(28)=0
145  CALL pyprep(0)
146  mstj(14)=mstj14
147  IF(mstj(105).GE.0.AND.mstu(28).NE.0) goto 100
148  ENDIF
149 
150 C...Fragmentation/decay generation. Information for PYTABU.
151  IF(mstj(105).EQ.1) CALL pyexec
152  mstu(161)=kflc
153  mstu(162)=-kflc
154 
155  RETURN
156  END