9 SUBROUTINE py4ent(IP,KF1,KF2,KF3,KF4,PECM,X1,X2,X4,X12,X14)
12 IMPLICIT DOUBLE PRECISION(a-
h, o-
z)
17 common/
pydat1/mstu(200),paru(200),mstj(200),parj(200)
18 common/
pydat2/kchg(500,4),pmas(500,4),parf(2000),vckm(4,4)
23 IF(mstu(12).NE.12345) CALL
pylist(0)
25 IF(ipa.GT.mstu(4)-3) CALL
pyerrm(21,
26 &
'(PY4ENT:) writing outside PYJETS momory')
31 IF(kc1.EQ.0.OR.kc2.EQ.0.OR.kc3.EQ.0.OR.kc4.EQ.0) CALL
pyerrm(12,
32 &
'(PY4ENT:) unknown flavour code')
36 IF(mstu(10).EQ.1) pm1=
p(ipa,5)
37 IF(mstu(10).GE.2) pm1=
pymass(kf1)
39 IF(mstu(10).EQ.1) pm2=
p(ipa+1,5)
40 IF(mstu(10).GE.2) pm2=
pymass(kf2)
42 IF(mstu(10).EQ.1) pm3=
p(ipa+2,5)
43 IF(mstu(10).GE.2) pm3=
pymass(kf3)
45 IF(mstu(10).EQ.1) pm4=
p(ipa+3,5)
46 IF(mstu(10).GE.2) pm4=
pymass(kf4)
56 kq1=kchg(kc1,2)*isign(1,kf1)
57 kq2=kchg(kc2,2)*isign(1,kf2)
58 kq3=kchg(kc3,2)*isign(1,kf3)
59 kq4=kchg(kc4,2)*isign(1,kf4)
60 IF(mstu(19).EQ.1)
THEN
62 ELSEIF(kq1.EQ.0.AND.kq2.EQ.0.AND.kq3.EQ.0.AND.kq4.EQ.0)
THEN
63 ELSEIF(kq1.NE.0.AND.kq2.EQ.2.AND.kq3.EQ.2.AND.(kq1+kq4.EQ.0.OR.
65 ELSEIF(kq1.NE.0.AND.kq1+kq2.EQ.0.AND.kq3.NE.0.AND.kq3+kq4.EQ.0d0)
68 CALL
pyerrm(2,
'(PY4ENT:) unphysical flavour combination')
78 IF(kq1.NE.0.AND.(kq2.NE.0.OR.kq3.NE.0.OR.kq4.NE.0))
k(ipa,1)=2
80 IF(kq2.NE.0.AND.kq1+kq2.NE.0.AND.(kq3.NE.0.OR.kq4.NE.0))
83 IF(kq3.NE.0.AND.kq4.NE.0)
k(ipa+2,1)=2
88 ELSEIF(kq1+kq2.NE.0)
THEN
95 k(ipa,kcs)=mstu(5)*(ipa+1)
96 k(ipa,9-kcs)=mstu(5)*(ipa+3)
97 k(ipa+1,kcs)=mstu(5)*(ipa+2)
98 k(ipa+1,9-kcs)=mstu(5)*ipa
99 k(ipa+2,kcs)=mstu(5)*(ipa+3)
100 k(ipa+2,9-kcs)=mstu(5)*(ipa+1)
101 k(ipa+3,kcs)=mstu(5)*ipa
102 k(ipa+3,9-kcs)=mstu(5)*(ipa+2)
110 k(ipa,4)=mstu(5)*(ipa+1)
112 k(ipa+1,4)=mstu(5)*ipa
113 k(ipa+1,5)=
k(ipa+1,4)
114 k(ipa+2,4)=mstu(5)*(ipa+3)
115 k(ipa+2,5)=
k(ipa+2,4)
116 k(ipa+3,4)=mstu(5)*(ipa+2)
117 k(ipa+3,5)=
k(ipa+3,4)
122 IF(0.5d0*x1*pecm.LE.pm1.OR.0.5d0*x2*pecm.LE.pm2.OR.
123 &0.5d0*(2d0-x1-x2-x4)*pecm.LE.pm3.OR.0.5d0*x4*pecm.LE.pm4)
125 pa1=sqrt(
max(1d-10,(0.5d0*x1*pecm)**2-pm1**2))
126 pa2=sqrt(
max(1d-10,(0.5d0*x2*pecm)**2-pm2**2))
127 pa4=sqrt(
max(1d-10,(0.5d0*x4*pecm)**2-pm4**2))
128 x24=x1+x2+x4-1d0-x12-x14+(pm3**2-pm1**2-pm2**2-pm4**2)/pecm**2
129 cthe4=(x1*x4-2d0*x14)*pecm**2/(4d0*pa1*pa4)
130 IF(abs(cthe4).GE.1.002d0) mkerr=1
131 cthe4=
max(-1d0,min(1d0,cthe4))
132 sthe4=sqrt(1d0-cthe4**2)
133 cthe2=(x1*x2-2d0*x12)*pecm**2/(4d0*pa1*pa2)
134 IF(abs(cthe2).GE.1.002d0) mkerr=1
135 cthe2=
max(-1d0,min(1d0,cthe2))
136 sthe2=sqrt(1d0-cthe2**2)
137 cphi2=((x2*x4-2d0*x24)*pecm**2-4d0*pa2*cthe2*pa4*cthe4)/
138 &
max(1d-8*pecm**2,4d0*pa2*sthe2*pa4*sthe4)
139 IF(abs(cphi2).GE.1.05d0) mkerr=1
140 cphi2=
max(-1d0,min(1d0,cphi2))
141 IF(mkerr.EQ.1) CALL
pyerrm(13,
142 &
'(PY4ENT:) unphysical kinematical variable setup')
146 p(ipa,4)=sqrt(pa1**2+pm1**2)
150 p(ipa+3,4)=sqrt(pa4**2+pm4**2)
152 p(ipa+1,1)=pa2*sthe2*cphi2
153 p(ipa+1,2)=pa2*sthe2*sqrt(1d0-cphi2**2)*(-1d0)**int(
pyr(0)+0.5d0)
155 p(ipa+1,4)=sqrt(pa2**2+pm2**2)
157 p(ipa+2,1)=-
p(ipa+1,1)-
p(ipa+3,1)
158 p(ipa+2,2)=-
p(ipa+1,2)
159 p(ipa+2,3)=-
p(ipa,3)-
p(ipa+1,3)-
p(ipa+3,3)
160 p(ipa+2,4)=sqrt(
p(ipa+2,1)**2+
p(ipa+2,2)**2+
p(ipa+2,3)**2+pm3**2)