EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
lu2ent.f
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file lu2ent.f
1 
2 C*********************************************************************
3 
4  SUBROUTINE lu2ent(IP,KF1,KF2,PECM)
5 
6 C...Purpose: to store two partons/particles in their CM frame,
7 C...with the first along the +z axis.
8  common/lujets/n,k(9000,5),p(9000,5),v(9000,5)
9  SAVE /lujets/
10  common/ludat1/mstu(200),paru(200),mstj(200),parj(200)
11  SAVE /ludat1/
12  common/ludat2/kchg(500,3),pmas(500,4),parf(2000),vckm(4,4)
13  SAVE /ludat2/
14 
15 C...Standard checks.
16  mstu(28)=0
17  IF(mstu(12).GE.1) CALL lulist(0)
18  ipa=max(1,iabs(ip))
19  IF(ipa.GT.mstu(4)-1) CALL luerrm(21,
20  &'(LU2ENT:) writing outside LUJETS memory')
21  kc1=lucomp(kf1)
22  kc2=lucomp(kf2)
23  IF(kc1.EQ.0.OR.kc2.EQ.0) CALL luerrm(12,
24  &'(LU2ENT:) unknown flavour code')
25 
26 C...Find masses. Reset K, P and V vectors.
27  pm1=0.
28  IF(mstu(10).EQ.1) pm1=p(ipa,5)
29  IF(mstu(10).GE.2) pm1=ulmass(kf1)
30  pm2=0.
31  IF(mstu(10).EQ.1) pm2=p(ipa+1,5)
32  IF(mstu(10).GE.2) pm2=ulmass(kf2)
33  DO 100 i=ipa,ipa+1
34  DO 100 j=1,5
35  k(i,j)=0
36  p(i,j)=0.
37  100 v(i,j)=0.
38 
39 C...Check flavours.
40  kq1=kchg(kc1,2)*isign(1,kf1)
41  kq2=kchg(kc2,2)*isign(1,kf2)
42  IF(kq1+kq2.NE.0.AND.kq1+kq2.NE.4) CALL luerrm(2,
43  &'(LU2ENT:) unphysical flavour combination')
44  k(ipa,2)=kf1
45  k(ipa+1,2)=kf2
46 
47 C...Store partons/particles in K vectors for normal case.
48  IF(ip.GE.0) THEN
49  k(ipa,1)=1
50  IF(kq1.NE.0.AND.kq2.NE.0) k(ipa,1)=2
51  k(ipa+1,1)=1
52 
53 C...Store partons in K vectors for parton shower evolution.
54  ELSE
55  IF(kq1.EQ.0.OR.kq2.EQ.0) CALL luerrm(2,
56  & '(LU2ENT:) requested flavours can not develop parton shower')
57  k(ipa,1)=3
58  k(ipa+1,1)=3
59  k(ipa,4)=mstu(5)*(ipa+1)
60  k(ipa,5)=k(ipa,4)
61  k(ipa+1,4)=mstu(5)*ipa
62  k(ipa+1,5)=k(ipa+1,4)
63  ENDIF
64 
65 C...Check kinematics and store partons/particles in P vectors.
66  IF(pecm.LE.pm1+pm2) CALL luerrm(13,
67  &'(LU2ENT:) energy smaller than sum of masses')
68  pa=sqrt(max(0.,(pecm**2-pm1**2-pm2**2)**2-(2.*pm1*pm2)**2))/
69  &(2.*pecm)
70  p(ipa,3)=pa
71  p(ipa,4)=sqrt(pm1**2+pa**2)
72  p(ipa,5)=pm1
73  p(ipa+1,3)=-pa
74  p(ipa+1,4)=sqrt(pm2**2+pa**2)
75  p(ipa+1,5)=pm2
76 
77 C...Set N. Optionally fragment/decay.
78  n=ipa+1
79  IF(ip.EQ.0) CALL luexec
80 
81  RETURN
82  END