14 IMPLICIT DOUBLE PRECISION(a-
h, o-
z)
18 common/
pydat1/mstu(200),paru(200),mstj(200),parj(200)
20 common/
pydat2/kchg(500,4),pmas(500,4),parf(2000),vckm(4,4)
21 common/
pydat3/mdcy(500,3),mdme(8000,2),brat(8000),kfdp(8000,5)
24 common/pyctag/nct,mct(4000,2)
30 dimension dps(5),dpc(5),ue(3),pg(5),e1(3),e2(3),e3(3),e4(3),
31 &ecl(3),ijunc(10,0:4),ipiece(30,0:4),kfend(4),kfq(4),
32 &ijur(4),pju(4,6),irng(4,2),tjj(2,5),
t(5),pul(3,5),
59 IF (
k(
i,1).LE.0) goto 240
63 IF (mqgst.EQ.2.AND.npiece.NE.3*njunc)
THEN
65 njjstr = (3*njunc-npiece)/2
70 IF (ipiece(
j,4).EQ.
i) ilc=ilc+1
77 &
'(PYPREP:) Too many junction-junction strings.')
85 itjunc=mod(
k(
i,4)/mstu(5),mstu(5))
87 IF (mod(itjunc,2).EQ.0) kcs=5
90 IF (itjunc.GE.3) kcs=9-kcs
91 IF (
mint(33).EQ.0)
THEN
95 ia=mod(
k(
i,4),mstu(5))
96 IF (
k(ia,kcs)/mstu(5)**2.GE.2)
THEN
97 itmp=mod(
k(
i,5),mstu(5))
98 IF (
k(itmp,kcs)/mstu(5)**2.GE.2)
THEN
99 itmp=mod(
k(
i,5)/mstu(5),mstu(5))
100 k(
i,5)=
k(
i,5)+(ia-itmp)*mstu(5)
102 k(
i,5)=
k(
i,5)+(ia-itmp)
104 k(
i,4)=
k(
i,4)+(itmp-ia)
107 IF (itjunc.LE.2)
THEN
109 k(ia,kcs) =
k(ia,kcs) + 2*mstu(5)**2
110 k(
i,kcs) =
k(
i,kcs) + 1*mstu(5)**2
113 k(ia,kcs) =
k(ia,kcs) + mstu(5)**2
114 k(
i,kcs) =
k(
i,kcs) + 2*mstu(5)**2
125 DO 140 j1=
max(1,ip),
n
126 IF (
k(j1,1).NE.3) goto 140
129 DO 120 j2=
max(1,ip),
n
130 IF (
k(j2,1).NE.3) goto 120
131 IF (mct(j1,kcs-3).EQ.mct(j2,6-kcs)) imatch=1
133 IF (imatch.EQ.1) goto 140
139 DO 130 j2=
mint(84)+1,
n
142 IF (imo2.EQ.
mint(83)+3.OR.imo2.EQ.
mint(83)+4)
144 IF (mct(j2,kcs-3).EQ.jct.AND.imo2.EQ.ijumo)
147 IF (imatch.EQ.0) goto 140
155 IF (iju2.EQ.
i) goto 160
156 itju2=mod(
k(iju2,4)/mstu(5),mstu(5))
158 IF (mod(itju2,2).EQ.mod(itjunc,2)) goto 160
161 IF (ipiece(
j,4).EQ.iju2) is=is+1
163 IF (is.EQ.3) goto 160
174 ELSE IF (ilc.NE.3)
THEN
180 IF(
k(
i,1).NE.3) goto 240
184 IF(kq.EQ.0.OR.(mqgst.LE.2.AND.kq.EQ.2)) goto 240
188 IF(kq*isign(1,
k(
i,2)).LT.0) kcs=5
195 CALL
pyerrm(14,
'(PYPREP:) caught in infinite loop')
201 IF(
k(ia,1).EQ.3)
THEN
202 IF(
i1.GE.mstu(4)-mstu32-5)
THEN
203 CALL
pyerrm(11,
'(PYPREP:) no more memory left in PYJETS')
210 IF(nstp.GE.2.AND.kchg(
pycomp(
k(ia,2)),2).NE.2)
k(
i1,1)=1
220 IF(
k(
i1,1).EQ.1) goto 240
224 IF(
k(ia,1).EQ.42)
THEN
226 IF(
i1.GE.mstu(4)-mstu32-ncopy-5)
THEN
227 CALL
pyerrm(11,
'(PYPREP:) no more memory left in PYJETS')
232 IF (mqgst.LE.2.AND.ncopy.NE.0)
THEN
235 k(mstu(4)-mstu32-icopy,
j)=
k(i1beg+icopy,
j)
236 p(mstu(4)-mstu32-icopy,
j)=
p(i1beg+icopy,
j)
237 v(mstu(4)-mstu32-icopy,
j)=
v(i1beg+icopy,
j)
244 IF (
k(
i,1).EQ.42.AND.
mint(33).EQ.0)
THEN
245 itmp=mod(
k(ia,4),mstu(5))
247 IF (mod(
k(ia,5),mstu(5)).EQ.ib)
THEN
248 k(ia,5)=
k(ia,5)+(itmp-ib)
250 k(ia,5)=
k(ia,5)+(itmp-ib)*mstu(5)
252 k(ia,4)=
k(ia,4)+(ib-itmp)
263 ipiece(npiece,1)=mstu32+1
264 ipiece(npiece,2)=mstu32+ncopy
274 IF (
mint(33).EQ.0)
THEN
275 IF(mod(
k(ib,kcs)/mstu(5)**2,2).EQ.0.AND.mod(
k(ib,kcs),mstu(5
277 ia=mod(
k(ib,kcs),mstu(5))
278 k(ib,kcs)=
k(ib,kcs)+mstu(5)**2
281 IF(
k(ib,kcs).GE.2*mstu(5)**2.OR.mod(
k(ib,kcs)/mstu(5),
282 & mstu(5)).EQ.0) kcs=9-kcs
283 ia=mod(
k(ib,kcs)/mstu(5),mstu(5))
284 k(ib,kcs)=
k(ib,kcs)+2*mstu(5)**2
287 IF(ia.LE.0.OR.ia.GT.
n)
THEN
288 CALL
pyerrm(12,
'(PYPREP:) colour rearrangement failed')
291 WRITE(mstu(11),*)
'started at:',
i
292 WRITE(mstu(11),*)
'ended going from',ib,
' to',ia
293 WRITE(mstu(11),*)
'MQGST =',mqgst
299 IF(mod(
k(ia,4)/mstu(5),mstu(5)).EQ.ib.OR.mod(
k(ia,5)/mstu(5)
300 & ,mstu(5)).EQ.ib)
THEN
301 IF(mrev.EQ.1) kcs=9-kcs
302 IF(mod(
k(ia,kcs)/mstu(5),mstu(5)).NE.ib) kcs=9-kcs
303 k(ia,kcs)=
k(ia,kcs)+2*mstu(5)**2
305 IF(mrev.EQ.0) kcs=9-kcs
306 IF(mod(
k(ia,kcs),mstu(5)).NE.ib) kcs=9-kcs
307 k(ia,kcs)=
k(ia,kcs)+mstu(5)**2
313 IF (mct(ib,kcs-3).EQ.0)
THEN
315 IF(
mint(51).NE.0)
RETURN
321 IF (
it.EQ.ib) goto 210
322 IF (mct(
it,6-kcs).EQ.jct.AND.
k(
it,1).LT.10.AND.
k(
it,1).gt
329 IF (ifound.EQ.1)
THEN
332 ELSEIF (ifound.EQ.0.AND.mqgst.LE.2)
THEN
338 ijumo=
k(ijunc(iju,0),3)
339 itjunc=mod(
k(ijunc(iju,0),4)/mstu(5),mstu(5))
341 IF (mod(itjunc+1,2)+1.NE.kcs-3) goto 230
343 DO 220 j1=
max(1,ip),
n
344 IF (
k(j1,1).LE.0) goto 220
347 IF (imo.EQ.
mint(83)+3.OR.imo.EQ.
mint(83)+4)
349 IF (mct(j1,kcs-3).EQ.jct.AND.imo.EQ.ijumo.AND.mod(
k(j1
350 & ,3+itjunc)/mstu(5),mstu(5)).EQ.ijunc(iju,0))
353 IF (itjunc.GE.3.AND.mct(j1,6-kcs).EQ.jct.AND.imo.eq
356 IF (imatch.EQ.0) goto 230
361 IF (ifound.EQ.1)
THEN
363 ELSEIF (ifound.EQ.0)
THEN
365 CALL
pyerrm(12,
'(PYPREP:) no matching colour tag: '
374 ELSEIF (ifound.GE.2)
THEN
377 & ,
'(PYPREP:) too many occurences of colour line: '//
398 IF (ijucnt.LE.njunc)
THEN
400 IF (ijjstr.EQ.0)
THEN
404 IF (ijunc(ijucnt,4).EQ.1) goto 260
412 IF (ijunc(
j,0).EQ.iju) ijunc(
j,4)=1
415 itjunc = mod(
k(iju,4)/mstu(5),mstu(5))
419 IF (itjunc.GE.1.AND.itjunc.LE.6)
THEN
425 IF (ipiece(ipc,4).EQ.iju)
THEN
427 IF (ihf.EQ.ihk) iend=ipiece(ipc,3)
429 IF (ihk.EQ.3.AND.ipiece(ipc,0).EQ.iju) iend=ipiece(ipc,3)
437 IF (ipiece(ipc,0).EQ.iju.AND.
k(ipiece(ipc,4),1)
438 & .EQ.42.AND.ipiece(ipc,1)-1-ipiece(ipc,2).EQ.0)
THEN
457 IF (ipiece(ipc,3).EQ.iend) ijunc(ijucnt,ihk)=ipc
458 IF (ihk.EQ.3.AND.ipiece(ipc,0).EQ.ijunc(ijucnt,0)
459 & .AND.
k(ipiece(ipc,4),1).EQ.42)
THEN
460 ijunc(ijucnt,ihk)=ipc
466 ipc=ijunc(ijucnt,ihk)
469 CALL
pyerrm(12,
'(PYPREP:) fails to hook up junctions')
473 DO 330 icp=ipiece(ipc,1+mrev),ipiece(ipc,2-mrev),1-2*mrev
483 IF (mrev.EQ.1.AND.ihk.GE.2)
k(
i1,1)=1
485 IF(ihk.LT.2.OR.mrev.NE.0) goto 360
490 IF (ijjstr.NE.0) ijus = ipiece(ipc,4)
500 k(ijus,1)=
k(ijus,1)+10
503 360
IF (ihk.LT.3) goto 280
505 CALL
pyerrm(12,
'(PYPREP:) Unknown junction type')
509 IF (ijucnt.NE.njunc) goto 260
520 IF(
k(
i,1).NE.1.AND.
k(
i,1).NE.41)
THEN
521 ELSEIF(
k(
i,1).EQ.41)
THEN
523 ELSEIF(
k(
i,1).EQ.1.AND.mjun1.NE.1)
THEN
536 IF(
k(
i1,2).NE.21)
THEN
541 pju(min(nju,3),
j)=pju(min(nju,3),
j)+
p(
i1,
j)
546 pju(4,
j)=pju(1,
j)+pju(2,
j)+pju(3,
j)
548 pmju=sqrt(
max(0d0,pju(4,4)**2-pju(4,1)**2-pju(4,2)**2-
551 pju(
i2,6)=(pju(4,4)*pju(
i2,4)-pju(4,1)*pju(
i2,1)-
552 & pju(4,2)*pju(
i2,2)-pju(4,3)*pju(
i2,3))/pmju-pju(
i2,5)
554 IF(pju(3,6).LT.min(pju(1,6),pju(2,6)))
THEN
556 IF(pju(1,6).LT.pju(2,6))
THEN
576 DO 430
i1=irng(ii,1),irng(ii,2),
577 & isign(1,irng(ii,2)-irng(ii,1))
579 IF(
i2.GE.mstu(4)-mstu32-5)
THEN
581 &
'(PYPREP:) no more memory left in PYJETS')
591 IF(
k(
i2,1).EQ.1)
k(
i2,1)=2
613 IF (mstj(19).NE.1)
THEN
618 IF (mstj(19).EQ.2)
THEN
625 IF (
k(
i,1).EQ.41)
THEN
628 IF (mjun1.EQ.2.AND.
k(
i-1,1).NE.41)
THEN
631 ELSEIF(
k(
i,1).EQ.1.AND.(mjun1.NE.2))
THEN
637 ELSEIF(
k(
i,1).EQ.1)
THEN
646 IF (
k(
i1,2).NE.21)
THEN
653 IF (
pyr(0).LT.0.5d0) isw=1
656 IF (
pyr(0).GT.0.5d0) igs=2
658 IF (mstj(19).EQ.0)
THEN
673 ia = ijcp((iju-1)*7 - jd*(ijs+1)) + jd
674 ib = ijcp((iju-1)*7 - jd*ijs)
675 ELSEIF (ijs.EQ.3)
THEN
677 ia = ijcp((iju-1)*7 + jd*(ijs)) + jd
678 ib = ijcp((iju-1)*7 + jd*(ijs+3))
690 IF (isp.NE.ia.AND.isp.NE.ib)
THEN
692 IF (
k(isp-jd,2).EQ.88)
THEN
695 ELSEIF (
k(isp-jd,2).NE.21)
THEN
700 IF (pwt.GT.10d0) goto 530
702 tdp=tjuold(1)*
p(isp,1)+tjuold(2)*
p(isp,2)+tjuold(3
704 bfc=tdp/(1d0+tjuold(4))+
p(isp,4)
706 tmp=
p(isp,
j)+tjuold(
j)*bfc
707 pul(ijs,
j)=pul(ijs,
j)+tmp*exp(-pwt)
710 tmp=tjuold(4)*
p(isp,4)+tdp
711 pul(ijs,4)=pul(ijs,
j)+tmp*exp(-pwt)
715 pul(ijs,5)=sqrt(pul(ijs,1)**2+pul(ijs,2)**2
723 tmp=
t(1)*tjuold(1)+
t(2)*tjuold(2)+
t(3)*tjuold(3)
725 tjuold(ix)=
t(ix)+tjuold(ix)*(tmp/(1d0+tjuold(4))+
t(4
728 tjuold(4)=sqrt(1d0+tjuold(1)**2+tjuold(2)**2+tjuold(3)
732 IF (abs((
t(4)-1d0)/tjuold(4)).GT.0.01d0.AND.
733 & ijrfit.LT.mstj(18))
THEN
735 ELSEIF (ijrfit.GE.mstj(18))
THEN
736 CALL
pyerrm(1,
'(PYPREP:) failed to converge on JRF')
740 tjj(iju,ix)=-tjuold(ix)
742 tjj(iju,4)=sqrt(1d0+tjj(iju,1)**2+tjj(iju,2)**2
748 IF (jjglue.EQ.0)
THEN
749 delmqq=4d0*four(ijcp(2)-1,ijcp(4+isw)+1)*four(ijcp(3)
754 delmqq=8d0*four(ijcp(2)-1,ijcp(4)-1)*four(ijcp(3)+1
755 & ,ijcp(4+isw)+1)*four(ijcp(3)-1,ijcp(5-isw)+1)
757 delmqq=8d0*four(ijcp(2)-1,ijcp(4+isw)+1)
758 & *four(ijcp(3)-1,ijcp(4)-1)*four(ijcp(3)+1
775 t1p1=t1p1+isgn*tjj(1,ix)*
p(ijcp(2)-1,ix)
776 t1p2=t1p2+isgn*tjj(1,ix)*
p(ijcp(3)-1,ix)
777 t2p3=t2p3+isgn*tjj(2,ix)*
p(ijcp(4)+1,ix)
778 t2p4=t2p4+isgn*tjj(2,ix)*
p(ijcp(5)+1,ix)
779 IF (jjglue.EQ.0)
THEN
782 t1t2=t1t2+isgn*tjj(1,ix)*tjj(2,ix)
786 t1g1=t1g1+isgn*tjj(1,ix)*
p(ijcp(3)+1,ix)
787 t2g2=t2g2+isgn*tjj(2,ix)*
p(ijcp(4)-1,ix)
790 delmjj=16d0*t1p1*t1p2*t2p3*t2p4
791 IF (jjglue.EQ.0)
THEN
792 delmjj=delmjj*(t1t2+sqrt(t1t2**2-1))
794 delmjj=delmjj*4d0*t1g1*t2g2
799 IF (delmjj.GT.delmqq)
THEN
803 DO 600 icop=ijcp(ist),ijcp(ist+1)-1
806 p(ncop,ix)=
p(icop,ix)
807 k(ncop,ix)=
k(icop,ix)
810 IF (jjglue.NE.0.AND.ist.EQ.igs)
THEN
813 DO 620 icop=ijcp(4)-1,ijcp(3)+1,-1
817 p(ncop,ix)=
p(icop,ix)
818 k(ncop,ix)=
k(icop,ix)
823 DO 640 icop=ijcp(ist+ifc*isw+3)+1,ijcp(ist+ifc*isw+4)
826 p(ncop,ix)=
p(icop,ix)
827 k(ncop,ix)=
k(icop,ix)
833 DO 670 icop=nbeg,nend-2
835 p(icop,ix)=
p(
n+icop-nbeg+1,ix)
836 k(icop,ix)=
k(
n+icop-nbeg+1,ix)
842 p(icop-2,ix)=
p(icop,ix)
843 k(icop-2,ix)=
k(icop,ix)
857 IF(mstj(14).LT.0)
RETURN
858 IF(mstj(14).EQ.0) goto 1140
866 IF(
k(
i,1).NE.1.AND.
k(
i,1).NE.2)
THEN
867 ELSEIF(
k(
i,1).EQ.2.AND.ic.EQ.0)
THEN
875 ELSEIF(
k(
i,1).EQ.2.AND.
k(
i,2).NE.21)
THEN
881 ELSEIF(
k(
i,1).EQ.2)
THEN
885 ELSEIF(ic.NE.0.AND.kchg(
pycomp(
k(
i,2)),2).NE.0)
THEN
891 pd=sqrt(
max(0d0,dps(4)**2-dps(1)**2-dps(2)**2-dps(3)**2))-
908 IF(pdmin.GE.parj(32)) goto 1140
912 pecm=sqrt(
max(0d0,dpc(4)**2-dpc(1)**2-dpc(2)**2-dpc(3)**2))
928 IF(mstu(16).NE.2)
THEN
947 IF((
k(
i,1).EQ.1.OR.
k(
i,1).EQ.2).AND.
k(
i,2).NE.21)
THEN
950 IF(iabs(
k(
i,2)).GT.1000) ndiq=ndiq+1
955 IF(nq.EQ.3.AND.ndiq.GE.2)
THEN
957 IF(iabs(kfq(3)).LT.1000)
i1=1
958 kfq(4)=isign(mod(iabs(kfq(
i1))/100,10),kfq(
i1))
965 IF(nq.EQ.4.AND.ndiq.EQ.0)
THEN
968 IF(kfq(
i1)*kfq(
i2).LT.0)
i2=3
969 IF(
i2.EQ.3.AND.kfq(
i1)*kfq(
i2).LT.0)
i2=4
970 kfls=2*int(
pyr(0)+3d0*parj(4)/(1d0+3d0*parj(4)))+1
971 IF(kfq(
i1).EQ.kfq(
i2)) kfls=3
972 kfq(
i1)=isign(1000*
max(iabs(kfq(
i1)),iabs(kfq(
i2)))+
973 & 100*min(iabs(kfq(
i1)),iabs(kfq(
i2)))+kfls,kfq(
i1))
983 IF(iabs(kfq(
i1)).GT.1000)
i1=3
984 IF(iabs(kfq(
i2)).GT.1000)
i2=3
985 kfls=2*int(
pyr(0)+3d0*parj(4)/(1d0+3d0*parj(4)))+1
986 IF(kfq(
i1).EQ.kfq(
i2)) kfls=3
987 kfq(
i1)=isign(1000*
max(iabs(kfq(
i1)),iabs(kfq(
i2)))+
988 & 100*min(iabs(kfq(
i1)),iabs(kfq(
i2)))+kfls,kfq(
i1))
1002 IF(kc1.EQ.0.OR.kc2.EQ.0) goto 1140
1003 kq1=kchg(kc1,2)*isign(1,kfq(1))
1004 kq2=kchg(kc2,2)*isign(1,kfq(2))
1005 IF(kq1+kq2.NE.0) goto 1140
1008 IF(iabs(kfq(2)).GT.1000)
k1=kfq(2)
1011 CALL
pydcyk(kfq(1)+kfq(2)-
k1,-kfln,kfldmp,
k(
n+3,2))
1012 IF(
k(
n+2,2).EQ.0.OR.
k(
n+3,2).EQ.0) goto 800
1015 ELSEIF(nq.EQ.4)
THEN
1020 IF(kc1.EQ.0.OR.kc2.EQ.0.OR.kc3.EQ.0.OR.kc4.EQ.0) goto 1140
1021 kq1=kchg(kc1,2)*isign(1,kfq(1))
1022 kq2=kchg(kc2,2)*isign(1,kfq(2))
1023 kq3=kchg(kc3,2)*isign(1,kfq(3))
1024 kq4=kchg(kc4,2)*isign(1,kfq(4))
1025 IF(kq1+kq2+kq3+kq4.NE.0) goto 1140
1029 IF(kq1*kq2.GT.0.OR.(iabs(kfq(1)).GT.1000.AND.
1030 & iabs(kfq(2)).GT.1000))
i2=3
1031 IF(
i2.EQ.3.AND.(kq1*kq3.GT.0.OR.(iabs(kfq(1)).GT.1000.AND.
1032 & iabs(kfq(3)).GT.1000)))
i2=4
1038 IF(
k(
n+2,2).EQ.0.OR.
k(
n+3,2).EQ.0) goto 810
1042 IF(iabs(
k(ic2,2)).NE.21) goto 1140
1045 820 CALL
pydcyk(1+int((2d0+parj(2))*
pyr(0)),0,kfln,kfdmp)
1047 CALL
pydcyk(-kfln,-kflm,kfldmp,
k(
n+3,2))
1048 IF(
k(
n+2,2).EQ.0.OR.
k(
n+3,2).EQ.0) goto 820
1055 IF(
p(
n+2,5)+
p(
n+3,5)+parj(64).GE.pecm)
THEN
1056 IF(
ntry.LT.mstj(17).OR.(nq.EQ.4.AND.
ntry.LT.5*mstj(17)))
THEN
1058 ELSEIF(nsin.EQ.1.OR.nq.EQ.4)
THEN
1071 DO 850
i=ic1+1,ic2-1
1072 IF((
k(
i,1).EQ.1.OR.
k(
i,1).EQ.2).AND.
1073 & kchg(
pycomp(
k(
i,2)),2).NE.0)
THEN
1074 frac1=four(ic2,
i)/(four(ic1,
i)+four(ic2,
i))
1080 CALL
pyrobo(
n+2,
n+2,0d0,0d0,-dpc(1)/dpc(4),-dpc(2)/dpc(4),
1086 pa=sqrt((pecm**2-(
p(
n+2,5)+
p(
n+3,5))**2)*(pecm**2-
1087 &(
p(
n+2,5)-
p(
n+3,5))**2))/(2d0*pecm)
1089 IF(parj(21).LE.0.01d0) ue(3)=1d0
1090 pt2=(1d0-ue(3)**2)*pa**2
1091 IF(mstj(16).LE.0)
THEN
1094 IF(exp(-
pt2/(2d0*
max(0.01d0,parj(21))**2)).LT.
pyr(0)) goto 860
1097 alambd=sqrt(
max(0d0,(pecm**2-pr1-pr2)**2-4d0*pr1*pr2))
1099 IF(mstj(11).EQ.2) prevcf=parj(39)
1100 prev=1d0/(1d0+exp(min(50d0,prevcf*alambd*parj(40))))
1102 IF(
pyr(0).LT.
prev) ue(3)=-ue(3)
1104 ue(1)=sqrt(1d0-ue(3)**2)*cos(
phi)
1105 ue(2)=sqrt(1d0-ue(3)**2)*sin(
phi)
1110 p(
n+2,4)=sqrt(pa**2+
p(
n+2,5)**2)
1111 p(
n+3,4)=sqrt(pa**2+
p(
n+3,5)**2)
1114 CALL
pyrobo(
n+2,
n+3,the1,phi1,dpc(1)/dpc(4),dpc(2)/dpc(4),
1133 910
IF(nq.EQ.2.AND.iabs(kfq(1)).GT.100.AND.iabs(kfq(2)).GT.100)
THEN
1135 ELSEIF(nq.EQ.2)
THEN
1136 CALL
pykfdi(kfq(1),kfq(2),kfldmp,
k(
n+2,2))
1138 kfln=1+int((2d0+parj(2))*
pyr(0))
1139 CALL
pykfdi(kfln,-kfln,kfldmp,
k(
n+2,2))
1141 IF(
k(
n+2,2).EQ.0) goto 910
1145 IF (mstj(16).LE.0) goto 1080
1154 IF(
k(
i1,1).EQ.1) njunc=0
1155 IF(
k(
i1,1).EQ.41) njunc=njunc+1
1156 IF(
k(
i1,1).EQ.41) goto 940
1157 IF(
i1.GE.ic1-1.AND.
i1.LE.ic2)
THEN
1159 ELSEIF(
k(
i1,1).EQ.2)
THEN
1163 IF(
k(
i2,1).EQ.41) goto 940
1164 IF(
k(
i2,1).GT.10) goto 920
1165 IF(kchg(
pycomp(
k(
i2,2)),2).EQ.0) goto 920
1166 IF(
k(
i1,2).EQ.21.AND.
k(
i2,2).NE.21.AND.
k(
i2,1).NE.1.AND.
1167 & njunc.EQ.0) goto 940
1168 IF(
k(
i1,2).NE.21.AND.
k(
i2,2).EQ.21.AND.njunc.NE.0) goto 940
1169 IF(
k(
i1,2).NE.21.AND.
k(
i2,2).NE.21.AND.(
i1.GT.i0.OR.
1170 &
k(
i2,1).NE.1)) goto 940
1182 e3s=e3(1)**2+e3(2)**2+e3(3)**2
1183 e4s=e4(1)**2+e4(2)**2+e4(3)**2
1184 e34=e3(1)*e4(1)+e3(2)*e4(2)+e3(3)*e4(3)
1187 ELSEIF(e34.LT.e3s)
THEN
1188 ddmin=e4s-e34**2/e3s
1190 ddmin=e4s-2d0*e34+e3s
1194 IF(ddmin.LT.dglomi)
THEN
1199 ELSEIF(
k(
i1,1).EQ.1.AND.kchg(
pycomp(
k(
i1,2)),2).NE.0)
THEN
1205 IF (ibeg.EQ.0) goto 1080
1208 IF (
p(
n+1,5).GE.
p(
n+2,5))
THEN
1211 frac=
p(
n+2,5)/
p(
n+1,5)
1214 pg(
j)=(1d0-frac)*
p(
n+1,
j)
1221 IF(
k(
i,1).NE.1.AND.
k(
i,1).NE.2.AND.
k(
i,1).NE.41) goto 960
1222 IF(kchg(
pycomp(
k(
i,2)),2).EQ.0.AND.
k(
i,1).NE.41) goto 960
1243 IF(
k(
i,1).EQ.12.OR.
k(
i,1).EQ.51) goto 960
1254 IF(
k(
i,1).NE.1.AND.
k(
i,1).NE.2.AND.
k(
i,1).NE.41) goto 990
1255 IF(kchg(
pycomp(
k(
i,2)),2).EQ.0.AND.
k(
i,1).NE.41) goto 990
1267 IF(
k(
i,1).EQ.12.OR.
k(
i,1).EQ.51) goto 990
1272 p(nsav+2,
j)=
p(nsav+1,
j)
1276 1020
IF(mstj(16).EQ.1)
THEN
1286 pg(5)=sqrt(
max(1d-20,pg(4)**2-pg(1)**2-pg(2)**2-pg(3)**2))
1289 pmscol=
p(nsav+2,4)**2-
p(nsav+2,1)**2-
p(nsav+2,2)**2-
1291 pclpg=(
p(nsav+2,4)*pg(4)-
p(nsav+2,1)*pg(1)-
1292 &
p(nsav+2,2)*pg(2)-
p(nsav+2,3)*pg(3))/pg(5)**2
1293 delta=sqrt(pclpg**2+(
p(nsav+2,5)**2-pmscol)/pg(5)**2)-pclpg
1297 IF(delta*
alpha.GT.1d0.AND.
i1.GT.nsav+3.AND.
k(
i1,2).EQ.21)
THEN
1308 IF(delta*
beta.GT.1d0.AND.
i2.LT.
n.AND.
k(
i2,2).EQ.21)
THEN
1319 IF(
iter.EQ.1) goto 1020
1336 p(nsav+2,
j)=
p(nsav+2,
j)+delta*pg(
j)
1354 IF(ir.NE.0) goto 1100
1355 DO 1090
i=
max(1,ip),
n
1356 IF(
k(
i,1).LE.0.OR.
k(
i,1).GT.10.OR.(
i.GE.ic1.AND.
i.LE.ic2
1357 & .AND.
k(
i,1).GE.1.AND.
k(
i,1).LE.2)) goto 1090
1359 IF(mcomb.EQ.1.AND.kci.EQ.0) goto 1090
1360 IF(mcomb.EQ.1.AND.kchg(kci,2).EQ.0.AND.
i.LE.ns) goto 1090
1361 IF(mcomb.EQ.2.AND.iabs(
k(
i,2)).GT.10.AND.iabs(
k(
i,2)).LE.100)
1363 hcr=dpc(4)*
p(
i,4)-dpc(1)*
p(
i,1)-dpc(2)*
p(
i,2)-dpc(3)*
p(
i,3)
1364 hsr=2d0*hcr+pecm**2-
p(
n+2,5)**2-2d0*
p(
n+2,5)*
p(
i,5)
1378 hk2=0.5d0*(hb*sqrt(
max(0d0,((hb+hc)**2-4d0*(hb+hd)*
p(
n+2,5)**2)/
1379 & (ha**2-(pecm*
p(ir,5))**2)))-(hb+hc))/(hb+hd)
1380 hk1=(0.5d0*(
p(
n+2,5)**2-pecm**2)+hd*hk2)/hb
1382 p(
n+2,
j)=(1d0+hk1)*dpc(
j)-hk2*
p(ir,
j)
1383 p(ir,
j)=(1d0+hk2)*
p(ir,
j)-hk1*dpc(
j)
1387 CALL
pyerrm(3,
'(PYPREP:) no match for collapsing cluster')
1392 1120
DO 1130
i=ic1,ic2
1393 IF((
k(
i,1).EQ.1.OR.
k(
i,1).EQ.2).AND.
1394 & kchg(
pycomp(
k(
i,2)),2).NE.0)
THEN
1396 IF(mstu(16).NE.2)
THEN
1404 IF(
k(
i,1).EQ.41)
k(
i,1)=
k(
i,1)+10
1406 IF(
n.LT.mstu(4)-mstu(32)-5) goto 710
1416 DO 1180
i=
max(1,ip),
n
1417 IF(
k(
i,1).EQ.41) nju=nju+1
1418 IF(
k(
i,1).LE.0.OR.
k(
i,1).GT.10) goto 1180
1420 IF(kc.EQ.0) goto 1180
1421 kq=kchg(kc,2)*isign(1,
k(
i,2))
1422 IF(kq.EQ.0) goto 1180
1431 dps(
j)=dps(
j)+
p(
i,
j)
1433 IF(
k(
i,1).EQ.1)
THEN
1435 IF(nju.EQ.0.AND.
np.NE.1)
THEN
1436 IF(kfn.EQ.1.OR.kfn.GE.3.OR.kqs.NE.0) nferr=1
1437 ELSEIF(nju.EQ.1)
THEN
1438 IF(kfn.NE.3.OR.iabs(kqs).NE.3) nferr=1
1439 ELSEIF(nju.EQ.2)
THEN
1440 IF(kfn.NE.4.OR.kqs.NE.0) nferr=1
1441 ELSEIF(nju.GE.3)
THEN
1445 CALL
pyerrm(2,
'(PYPREP:) unphysical flavour combination')
1449 IF(
np.NE.1.AND.dps(4)**2-dps(1)**2-dps(2)**2-dps(3)**2.LT.
1450 & (0.9d0*parj(32)+dps(5))**2) CALL
pyerrm(3,
1451 &
'(PYPREP:) too small mass in jet system')