20 SUBROUTINE pyptmi(MODE,PT2NOW,PT2CUT,PT2,IFAIL)
22 IMPLICIT DOUBLE PRECISION(a-
h, o-
z)
26 parameter(maxnur=1000)
28 common/pypart/
npart,npartd,ipart(maxnur),ptpart(maxnur)
30 common/
pydat1/mstu(200),paru(200),mstj(200),parj(200)
31 common/
pydat2/kchg(500,4),pmas(500,4),parf(2000),vckm(4,4)
32 common/
pydat3/mdcy(500,3),mdme(8000,2),brat(8000),kfdp(8000,5)
35 common/
pyint2/iset(500),kfpr(500,2),coef(500,20),icol(40,4,2)
36 common/
pyint3/xsfx(2,-40:40),isig(1000,3),sigh(1000)
38 common/
pyint7/sigt(0:6,0:6,0:5)
39 common/pyintm/kfival(2,3),nmi(2),imi(2,800,2),nvc(2,-6:6),
40 & xassoc(2,-6:6,240),xpsvc(-6:6,-1:240),pvctot(2,-1:1),
41 & xmi(2,240),pt2mi(240),imisep(0:240)
42 common/pyismx/mimx,jsmx,kflamx,kflcmx,kfbeam(2),nisgen(2,240),
43 & pt2mx,pt2amx,zmx,rm2cmx,q2bmx,phimx
44 common/pyctag/nct,mct(4000,2)
46 dimension wdtp(0:400),wdte(0:400,0:5),xpq(-25:25)
69 imi(js,1,1)=
mint(84)+js
81 IF (mod(
mstp(81),10).GE.1)
THEN
82 IF(
mstp(82).LE.1)
THEN
85 IF(
mint(141).NE.0.OR.
mint(142).NE.0) sigrat=sigrat*
87 xt2fac=sigrat*
vint(149)/(1d0-
vint(149))
106 kfbeam(js)=
mint(10+js)
107 IF(
mint(18+js).EQ.1) kfbeam(js)=22
108 kfabm=iabs(kfbeam(js))
109 kfsbm=isign(1,kfbeam(js))
116 IF(kfabm.GT.1000)
THEN
117 kfival(js,1)=kfsbm*mod(kfabm/1000,10)
118 kfival(js,2)=kfsbm*mod(kfabm/100,10)
119 kfival(js,3)=kfsbm*mod(kfabm/10,10)
121 ELSEIF(kfabm.EQ.211)
THEN
124 ELSEIF(kfabm.EQ.321)
THEN
125 kfival(js,1)=-kfsbm*3
138 DO 150
i=imisep(0)+1,
n
141 k(
i,4)=mod(
k(
i,4),mstu(5)**2)
142 k(
i,5)=mod(
k(
i,5),mstu(5)**2)
149 IF (
k(
i1,2).NE.21.AND.(9-2*jcs).NE.isign(1,
k(
i1,2)))
151 IF (
k(
i1,jcs)/mstu(5)**2.NE.0) goto 160
154 IF(
mint(51).NE.0)
RETURN
159 IF (
mstp(87).LT.0)
THEN
160 CALL
pyerrm(19,
'(PYPTMI:) MSTP(87) out of range. Forced'//
163 ELSEIF (
mstp(87).GT.4)
THEN
164 CALL
pyerrm(19,
'(PYPTMI:) MSTP(87) out of range. Forced'//
174 ELSEIF (mode.EQ.0)
THEN
176 xt2=4d0*min(pt2now,
vint(62))/
vint(2)
177 180
IF(
mstp(82).LE.1)
THEN
178 xt2=xt2fac*xt2/(xt2fac-xt2*
log(
pyr(0)))
179 IF(xt2.LT.
vint(149)) ifail=-2
181 IF(xt2.LE.0.01001d0*
vint(149))
THEN
184 xt2=xt2fac*(xt2+
vint(149))/(xt2fac-(xt2+
vint(149))*
191 IF (
pt2.LE.pt2cut) ifail=-4
192 IF (
pt2.LE.pt2mx) ifail=-5
202 IF(
pyr(0).LE.coef(isub,1))
THEN
203 taut=(2d0*(1d0+sqrt(1d0-xt2))/xt2-1d0)**
pyr(0)
204 tau=xt2*(1d0+taut)**2/(4d0*taut)
206 tau=xt2*(1d0+tan(
pyr(0)*atan(sqrt(1d0/xt2-1d0)))**2)
210 IF(
tau*
vint(2).LT.1d0) goto 180
214 IF(ryst.GT.coef(isub,8)) myst=2
215 IF(ryst.GT.coef(isub,8)+coef(isub,9)) myst=3
222 IF(
vint(143)-x1m.LT.0.01d0.OR.
vint(144)-x2m.LT.0.01d0) goto 180
225 IF(
mint(141).NE.0.OR.
mint(142).NE.0) sigs=sigs*
vint(320)
226 IF(sigs.LT.
xsec(isub,1)*
pyr(0)) goto 180
227 IF(
mint(141).NE.0.OR.
mint(142).NE.0) sigs=sigs/
vint(320)
230 IF (
pt2.GT.pt2mx)
THEN
238 ELSEIF (mode.EQ.1)
THEN
255 CALL
pyerrm(9,
'(PYPTMI:) Unable to generate additional '
256 & //
'interaction. Giving up!')
265 rsigs=rsigs-sigh(ichn)
266 IF(rsigs.LE.0d0) goto 230
271 iconmi=mod(iconmi,10)
274 IF(isubmi.EQ.12.OR.isubmi.EQ.53)
THEN
276 CALL
pywidt(21,sh,wdtp,wdte)
277 240 rkfl=(wdte(0,1)+wdte(0,2)+wdte(0,4))*
pyr(0)
278 DO 250
i=1,mdcy(21,3)
279 kflf=kfdp(
i+mdcy(21,2)-1,1)
280 rkfl=rkfl-(wdte(
i,1)+wdte(
i,2)+wdte(
i,4))
281 IF(rkfl.LE.0d0) goto 260
283 260
IF(isubmi.EQ.53.AND.iconmi.LE.2)
THEN
284 IF(kflf.GE.4) goto 240
285 ELSEIF(isubmi.EQ.53.AND.iconmi.LE.4)
THEN
288 ELSEIF(isubmi.EQ.53)
THEN
301 IF(isubmi.EQ.11)
THEN
304 IF(kfl1*kfl2.LT.0) kcc=kcc+2
306 ELSEIF(isubmi.EQ.12)
THEN
308 kfl3=isign(kflf,kfl1)
312 ELSEIF(isubmi.EQ.13)
THEN
318 ELSEIF(isubmi.EQ.28)
THEN
322 IF(kfl1.EQ.21) kcc=kcc+2
323 IF(kfl1.NE.21) kcs=isign(1,kfl1)
324 IF(kfl2.NE.21) kcs=isign(1,kfl2)
326 ELSEIF(isubmi.EQ.53)
THEN
328 kcs=(-1)**int(1.5d0+
pyr(0))
333 ELSEIF(isubmi.EQ.68)
THEN
336 kcs=(-1)**int(1.5d0+
pyr(0))
340 IF (iabs(kfl3).EQ.4.OR.iabs(kfl4).EQ.4.OR.iabs(kfl3).EQ.5
341 & .OR.iabs(kfl4).EQ.5)
THEN
343 IF (
pt2.LE.1.05*rmmax2)
THEN
344 IF (
ntry.EQ.1) CALL
pyerrm(9,
'(PYPTMI:) Heavy quarks'
345 & //
' created below threshold. Rejected.')
376 IF(icol(kcc,1,jc).NE.0)
k(
n+1,
j+3)=
n+icol(kcc,1,jc)
377 IF(icol(kcc,2,jc).NE.0)
k(
n+2,
j+3)=
n+icol(kcc,2,jc)
378 IF(icol(kcc,3,jc).NE.0)
k(
n+3,
j+3)=mstu(5)*(
n+icol(kcc,3,jc))
379 IF(icol(kcc,4,jc).NE.0)
k(
n+4,
j+3)=mstu(5)*(
n+icol(kcc,4,jc))
390 IF(
p(
n+3,5)+
p(
n+4,5).GE.shr)
THEN
394 p(
n+3,4)=0.5d0*(shr+(
p(
n+3,5)**2-
p(
n+4,5)**2)/shr)
395 p(
n+3,3)=sqrt(
max(0d0,
p(
n+3,4)**2-
p(
n+3,5)**2))
396 p(
n+4,4)=shr-
p(
n+3,4)
406 IF (
mint(351).EQ.1)
vint(356)=sqrt(
p(
n+3,1)**2+
p(
n+3,2)**2)
414 imi(js,
mint(31),1)=
n+js
436 IF(
n.GT.mstu(4)-mstu(32)-10)
THEN
437 CALL
pyerrm(11,
'(PYMIGN:) no more memory left in PYJETS')
447 IF (
k(
i1,2).NE.21.AND.(9-2*jcs).NE.isign(1,
k(
i1,2)))
449 IF (
k(
i1,jcs)/mstu(5)**2.NE.0) goto 290
452 IF(
mint(51).NE.0)
RETURN
459 ELSEIF (mode.EQ.2)
THEN
463 kfsbm=isign(1,
mint(10+js))
464 ifl=
k(imi(js,mi,1),2)
466 IF (iabs(ifl).GE.6)
THEN
467 IF (iabs(ifl).EQ.6)
THEN
468 CALL
pyerrm(29,
'(PYPTMI:) top in initial state!')
482 DO 310 ivc=1,nvc(js,ifl)
483 cmp=cmp+xpsvc(ifl,ivc)
487 320 rvcs=
pyr(0)*(sea+val+cmp)
489 330
IF (rvcs.LE.val.AND.ivnow.GE.1)
THEN
492 IF(kfival(js,1).EQ.ifl) ivnow=ivnow+1
493 IF(kfival(js,2).EQ.ifl) ivnow=ivnow+1
494 IF(kfival(js,3).EQ.ifl) ivnow=ivnow+1
495 IF(kfival(js,1).EQ.0)
THEN
496 IF(kfbeam(js).EQ.111.AND.iabs(ifl).LE.2) ivnow=1
497 IF(kfbeam(js).EQ.22.AND.iabs(ifl).LE.5) ivnow=1
498 IF((kfbeam(js).EQ.130.OR.kfbeam(js).EQ.310).AND.
499 & (iabs(ifl).EQ.1.OR.iabs(ifl).EQ.3)) ivnow=1
503 IF (
i1.EQ.
mint(36)) goto 340
504 IF (
k(imi(js,
i1,1),2).EQ.ifl.AND.imi(js,
i1,2).EQ.0)
508 IF(ivnow.EQ.0) goto 330
512 IF(kfival(js,1).EQ.0)
THEN
513 IF(kfbeam(js).EQ.111.OR.kfbeam(js).EQ.22)
THEN
516 ELSEIF(kfbeam(js).EQ.130.OR.kfbeam(js).EQ.310)
THEN
518 IF(iabs(ifl).EQ.1) kfival(js,2)=isign(3,-ifl)
519 IF(iabs(ifl).NE.1) kfival(js,2)=isign(1,-ifl)
523 ELSEIF (rvcs.LE.val+sea)
THEN
525 nvc(js,-ifl)=nvc(js,-ifl)+1
526 xassoc(js,-ifl,nvc(js,-ifl))=xmi(js,mi)
528 imi(js,mi,2)=-nvc(js,-ifl)
532 IF (nvc(js,ifl).EQ.0)
THEN
534 CALL
pyerrm(9,
'(PYPTMI:) No cmp quark, but pdf != 0!')
540 cmpsum=cmpsum+xpsvc(ifl,isel)
541 IF (rvcs.GT.cmpsum.AND.isel.LT.nvc(js,ifl)) goto 350
545 IF (
i1.EQ.
mint(36)) goto 360
546 IF (
k(imi(js,
i1,1),2).NE.-ifl) goto 360
547 IF (-imi(js,
i1,2).EQ.isel)
THEN
548 imi(js,mi,2)=imi(js,
i1,1)
549 imi(js,
i1,2)=imi(js,mi,1)
553 xassoc(js,ifl,isel)=-xassoc(js,ifl,isel)