11 IMPLICIT DOUBLE PRECISION(a-
h, o-
z)
16 common/
pydat1/mstu(200),paru(200),mstj(200),parj(200)
17 common/
pydat2/kchg(500,4),pmas(500,4),parf(2000),vckm(4,4)
20 dimension dps(5),kfl(3),pmq(3),
px(3),
py(3),gam(3),ie(2),pr(2),
21 &
in(9),dhm(4),dhg(4),dp(5,5),irank(2),mju(4),iju(6),pju(5,5),
22 &tju(5),kfjh(2),njs(2),kfjs(2),pjs(4,5),mstu9t(8),paru9t(8),
23 &inmo(9),pm2qmo(2),xtmo(2),ejstr(2),ijuori(2),ibarrk(2),
28 dfour(
i,
j)=dp(
i,4)*dp(
j,4)-dp(
i,1)*dp(
j,1)-dp(
i,2)*dp(
j,2)-
49 IF(
i.GT.min(
n,mstu(4)-mstu(32)))
THEN
50 CALL
pyerrm(12,
'(PYSTRF:) failed to reconstruct jet system')
51 IF(mstu(21).GE.1)
RETURN
53 IF(
k(
i,1).NE.1.AND.
k(
i,1).NE.2.AND.
k(
i,1).NE.41) goto 110
56 kq=kchg(kc,2)*isign(1,
k(
i,2))
57 IF(kq.EQ.0.AND.
k(
i,1).NE.41) goto 110
58 IF(
n+5*
np+11.GT.mstu(4)-mstu(32)-5)
THEN
59 CALL
pyerrm(11,
'(PYSTRF:) no more memory left in PYJETS')
60 IF(mstu(21).GE.1)
RETURN
68 IF(
j.NE.4) dps(
j)=dps(
j)+
p(
i,
j)
70 dps(4)=dps(4)+sqrt(
p(
i,1)**2+
p(
i,2)**2+
p(
i,3)**2+
p(
i,5)**2)
72 IF(kq.NE.2) kqsum=kqsum+kq
74 IF(mod(kqsum,2).EQ.0.AND.mju(1).EQ.0)
THEN
82 IF(
k(
i,1).EQ.2.OR.
k(
i,1).EQ.41) goto 110
83 IF(mod(kqsum,3).NE.0)
THEN
84 CALL
pyerrm(12,
'(PYSTRF:) unphysical flavour combination')
85 IF(mstu(21).GE.1)
RETURN
87 IF(mju(1).GT.0.OR.mju(2).GT.0) mstu(29)=1
90 IF(abs(dps(3)).LT.0.99d0*dps(4))
THEN
93 CALL
pyrobo(
n+1,
n+
np,0d0,0d0,-dps(1)/dps(4),-dps(2)/dps(4),
97 hhbz=sqrt(
max(1d-6,dps(4)+dps(3))/
max(1d-6,dps(4)-dps(3)))
99 hhpmt=
p(
i,1)**2+
p(
i,2)**2+
p(
i,5)**2
100 IF(
p(
i,3).GT.0d0)
THEN
101 hhpez=
max(1d-10,(
p(
i,4)+
p(
i,3))/hhbz)
102 p(
i,3)=0.5d0*(hhpez-hhpmt/hhpez)
103 p(
i,4)=0.5d0*(hhpez+hhpmt/hhpez)
105 hhpez=
max(1d-10,(
p(
i,4)-
p(
i,3))*hhbz)
106 p(
i,3)=-0.5d0*(hhpez-hhpmt/hhpez)
107 p(
i,4)=0.5d0*(hhpez+hhpmt/hhpez)
121 IF(mju(1).GT.0) nrmin=nrmin+2
122 IF(mju(2).GT.0) nrmin=nrmin+2
123 140
IF(nr.GT.nrmin)
THEN
126 IF(
i.EQ.
n+nr.AND.iabs(
k(
n+1,2)).NE.21) goto 150
129 IF(
k(
i,1).EQ.41.OR.
k(
i1,1).EQ.41) goto 150
130 IF(mju(1).NE.0.AND.
i1.LT.mju(1).AND.iabs(
k(
i1,2)).NE.21)
132 IF(mju(2).NE.0.AND.
i.GT.mju(2).AND.iabs(
k(
i,2)).NE.21)
134 pap=sqrt((
p(
i,1)**2+
p(
i,2)**2+
p(
i,3)**2)*(
p(
i1,1)**2+
137 pdr=4d0*(pap-pvp)**2/
max(1d-6,paru13**2*pap+2d0*(pap-pvp))
138 IF(
pdr.LT.pdrmin)
THEN
145 IF(pdrmin.LT.paru12.AND.ir.EQ.
n+nr)
THEN
149 p(
n+1,5)=sqrt(
max(0d0,
p(
n+1,4)**2-
p(
n+1,1)**2-
p(
n+1,2)**2-
153 ELSEIF(pdrmin.LT.paru12)
THEN
157 p(ir,5)=sqrt(
max(0d0,
p(ir,4)**2-
p(ir,1)**2-
p(ir,2)**2-
159 IF(mju(2).NE.0.AND.ir.GT.mju(2))
k(ir,2)=
k(ir+1,2)
167 IF(ir.EQ.
n+nr-1)
k(ir,2)=
k(
n+nr,2)
169 IF(mju(1).GT.ir) mju(1)=mju(1)-1
170 IF(mju(2).GT.ir) mju(2)=mju(2)-1
181 IF(
ntry.GT.100.AND.ntryr.LE.8.AND.nr.GT.nrmin)
THEN
185 ELSEIF(
ntry.GT.100.OR.ntryr.GT.100)
THEN
186 CALL
pyerrm(14,
'(PYSTRF:) caught in infinite loop')
187 IF(mstu(21).GE.1)
RETURN
191 IF(mju(1).EQ.0.AND.mju(2).EQ.0) goto 650
192 IF(mstj(12).GE.4) CALL
pyerrm(29,
'(PYSTRF:) sorry,'//
193 &
' junction strings not handled by MSTJ(12)>3 options')
196 IF(mju(jt).EQ.0) goto 640
209 i1beg=
n+1+(jt-1)*(nr-1)
210 i1end=
n+nr+(jt-1)*(1-nr)
212 DO 230
i1=i1beg,i1end,js
213 IF(
k(
i1,2).NE.21.AND.iu.LE.5.AND.ijrfit.EQ.0)
THEN
245 IF (
k(
i1,2).EQ.88)
THEN
250 IF (
i1.EQ.iju(5)+
idir) pwt=pwtold
253 pju(iu,
j)=pju(iu,
j)+
p(
i1,
j)
257 IF (pwt.GT.10d0) goto 270
259 tdp=tjuold(1)*
p(
i1,1)+tjuold(2)*
p(
i1,2)+tjuold(3)*
p(
i1,3)
260 bfc=tdp/(1d0+tjuold(4))+
p(
i1,4)
262 ptmp=
p(
i1,
j)+tjuold(
j)*bfc
263 pbst(iu,
j)=pbst(iu,
j)+ptmp*exp(-pwt)
266 ptmp=tjuold(4)*
p(
i1,4)+tdp
267 pbst(iu,4)=pbst(iu,
j)+ptmp*exp(-pwt)
268 pwt=pwt+ptmp/parj(48)
272 pbst(iu,5)=sqrt(pbst(iu,1)**2+pbst(iu,2)**2+pbst(iu,3)**2)
273 pju(iu,5)=sqrt(pju(iu,1)**2+pju(iu,2)**2+pju(iu,3)**2)
286 tju(4)=sqrt(1d0+tju(1)**2+tju(2)**2+tju(3)**2)
290 tmp=tju(1)*tjuold(1)+tju(2)*tjuold(2)+tju(3)*tjuold(3)
292 tjuold(ix)=tju(ix)+tjuold(ix)*(tmp/(1d0+tjuold(4))+tju(4))
294 tjuold(4)=sqrt(1d0+tjuold(1)**2+tjuold(2)**2+tjuold(3)**2)
298 IF (abs((tju(4)-1d0)/tjuold(4)).GT.0.01d0.AND.
299 & ijrfit.LT.mstj(18))
THEN
301 ELSEIF (ijrfit.GE.mstj(18))
THEN
302 CALL
pyerrm(1,
'(PYSTRF:) failed to converge on JRF')
311 tju(4)=sqrt(1d0+tju(1)**2+tju(2)**2+tju(3)**2)
317 pju(iu,5)=tju(4)*pju(iu,4)-tju(1)*pju(iu,1)-tju(2)*pju(iu,2)-
319 pbst(iu,5)=tju(4)*pbst(iu,4)-tju(1)*pbst(iu,1)-
320 & tju(2)*pbst(iu,2)-tju(3)*pbst(iu,3)
329 ns=iabs(iju(iu+1)-iju(iu))
333 is1=iju(iu)+js*(is-1)
336 dp(1,
j)=0.5d0*
p(is1,
j)
337 IF(is.EQ.1) dp(1,
j)=
p(is1,
j)
338 dp(2,
j)=0.5d0*
p(is2,
j)
339 IF(is.EQ.ns) dp(2,
j)=(-pbst(iu,
j)+2d0*pbst(iu,5)*tju(
j))*
340 & (pju(iu,5)/pbst(iu,5))
342 IF(is.EQ.ns) dp(2,5)=sqrt(
max(0d0,pju(iu,4)**2-
343 & pju(iu,1)**2-pju(iu,2)**2-pju(iu,3)**2))
347 IF(dp(3,5)+2d0*dhkc+dp(4,5).LE.0d0)
THEN
348 dp(1,4)=sqrt(dp(1,1)**2+dp(1,2)**2+dp(1,3)**2)
349 dp(2,4)=sqrt(dp(2,1)**2+dp(2,2)**2+dp(2,3)**2)
354 dhks=sqrt(dhkc**2-dp(3,5)*dp(4,5))
355 dhk1=0.5d0*((dp(4,5)+dhkc)/dhks-1d0)
356 dhk2=0.5d0*((dp(3,5)+dhkc)/dhks-1d0)
358 p(in1,5)=sqrt(dp(3,5)+2d0*dhkc+dp(4,5))
360 p(in1,
j)=(1d0+dhk1)*dp(1,
j)-dhk2*dp(2,
j)
361 p(in1+1,
j)=(1d0+dhk2)*dp(2,
j)-dhk1*dp(1,
j)
369 IF(
ntry.GT.100.AND.ntryr.LE.8.AND.nr.GT.nrmin)
THEN
373 ELSEIF(
ntry.GT.100)
THEN
374 CALL
pyerrm(14,
'(PYSTRF:) caught in infinite loop')
375 IF(mstu(21).GE.1)
RETURN
380 ie(1)=
k(
n+1+(jt/2)*(
np-1),3)
381 IF (mod(jt+iu,2).NE.0)
THEN
388 IF (
k(
it,2).NE.21)
THEN
391 IF (ne.EQ.iu+4*(jt-1))
THEN
393 ELSEIF (
it.LE.ip+
np)
THEN
396 CALL
pyerrm(14,
'(PYSTRF:) '//
397 &
'Original IJU could not be reconstructed!')
405 DO 380 in1=
n+nr+2+jq,
n+nr+4*ns-2+jq,4
426 dp(1,4)=sqrt(dp(1,1)**2+dp(1,2)**2+dp(1,3)**2)
427 dp(2,4)=sqrt(dp(2,1)**2+dp(2,2)**2+dp(2,3)**2)
428 dp(5,1)=dp(1,1)/dp(1,4)-dp(2,1)/dp(2,4)
429 dp(5,2)=dp(1,2)/dp(1,4)-dp(2,2)/dp(2,4)
430 dp(5,3)=dp(1,3)/dp(1,4)-dp(2,3)/dp(2,4)
431 IF(dp(5,1)**2.LE.dp(5,2)**2+dp(5,3)**2) dp(3,1)=1d0
432 IF(dp(5,1)**2.GT.dp(5,2)**2+dp(5,3)**2) dp(3,3)=1d0
433 IF(dp(5,2)**2.LE.dp(5,1)**2+dp(5,3)**2) dp(4,2)=1d0
434 IF(dp(5,2)**2.GT.dp(5,1)**2+dp(5,3)**2) dp(4,3)=1d0
436 dhcx1=dfour(3,1)/dhc12
437 dhcx2=dfour(3,2)/dhc12
438 dhcxx=1d0/sqrt(1d0+2d0*dhcx1*dhcx2*dhc12)
439 dhcy1=dfour(4,1)/dhc12
440 dhcy2=dfour(4,2)/dhc12
441 dhcyx=dhcxx*(dhcx1*dhcy2+dhcx2*dhcy1)*dhc12
442 dhcyy=1d0/sqrt(1d0+2d0*dhcy1*dhcy2*dhc12-dhcyx**2)
444 dp(3,
j)=dhcxx*(dp(3,
j)-dhcx2*dp(1,
j)-dhcx1*dp(2,
j))
446 p(
in(6)+1,
j)=dhcyy*(dp(4,
j)-dhcy2*dp(1,
j)-dhcy1*dp(2,
j)-
452 IF(2*
i-nsav.GE.mstu(4)-mstu(32)-5)
THEN
453 CALL
pyerrm(11,
'(PYSTRF:) no more memory left in PYJETS')
454 IF(mstu(21).GE.1)
RETURN
463 440 CALL
pykfdi(kfl(1),0,kfl(3),
k(
i,2))
464 IF(
k(
i,2).EQ.0) goto 360
465 IF(irankj.EQ.1.AND.iabs(kfl(1)).LE.10.AND.
466 & iabs(kfl(3)).GT.10)
THEN
467 IF(
pyr(0).GT.parj(19)) goto 440
471 pr(1)=
p(
i,5)**2+(
px(1)+
px(3))**2+(
py(1)+
py(3))**2
472 CALL
pyzdis(kfl(1),kfl(3),pr(1),
z)
473 IF(iabs(kfl(1)).GE.4.AND.iabs(kfl(1)).LE.8.AND.
474 & mstu(90).LT.8)
THEN
479 gam(3)=(1d0-
z)*(gam(1)+pr(1)/
z)
485 IF(
in(1)+1.EQ.
in(2).AND.
z*
p(
in(1)+2,3)*
p(
in(2)+2,3)*
486 &
p(
in(1),5)**2.GE.pr(1))
THEN
488 p(
in(2)+2,4)=pr(1)/(
p(
in(1)+2,4)*
p(
in(1),5)**2)
494 ELSEIF(
in(1)+1.EQ.
in(2).AND.
in(1).EQ.
n+nr+4*ns-3)
THEN
500 ELSEIF(
in(1)+1.EQ.
in(2))
THEN
504 IF(
in(2).GT.
n+nr+4*ns) goto 360
505 IF(four(
in(1),
in(2)).LE.1d-2)
THEN
513 480
IF(
in(1).GT.
n+nr+4*ns.OR.
in(2).GT.
n+nr+4*ns.OR.
514 &
in(1).GT.
in(2)) goto 360
515 IF(
in(1).NE.
in(4).OR.
in(2).NE.
in(5))
THEN
522 dp(1,4)=sqrt(dp(1,1)**2+dp(1,2)**2+dp(1,3)**2)
523 dp(2,4)=sqrt(dp(2,1)**2+dp(2,2)**2+dp(2,3)**2)
525 IF(dhc12.LE.1d-2)
THEN
532 dp(5,1)=dp(1,1)/dp(1,4)-dp(2,1)/dp(2,4)
533 dp(5,2)=dp(1,2)/dp(1,4)-dp(2,2)/dp(2,4)
534 dp(5,3)=dp(1,3)/dp(1,4)-dp(2,3)/dp(2,4)
535 IF(dp(5,1)**2.LE.dp(5,2)**2+dp(5,3)**2) dp(3,1)=1d0
536 IF(dp(5,1)**2.GT.dp(5,2)**2+dp(5,3)**2) dp(3,3)=1d0
537 IF(dp(5,2)**2.LE.dp(5,1)**2+dp(5,3)**2) dp(4,2)=1d0
538 IF(dp(5,2)**2.GT.dp(5,1)**2+dp(5,3)**2) dp(4,3)=1d0
539 dhcx1=dfour(3,1)/dhc12
540 dhcx2=dfour(3,2)/dhc12
541 dhcxx=1d0/sqrt(1d0+2d0*dhcx1*dhcx2*dhc12)
542 dhcy1=dfour(4,1)/dhc12
543 dhcy2=dfour(4,2)/dhc12
544 dhcyx=dhcxx*(dhcx1*dhcy2+dhcx2*dhcy1)*dhc12
545 dhcyy=1d0/sqrt(1d0+2d0*dhcy1*dhcy2*dhc12-dhcyx**2)
547 dp(3,
j)=dhcxx*(dp(3,
j)-dhcx2*dp(1,
j)-dhcx1*dp(2,
j))
549 p(
in(3)+1,
j)=dhcyy*(dp(4,
j)-dhcy2*dp(1,
j)-dhcy1*dp(2,
j)-
553 pxp=-(
px(3)*four(
in(6),
in(3))+
py(3)*four(
in(6)+1,
in(3)))
555 IF(abs(pxp**2+
pyp**2-
px(3)**2-
py(3)**2).LT.0.01d0)
THEN
566 DO 510 in1=
in(4),
in(1)-4,4
569 DO 520 in2=
in(5),
in(2)-4,4
574 dhm(2)=2d0*four(
i,
in(1))
575 dhm(3)=2d0*four(
i,
in(2))
576 dhm(4)=2d0*four(
in(1),
in(2))
579 DO 550 in2=
in(1)+1,
in(2),4
580 DO 540 in1=
in(1),in2-1,4
581 dhc=2d0*four(in1,in2)
582 dhg(1)=dhg(1)+
p(in1+2,1)*
p(in2+2,1)*dhc
583 IF(in1.EQ.
in(1)) dhg(2)=dhg(2)-
p(in2+2,1)*dhc
584 IF(in2.EQ.
in(2)) dhg(3)=dhg(3)+
p(in1+2,1)*dhc
585 IF(in1.EQ.
in(1).AND.in2.EQ.
in(2)) dhg(4)=dhg(4)-dhc
590 dhs1=dhm(3)*dhg(4)-dhm(4)*dhg(3)
591 IF(abs(dhs1).LT.1d-4) goto 360
592 dhs2=dhm(4)*(gam(3)-dhg(1))-dhm(2)*dhg(3)-dhg(4)*
593 & (
p(
i,5)**2-dhm(1))+dhg(2)*dhm(3)
594 dhs3=dhm(2)*(gam(3)-dhg(1))-dhg(2)*(
p(
i,5)**2-dhm(1))
595 p(
in(2)+2,4)=0.5d0*(sqrt(
max(0d0,dhs2**2-4d0*dhs1*dhs3))/
596 & abs(dhs1)-dhs2/dhs1)
597 IF(dhm(2)+dhm(4)*
p(
in(2)+2,4).LE.0d0) goto 360
598 p(
in(1)+2,4)=(
p(
i,5)**2-dhm(1)-dhm(3)*
p(
in(2)+2,4))/
599 & (dhm(2)+dhm(4)*
p(
in(2)+2,4))
602 IF(
p(
in(2)+2,4).GT.
p(
in(2)+2,3))
THEN
606 IF(
in(2).GT.
n+nr+4*ns) goto 360
607 IF(four(
in(1),
in(2)).LE.1d-2)
THEN
613 ELSEIF(
p(
in(1)+2,4).GT.
p(
in(1)+2,3))
THEN
624 pju(iu+3,
j)=pju(iu+3,
j)+
p(
i,
j)
626 IF(
p(
i,4).LT.
p(
i,5)) goto 360
627 pju(iu+3,5)=tju(4)*pju(iu+3,4)-tju(1)*pju(iu+3,1)-
628 & tju(2)*pju(iu+3,2)-tju(3)*pju(iu+3,3)
629 IF(pju(iu+3,5).LT.pju(iu,5))
THEN
634 IF(
in(3).NE.
in(6))
THEN
642 p(
in(jq)+2,3)=
p(
in(jq)+2,3)-
p(
in(jq)+2,4)
643 p(
in(jq)+2,1)=
p(
in(jq)+2,1)-(3-2*jq)*
p(
in(jq)+2,4)
649 IF(iabs(kfl(1)).GT.10) goto 360
653 pju(iu+3,
j)=pju(iu+3,
j)-
p(
i+1,
j)
657 pju(iu+3,5)=tju(4)*pju(iu+3,4)-tju(1)*pju(iu+3,1)-
658 & tju(2)*pju(iu+3,2)-tju(3)*pju(iu+3,3)
659 ejstr(iu)=pju(iu,5)-pju(iu+3,5)
661 IF((min(ejstr(1),ejstr(2)).GT.parj(49).OR.
662 & ejstr(1).GT.parj(49)+
pyr(0)*parj(50).OR.
663 & ejstr(2).GT.parj(49)+
pyr(0)*parj(50))
664 & .AND.ntryer.LT.10) goto 320
668 kfls=2*int(
pyr(0)+3d0*parj(4)/(1d0+3d0*parj(4)))+1
669 IF(kfjh(1).EQ.kfjh(2)) kfls=3
670 kfjs(jt)=isign(1000*
max(iabs(kfjh(1)),iabs(kfjh(2)))+
671 & 100*min(iabs(kfjh(1)),iabs(kfjh(2)))+kfls,kfjh(1))
673 pjs(jt,
j)=pju(1,
j)+pju(2,
j)+
p(mju(jt),
j)
674 pjs(jt+2,
j)=pju(4,
j)+pju(5,
j)
676 pjs(jt,5)=sqrt(
max(0d0,pjs(jt,4)**2-pjs(jt,1)**2-pjs(jt,2)**2-
682 650
IF(mju(1).NE.0.AND.mju(2).NE.0)
THEN
685 ELSEIF(mju(1).NE.0)
THEN
688 ELSEIF(mju(2).NE.0)
THEN
691 ELSEIF(iabs(
k(
n+1,2)).NE.21)
THEN
698 p(
n+nr+is,1)=0.5d0*four(
n+is,
n+is+1-nr*(is/nr))
699 w2sum=w2sum+
p(
n+nr+is,1)
704 w2sum=w2sum-
p(
n+nr+nb,1)
705 IF(w2sum.GT.w2ran.AND.nb.LT.nr) goto 670
710 is1=
n+is+nb-1-nr*((is+nb-2)/nr)
711 is2=
n+is+nb-nr*((is+nb-1)/nr)
714 IF(iabs(
k(is1,2)).EQ.21) dp(1,
j)=0.5d0*dp(1,
j)
715 IF(is1.EQ.mju(1)) dp(1,
j)=pjs(1,
j)-pjs(3,
j)
717 IF(iabs(
k(is2,2)).EQ.21) dp(2,
j)=0.5d0*dp(2,
j)
718 IF(is2.EQ.mju(2)) dp(2,
j)=pjs(2,
j)-pjs(4,
j)
720 IF(is1.EQ.mju(1)) dp(1,5)=sqrt(
max(0d0,dp(1,4)**2-dp(1,1)**2-
721 & dp(1,2)**2-dp(1,3)**2))
722 IF(is2.EQ.mju(2)) dp(2,5)=sqrt(
max(0d0,dp(2,4)**2-dp(2,1)**2-
723 & dp(2,2)**2-dp(2,3)**2))
727 IF(dp(3,5)+2d0*dhkc+dp(4,5).LE.0d0) goto 200
728 dhks=sqrt(dhkc**2-dp(3,5)*dp(4,5))
729 dhk1=0.5d0*((dp(4,5)+dhkc)/dhks-1d0)
730 dhk2=0.5d0*((dp(3,5)+dhkc)/dhks-1d0)
732 p(in1,5)=sqrt(dp(3,5)+2d0*dhkc+dp(4,5))
734 p(in1,
j)=(1d0+dhk1)*dp(1,
j)-dhk2*dp(2,
j)
735 p(in1+1,
j)=(1d0+dhk2)*dp(2,
j)-dhk1*dp(1,
j)
743 IF(
ntry.GT.100.AND.ntryr.LE.8.AND.nr.GT.nrmin)
THEN
747 ELSEIF(
ntry.GT.100)
THEN
748 CALL
pyerrm(14,
'(PYSTRF:) caught in infinite loop')
749 IF(mstu(21).GE.1)
RETURN
761 IF(mju(jt).NE.0) irank(jt)=njs(jt)
762 IF(ns.GT.nr) irank(jt)=1
764 ie(jt)=
k(
n+1+(jt/2)*(
np-1),3)
765 in(3*jt+1)=
n+nr+1+4*(jt/2)*(ns-1)
766 in(3*jt+2)=
in(3*jt+1)+1
767 in(3*jt+3)=
n+nr+4*ns+2*jt-1
768 DO 740 in1=
n+nr+2+jt,
n+nr+4*ns-2+jt,4
785 IF(ns.EQ.1.AND.mju(1)+mju(2).EQ.0) CALL
pyptdi(0,
px(1),
py(1))
790 IF(mju(jt).NE.0) kfl(jt)=kfjs(jt)
791 IF(mju(jt).NE.0.AND.iabs(kfl(jt)).GT.1000) ibarrk(jt)=1
799 kfl(3)=int(1d0+(2d0+parj(2))*
pyr(0))*(-1)**int(
pyr(0)+0.5d0)
801 770 CALL
pykfdi(kfl(3),0,kfl(1),kdump)
804 IF(iabs(kfl(1)).GT.10)
THEN
809 IF(ibmo.EQ.1) mstu(121)=-1
814 pr3=min(25d0,0.1d0*
p(
n+nr+1,5)**2)
815 780 CALL
pyzdis(kfl(1),kfl(2),pr3,
z)
816 zr=pr3/(
z*
p(
n+nr+1,5)**2)
817 IF(zr.GE.1d0) goto 780
821 gam(jt)=pr3*(1d0-
z)/
z
822 in1=
n+nr+3+4*(jt/2)*(ns-1)
825 p(in1,3)=(2-jt)*(1d0-
z)+(jt-1)*
z
828 p(in1+1,3)=(2-jt)*(1d0-zr)+(jt-1)*zr
834 pm2qmo(jt)=pmq(jt)**2
835 IF(iabs(kfl(jt)).GT.10) pm2qmo(jt)=0d0
840 IF(jt.EQ.1.OR.ns.EQ.nr-1.OR.mju(1)+mju(2).NE.0)
THEN
849 dp(1,4)=sqrt(dp(1,1)**2+dp(1,2)**2+dp(1,3)**2)
850 dp(2,4)=sqrt(dp(2,1)**2+dp(2,2)**2+dp(2,3)**2)
851 dp(5,1)=dp(1,1)/dp(1,4)-dp(2,1)/dp(2,4)
852 dp(5,2)=dp(1,2)/dp(1,4)-dp(2,2)/dp(2,4)
853 dp(5,3)=dp(1,3)/dp(1,4)-dp(2,3)/dp(2,4)
854 IF(dp(5,1)**2.LE.dp(5,2)**2+dp(5,3)**2) dp(3,1)=1d0
855 IF(dp(5,1)**2.GT.dp(5,2)**2+dp(5,3)**2) dp(3,3)=1d0
856 IF(dp(5,2)**2.LE.dp(5,1)**2+dp(5,3)**2) dp(4,2)=1d0
857 IF(dp(5,2)**2.GT.dp(5,1)**2+dp(5,3)**2) dp(4,3)=1d0
859 dhcx1=dfour(3,1)/dhc12
860 dhcx2=dfour(3,2)/dhc12
861 dhcxx=1d0/sqrt(1d0+2d0*dhcx1*dhcx2*dhc12)
862 dhcy1=dfour(4,1)/dhc12
863 dhcy2=dfour(4,2)/dhc12
864 dhcyx=dhcxx*(dhcx1*dhcy2+dhcx2*dhcy1)*dhc12
865 dhcyy=1d0/sqrt(1d0+2d0*dhcy1*dhcy2*dhc12-dhcyx**2)
867 dp(3,
j)=dhcxx*(dp(3,
j)-dhcx2*dp(1,
j)-dhcx1*dp(2,
j))
869 p(in3+1,
j)=dhcyy*(dp(4,
j)-dhcy2*dp(1,
j)-dhcy1*dp(2,
j)-
875 p(in3+3,
j)=
p(in3+1,
j)
881 IF(mju(1)+mju(2).GT.0)
THEN
883 IF(njs(jt).EQ.0) goto 860
885 p(
n+nrs,
j)=
p(
n+nrs,
j)-pjs(jt+2,
j)
889 IF(mstj(11).EQ.2) parjst=parj(34)
890 wmin=parjst+pmq(1)+pmq(2)
891 wrem2=four(
n+nrs,
n+nrs)
892 IF(
p(
n+nrs,4).LT.0d0.OR.wrem2.LT.wmin**2)
THEN
894 IF(mod(ntrywr,20).NE.0) ntryr=ntryr-1
901 IF(2*
i-nsav.GE.mstu(4)-mstu(32)-5)
THEN
902 CALL
pyerrm(11,
'(PYSTRF:) no more memory left in PYJETS')
903 IF(mstu(21).GE.1)
RETURN
906 IF(mstu(121).LE.0)
THEN
908 IF(iabs(kfl(3-jt)).GT.10) jt=3-jt
909 IF(iabs(kfl(3-jt)).GE.4.AND.iabs(kfl(3-jt)).LE.8) jt=3-jt
913 irank(jt)=irank(jt)+1
920 CALL
pykfdi(kfl(jt),0,kfl(3),
k(
i,2))
921 IF(
k(
i,2).EQ.0) goto 710
923 IF(mstu(121).EQ.-1) goto 910
924 IF(irank(jt).EQ.1.AND.iabs(kfl(jt)).LE.10.AND.
925 &iabs(kfl(3)).GT.10)
THEN
926 IF(
pyr(0).GT.parj(19)) goto 880
928 IF(ibarrk(jt).EQ.1.AND.mod(iabs(
k(
i,2)),10000).GT.1000)
932 pr(jt)=
p(
i,5)**2+(
px(jt)+
px(3))**2+(
py(jt)+
py(3))**2
938 IF(mstj(11).EQ.2) parjst=parj(34)
939 wmin=parjst+pmq(1)+pmq(2)+parj(36)*pmq(3)
940 IF(iabs(kfl(jt)).GT.10.AND.iabs(kfl(3)).GT.10) wmin=
941 &wmin-0.5d0*parj(36)*pmq(3)
942 wrem2=four(
n+nrs,
n+nrs)
943 IF(wrem2.LT.0.10d0) goto 710
944 IF(wrem2.LT.
max(wmin*(1d0+(2d0*
pyr(0)-1d0)*parj(37)),
945 &parj(32)+pmq(1)+pmq(2))**2) goto 1080
948 CALL
pyzdis(kfl(jt),kfl(3),pr(jt),
z)
949 IF(iabs(kfl(jt)).GE.4.AND.iabs(kfl(jt)).LE.8.AND.
957 IF(
max(mod(kfl1a,10),mod(kfl1a/1000,10),mod(kfl2a,10),
958 &mod(kfl2a/1000,10)).GE.4)
THEN
959 pr(jr)=(pmq(jr)+pmq(3))**2+(
px(jr)-
px(3))**2+(
py(jr)-
py(3))**2
960 pw12=sqrt(
max(0d0,(wrem2-pr(1)-pr(2))**2-4d0*pr(1)*pr(2)))
961 z=(wrem2+pr(jt)-pr(jr)+pw12*(2d0*
z-1d0))/(2d0*wrem2)
962 pr(jr)=(pmq(jr)+parjst)**2+(
px(jr)-
px(3))**2+(
py(jr)-
py(3))**2
963 IF((1d0-
z)*(wrem2-pr(jt)/
z).LT.pr(jr)) goto 1080
965 gam(3)=(1d0-
z)*(gam(jt)+pr(jt)/
z)
968 xtmo3=(1d0-
z)*xtmo(jt)
969 IF(iabs(kfl(3)).LE.10) nrvmo=0
970 IF(iabs(kfl(3)).GT.10.AND.mstj(12).GE.4)
THEN
974 IF(iabs(kfl(jt)).LE.10)
THEN
975 xbmo=min(xtmo3,1d0-(2d-10))
978 pgmo=gbmo+
log(1d0-xbmo)*pm2qmo(jt)
979 gtstmo=1d0-parf(192)**pgmo
981 IF(irank(jt).EQ.1)
THEN
986 IF(xbmo.LT.1d0-(1d-10))
THEN
987 pgnmo=gbmo*xtmo3/xbmo+pm2qmo(jt)*
log(1d0-xtmo3)
988 gtstmo=(1d0-parf(192)**pgnmo)/(1d0-parf(192)**pgmo)
991 IF(mstj(12).GE.5)
THEN
992 pmnmo=sqrt((xbmo-xtmo3)*(gam(3)/xtmo3-gbmo/xbmo))
994 ptstmo=exp((pmmo-pmnmo)*parf(193))
1000 IF(ptstmo*gtstmo.GT.rtstmo)
THEN
1001 IF(irank(jt).EQ.1.OR.iabs(kfl(jt)).LE.10)
THEN
1003 IF(
i+nrvmo.GT.mstu(4)-mstu(32)-5)
THEN
1005 &
'(PYSTRF:) no more memory left in PYJETS')
1006 IF(mstu(21).GE.1)
RETURN
1029 IF(ptstmo.GT.rtstmo) mstu(121)=-2
1035 910
IF(mstu(121).LT.0)
THEN
1036 IF(mstu(121).EQ.-2) mstu(121)=0
1039 IF(irank(jt).EQ.1.OR.iabs(kfl(jt)).LE.10) goto 880
1067 IF(
in(1)+1.EQ.
in(2).AND.
z*
p(
in(1)+2,3)*
p(
in(2)+2,3)*
1068 &
p(
in(1),5)**2.GE.pr(jt))
THEN
1070 p(
in(jr)+2,4)=pr(jt)/(
p(
in(jt)+2,4)*
p(
in(1),5)**2)
1075 ELSEIF(
in(1)+1.EQ.
in(2))
THEN
1076 p(
in(jr)+2,4)=
p(
in(jr)+2,3)
1079 IF(js*
in(jr).GT.js*
in(4*jr)) goto 710
1080 IF(four(
in(1),
in(2)).LE.1d-2)
THEN
1081 p(
in(jt)+2,4)=
p(
in(jt)+2,3)
1088 960
IF(js*
in(1).GT.js*
in(3*jr+1).OR.js*
in(2).GT.js*
in(3*jr+2).OR.
1089 &
in(1).GT.
in(2)) goto 710
1090 IF(
in(1).NE.
in(3*jt+1).OR.
in(2).NE.
in(3*jt+2))
THEN
1097 dp(1,4)=sqrt(dp(1,1)**2+dp(1,2)**2+dp(1,3)**2)
1098 dp(2,4)=sqrt(dp(2,1)**2+dp(2,2)**2+dp(2,3)**2)
1100 IF(dhc12.LE.1d-2)
THEN
1101 p(
in(jt)+2,4)=
p(
in(jt)+2,3)
1107 dp(5,1)=dp(1,1)/dp(1,4)-dp(2,1)/dp(2,4)
1108 dp(5,2)=dp(1,2)/dp(1,4)-dp(2,2)/dp(2,4)
1109 dp(5,3)=dp(1,3)/dp(1,4)-dp(2,3)/dp(2,4)
1110 IF(dp(5,1)**2.LE.dp(5,2)**2+dp(5,3)**2) dp(3,1)=1d0
1111 IF(dp(5,1)**2.GT.dp(5,2)**2+dp(5,3)**2) dp(3,3)=1d0
1112 IF(dp(5,2)**2.LE.dp(5,1)**2+dp(5,3)**2) dp(4,2)=1d0
1113 IF(dp(5,2)**2.GT.dp(5,1)**2+dp(5,3)**2) dp(4,3)=1d0
1114 dhcx1=dfour(3,1)/dhc12
1115 dhcx2=dfour(3,2)/dhc12
1116 dhcxx=1d0/sqrt(1d0+2d0*dhcx1*dhcx2*dhc12)
1117 dhcy1=dfour(4,1)/dhc12
1118 dhcy2=dfour(4,2)/dhc12
1119 dhcyx=dhcxx*(dhcx1*dhcy2+dhcx2*dhcy1)*dhc12
1120 dhcyy=1d0/sqrt(1d0+2d0*dhcy1*dhcy2*dhc12-dhcyx**2)
1122 dp(3,
j)=dhcxx*(dp(3,
j)-dhcx2*dp(1,
j)-dhcx1*dp(2,
j))
1124 p(
in(3)+1,
j)=dhcyy*(dp(4,
j)-dhcy2*dp(1,
j)-dhcy1*dp(2,
j)-
1128 pxp=-(
px(3)*four(
in(3*jt+3),
in(3))+
py(3)*
1129 & four(
in(3*jt+3)+1,
in(3)))
1131 & four(
in(3*jt+3)+1,
in(3)+1))
1132 IF(abs(pxp**2+
pyp**2-
px(3)**2-
py(3)**2).LT.0.01d0)
THEN
1143 DO 990 in1=
in(3*jt+1),
in(1)-4*js,4*js
1146 DO 1000 in2=
in(3*jt+2),
in(2)-4*js,4*js
1151 dhm(2)=2d0*four(
i,
in(1))
1152 dhm(3)=2d0*four(
i,
in(2))
1153 dhm(4)=2d0*four(
in(1),
in(2))
1156 DO 1030 in2=
in(1)+1,
in(2),4
1157 DO 1020 in1=
in(1),in2-1,4
1158 dhc=2d0*four(in1,in2)
1159 dhg(1)=dhg(1)+
p(in1+2,jt)*
p(in2+2,jt)*dhc
1160 IF(in1.EQ.
in(1)) dhg(2)=dhg(2)-js*
p(in2+2,jt)*dhc
1161 IF(in2.EQ.
in(2)) dhg(3)=dhg(3)+js*
p(in1+2,jt)*dhc
1162 IF(in1.EQ.
in(1).AND.in2.EQ.
in(2)) dhg(4)=dhg(4)-dhc
1167 dhs1=dhm(jr+1)*dhg(4)-dhm(4)*dhg(jr+1)
1168 IF(abs(dhs1).LT.1d-4) goto 710
1169 dhs2=dhm(4)*(gam(3)-dhg(1))-dhm(jt+1)*dhg(jr+1)-dhg(4)*
1170 &(
p(
i,5)**2-dhm(1))+dhg(jt+1)*dhm(jr+1)
1171 dhs3=dhm(jt+1)*(gam(3)-dhg(1))-dhg(jt+1)*(
p(
i,5)**2-dhm(1))
1172 p(
in(jr)+2,4)=0.5d0*(sqrt(
max(0d0,dhs2**2-4d0*dhs1*dhs3))/
1173 &abs(dhs1)-dhs2/dhs1)
1174 IF(dhm(jt+1)+dhm(4)*
p(
in(jr)+2,4).LE.0d0) goto 710
1175 p(
in(jt)+2,4)=(
p(
i,5)**2-dhm(1)-dhm(jr+1)*
p(
in(jr)+2,4))/
1176 &(dhm(jt+1)+dhm(4)*
p(
in(jr)+2,4))
1179 IF(
p(
in(jr)+2,4).GT.
p(
in(jr)+2,3))
THEN
1180 p(
in(jr)+2,4)=
p(
in(jr)+2,3)
1183 IF(js*
in(jr).GT.js*
in(4*jr)) goto 710
1184 IF(four(
in(1),
in(2)).LE.1d-2)
THEN
1185 p(
in(jt)+2,4)=
p(
in(jt)+2,3)
1190 ELSEIF(
p(
in(jt)+2,4).GT.
p(
in(jt)+2,3))
THEN
1191 p(
in(jt)+2,4)=
p(
in(jt)+2,3)
1202 IF(
p(
in(1)+2,4).GT.1d0+paru(14).OR.
p(
in(1)+2,4).LT.-paru(14).OR.
1203 &
p(
in(2)+2,4).GT.1d0+paru(14).OR.
p(
in(2)+2,4).LT.-paru(14))
1205 IF(
p(
i,4).LT.
p(
i,5)) goto 710
1211 IF(
in(3).NE.
in(3*jt+3))
THEN
1219 p(
in(jq)+2,3)=
p(
in(jq)+2,3)-
p(
in(jq)+2,4)
1220 p(
in(jq)+2,jt)=
p(
in(jq)+2,jt)-js*(3-2*jq)*
p(
in(jq)+2,4)
1222 IF(ibarrk(jt).EQ.1.AND.mod(iabs(
k(
i,2)),10000).GT.1000)
1232 CALL
pykfdi(kfl(jr),-kfl(3),kfldmp,
k(
i,2))
1233 IF(
k(
i,2).EQ.0) goto 710
1234 IF(ibarrk(jt).EQ.1.AND.mod(iabs(
k(
i-1,2)),10000).GT.1000)
1236 IF(ibarrk(jt).EQ.1.AND.mod(iabs(
k(
i,2)),10000).GT.1000)
1238 IF(ibarrk(jr).EQ.1.AND.mod(iabs(
k(
i,2)),10000).GT.1000)
1241 pr(jr)=
p(
i,5)**2+(
px(jr)-
px(3))**2+(
py(jr)-
py(3))**2
1245 IF(
p(
in(4)+2,3)*
p(
in(5)+2,3)*four(
in(4),
in(5)).LT.
1246 &
p(
in(7)+2,3)*
p(
in(8)+2,3)*four(
in(7),
in(8))) jq=2
1247 dhc12=four(
in(3*jq+1),
in(3*jq+2))
1248 dhr1=four(
n+nrs,
in(3*jq+2))/dhc12
1249 dhr2=four(
n+nrs,
in(3*jq+1))/dhc12
1250 IF(
in(4).NE.
in(7).OR.
in(5).NE.
in(8))
THEN
1251 px(3-jq)=-four(
n+nrs,
in(3*jq+3))-
px(jq)
1252 py(3-jq)=-four(
n+nrs,
in(3*jq+3)+1)-
py(jq)
1253 pr(3-jq)=
p(
i+(jt+jq-3)**2-1,5)**2+(
px(3-jq)+(2*jq-3)*js*
1254 &
px(3))**2+(
py(3-jq)+(2*jq-3)*js*
py(3))**2
1258 wrem2=2d0*dhr1*dhr2*dhc12
1259 fd=(sqrt(pr(1))+sqrt(pr(2)))/sqrt(wrem2)
1260 IF(mju(1)+mju(2).NE.0.AND.
i.EQ.isav+2.AND.
fd.GE.1d0) goto 200
1261 IF(
fd.GE.1d0) goto 710
1262 fa=wrem2+pr(jt)-pr(jr)
1263 fb=sqrt(
max(0d0,fa**2-4d0*wrem2*pr(jt)))
1265 IF(mstj(11).EQ.2) prevcf=parj(39)
1266 prev=1d0/(1d0+exp(min(50d0,prevcf*fb*parj(40))))
1270 IF(
max(mod(kfl1a,10),mod(kfl1a/1000,10),mod(kfl2a,10),
1271 &mod(kfl2a/1000,10)).GE.6) fb=
sign(sqrt(
max(0d0,fa**2-
1272 &4d0*wrem2*pr(jt))),dble(js))
1275 &
p(
in(3*jq+3)+1,
j)+0.5d0*(dhr1*(fa+fb)*
p(
in(3*jq+1),
j)+
1276 & dhr2*(fa-fb)*
p(
in(3*jq+2),
j))/wrem2
1279 IF(
p(
i-1,4).LT.
p(
i-1,5).OR.
p(
i,4).LT.
p(
i,5)) goto 710
1280 dm2f1=
p(
i-1,4)**2-
p(
i-1,1)**2-
p(
i-1,2)**2-
p(
i-1,3)**2-
p(
i-1,5)**2
1281 dm2f2=
p(
i,4)**2-
p(
i,1)**2-
p(
i,2)**2-
p(
i,3)**2-
p(
i,5)**2
1282 IF(dm2f1.GT.1d-10*
p(
i-1,4)**2.OR.dm2f2.GT.1d-10*
p(
i,4)**2)
THEN
1284 IF(ntryfn.LT.100) goto 140
1285 CALL
pyerrm(13,
'(PYSTRF:) bad energies for final two hadrons')
1290 DO 1100
i=nsav+1,nsav+
np
1293 IF(mstu(16).NE.2)
THEN
1313 p(nsav,5)=sqrt(
max(0d0,dps(4)**2-dps(1)**2-dps(2)**2-dps(3)**2))
1323 DO 1140 iz=mstu90+1,mstu91
1324 mstu9t(iz)=mstu(90+iz)-nrs+1-nsav+
n
1325 paru9t(iz)=paru(90+iz)
1337 DO 1190
i=
n+1,2*
n-nsav
1338 IF(
k(
i,3).NE.ie(1).AND.
k(
i,3).NE.ijuori(1)) goto 1190
1344 IF(mstu(16).NE.2)
k(
i1,3)=nsav
1345 DO 1180 iz=mstu90+1,mstu91
1346 IF(mstu9t(iz).EQ.
i)
THEN
1348 mstu(90+mstu(90))=
i1
1349 paru(90+mstu(90))=paru9t(iz)
1353 DO 1220
i=2*
n-nsav,
n+1,-1
1354 IF(
k(
i,3).EQ.ie(1).OR.
k(
i,3).EQ.ijuori(1)) goto 1220
1360 IF(mstu(16).NE.2)
k(
i1,3)=nsav
1361 DO 1210 iz=mstu90+1,mstu91
1362 IF(mstu9t(iz).EQ.
i)
THEN
1364 mstu(90+mstu(90))=
i1
1365 paru(90+mstu(90))=paru9t(iz)
1373 CALL
pyrobo(nsav+1,
n,0d0,0d0,dps(1)/dps(4),dps(2)/dps(4),
1377 hhpmt=
p(
i,1)**2+
p(
i,2)**2+
p(
i,5)**2
1378 IF(
p(
i,3).GT.0d0)
THEN
1379 hhpez=(
p(
i,4)+
p(
i,3))*hhbz
1380 p(
i,3)=0.5d0*(hhpez-hhpmt/hhpez)
1381 p(
i,4)=0.5d0*(hhpez+hhpmt/hhpez)
1383 hhpez=(
p(
i,4)-
p(
i,3))/hhbz
1384 p(
i,3)=-0.5d0*(hhpez-hhpmt/hhpez)
1385 p(
i,4)=0.5d0*(hhpez+hhpmt/hhpez)