EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
lqgev.F
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file lqgev.F
1 
2 C **********************************************************************
3 
4  SUBROUTINE lqgev
5 
6  IMPLICIT NONE
7 
8 C...Generate quark-gluon jet event, choose xp and zp according to QCD
9 C...matrix elements and apply cuts for soft and collinear gluons.
10 
11 *
12 * to avoid variable conflictions, a second keep element is necessary
13 * with the same common block name (see LPTOU2)
14 *
15  COMMON /leptou/ cut(14),lst(40),parl(30),
16  & x,y,w2,q2,u
17  REAL cut,parl,x,y,w2,q2,u
18  INTEGER lst
19  SAVE /leptou/
20 
21  COMMON /linter/ pari(50),ewqc(2,2,8),qc(8),zl(2,4),zq(2,8),pq(17)
22  REAL pari,ewqc,qc,zl,zq,pq
23  SAVE /linter/
24 
25  INTEGER nlupdm,nplbuf
26  parameter(nlupdm=4000,nplbuf=5)
27  common/lujets/n,k(nlupdm,5),p(nlupdm,nplbuf),v(nlupdm,5)
28  INTEGER n,k
29  REAL p,v
30  SAVE /lujets/
31 
32  common/ludat1/mstu(200),paru(200),mstj(200),parj(200)
33  INTEGER mstu,mstj
34  REAL paru,parj
35  SAVE /ludat1/
36 
37  common/ludat2/kchg(500,3),pmas(500,4),parf(2000),vckm(4,4)
38  INTEGER kchg
39  REAL pmas,parf,vckm
40  SAVE /ludat2/
41 
42 
43  INTEGER j1,j2,j3,j4,ifail,ifl,iflr,lqmcut,iflro,k2,nremh
44  REAL w,xp,zp,amifl,xt,amk2,pt,phi,pt2,tm2k2,tmiflr,epz,amiflr
45  REAL ulmass
46  INTEGER lucomp,kfk2,kfiflr
47 
48  lst(24)=2
49  w=sqrt(w2)
50  j1=mstu(1)
51  j2=mstu(1)+1
52  j3=mstu(1)+2
53  j4=mstu(1)+3
54  CALL lxp(xp,ifail)
55  IF(ifail.NE.0) goto 999
56 
57 C...Choose flavour of scattered quark and target remnant.
58  200 CALL lflav(ifl,iflr)
59  IF(lst(21).NE.0) RETURN
60  CALL lzp(xp,zp,ifail)
61  IF(ifail.NE.0) goto 999
62  mstj(93)=1
63  amifl=ulmass(ifl)
64  mstj(93)=1
65  amiflr=ulmass(iflr)
66 
67  IF(lst(14).EQ.0.OR.iflr.GT.10
68  &.OR.(lst(8).GE.2.AND.mod(lst(8),10).NE.9)) THEN
69  IF(w.LT.amifl+amiflr+parj(32)) goto 999
70  IF(lqmcut(xp,zp,amifl,0.,amiflr).NE.0) goto 999
71 C Pass the (consituent quark) masses we are using to LU3ENT
72  p(j1,5)=amifl
73  p(j2,5)=0
74  p(j3,5)=amiflr
75  mstu(10)=1
76  CALL lu3ent(j1,ifl,21,iflr,w,pari(21),pari(23))
77  mstu(10)=2
78  k(mstu(1)+2,3)=2
79  CALL lurobo(acos(-p(j3,3)/sqrt(p(j3,3)**2+p(j3,1)**2)),
80  & 0.,0.,0.,0.)
81  ELSE
82 C...Target remnant is not a simple diquark, special treatment needed.
83  IF(w.LT.amifl+amiflr+1.+parj(32)) goto 999
84  IF(lqmcut(xp,zp,amifl,0.,1.).NE.0) goto 999
85  iflro=iflr
86  nremh=0
87  300 nremh=nremh+1
88  IF(nremh.GT.100) goto 999
89  CALL lprikt(parl(14),pt,phi)
90  CALL lremh(iflro,pt,iflr,k2,xt)
91  mstj(93)=1
92  amiflr=ulmass(iflr)
93 CJR--
94  kfiflr=lucomp(iflr)
95  IF (kfiflr.EQ.90) THEN
96  amiflr=amiflr-2.*parl(20)
97  ELSEIF (1.LE.kfiflr .AND. kfiflr.LE.6) THEN
98  amiflr=amiflr-parl(20)
99  ENDIF
100  mstj(93)=1
101  amk2=ulmass(k2)
102  kfk2=lucomp(k2)
103  IF (kfk2.EQ.90) THEN
104  amk2=amk2-2.*parl(20)
105  ELSEIF (1.LE.kfk2 .AND. kfk2.LE.6) THEN
106  amk2=amk2-parl(20)
107  ENDIF
108 CJR--
109  p(j1,5)=amifl
110  p(j2,5)=0.
111  pt2=pt**2
112  tm2k2=amk2**2+pt2
113  tmiflr=amiflr**2+pt2
114  p(j3,5)=sqrt(tm2k2/xt+tmiflr/(1.-xt))
115  IF(lqmcut(xp,zp,amifl,0.,p(j3,5)).NE.0) goto 300
116  mstu(10)=1
117  CALL lu3ent(j1,ifl,21,iflr,w,pari(21),pari(23))
118  k(mstu(1)+2,3)=2
119  mstu(10)=2
120  CALL lurobo(acos(-p(j3,3)/sqrt(p(j3,3)**2+p(j3,1)**2)),
121  & 0.,0.,0.,0.)
122  epz=p(j3,4)-p(j3,3)
123  p(j3,1)=pt*cos(phi)
124  p(j3,2)=pt*sin(phi)
125  p(j3,3)=-0.5*((1.-xt)*epz-tmiflr/(1.-xt)/epz)
126  p(j3,4)= 0.5*((1.-xt)*epz+tmiflr/(1.-xt)/epz)
127  p(j3,5)=amiflr
128  p(j4,1)=-p(j3,1)
129  p(j4,2)=-p(j3,2)
130  p(j4,3)=-0.5*(xt*epz-tm2k2/xt/epz)
131  p(j4,4)= 0.5*(xt*epz+tm2k2/xt/epz)
132  p(j4,5)=amk2
133  k(j4,1)=1
134  k(j4,2)=k2
135  k(j4,3)=2
136  k(j4,4)=0
137  k(j4,5)=0
138  n=j4
139  IF((p(j3,4)+p(j2,4)/2.)**2-(p(j3,1)+p(j2,1)/2.)**2-p(j3,2)**2
140  & -(p(j3,3)+p(j2,3)/2.)**2.LT.(amiflr+2.5*parj(32))**2) goto 300
141  ENDIF
142  CALL lazimu(xp,zp)
143  lst(21)=0
144  RETURN
145 
146  999 lst(21)=4
147  RETURN
148  END