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)
19 common/
pysubs/msel,mselpd,msub(500),kfin(2,-40:40),ckin(200)
22 common/
pyint2/iset(500),kfpr(500,2),coef(500,20),icol(40,4,2)
23 common/
pyint3/xsfx(2,-40:40),isig(1000,3),sigh(1000)
25 common/
pyint7/sigt(0:6,0:6,0:5)
29 dimension nmul(20),sigm(20),kstr(500,2),vintsv(80)
30 SAVE xt2,xt2fac,xc2,xts,irbin,rbin,nmul,sigm,p83a,p83b,p83c,
31 &cq2i,cq2r,pik,bdiv,b,plowb,phighb,pallb,s4a,s4b,s4c,powip,
32 &rpwip,b2rpdv,b2rpmx,bavg,vnt145,vnt146,vnt147
36 IF(
mstp(122).GE.1)
WRITE(mstu(11),5000)
mstp(82)
49 DO 110 itry=1,
mstp(83)
50 rsca=0.05d0*((21-ixt2)-
pyr(0))
56 IF(
pyr(0).LE.coef(isub,1))
THEN
57 taut=(2d0*(1d0+sqrt(1d0-xt2))/xt2-1d0)**
pyr(0)
58 tau=xt2*(1d0+taut)**2/(4d0*taut)
60 tau=xt2*(1d0+tan(
pyr(0)*atan(sqrt(1d0/xt2-1d0)))**2)
66 IF(ryst.GT.coef(isub,8)) myst=2
67 IF(ryst.GT.coef(isub,8)+coef(isub,9)) myst=3
74 sigm(ixt2)=sigm(ixt2)+sigs
76 sigsum=sigsum+sigm(ixt2)
78 sigsum=sigsum/(20d0*
mstp(83))
81 IF(sigsum.LT.1.1d0*sigt(0,0,5))
THEN
82 IF(
mstp(122).GE.1)
WRITE(mstu(11),5100)
89 IF(
mstp(122).GE.1)
WRITE(mstu(11),5200)
93 yke=sigsum/
max(1d-10,sigt(0,0,5))
94 p83a=(1d0-
parp(83))**2
98 cq2r=2d0/(1d0+
parp(84)**2)
106 130
IF(iit.EQ.0)
THEN
108 ELSEIF(iit.EQ.1)
THEN
111 xk=xi+(yke-yi)*(xf-xi)/(yf-yi)
115 IF(
mstp(82).EQ.2)
THEN
116 sp=0.5d0*paru(1)*(1d0-exp(-xk))
119 IF(
mstp(82).EQ.3)
THEN
121 ELSEIF(
mstp(82).EQ.4)
THEN
122 deltab=min(0.01d0,0.05d0*
parp(84))
126 deltab=
max(0.02d0,0.02d0*(2d0/powip)**(1d0/powip))
136 IF(
mstp(82).EQ.3)
THEN
137 ov=exp(-b**2)/paru(2)
138 ELSEIF(
mstp(82).EQ.4)
THEN
139 ov=(p83a*exp(-min(50d0,b**2))+
140 & p83b*cq2r*exp(-min(50d0,b**2*cq2r))+
141 & p83c*cq2i*exp(-min(50d0,b**2*cq2i)))/paru(2)
143 ov=exp(-b**powip)/paru(2)
144 so=so+paru(2)*b*deltab*ov
146 IF(ibdiv.EQ.1) sohigh=sohigh+paru(2)*b*deltab*ov
147 pacc=1d0-exp(-min(50d0,paru(1)*xk*ov))
148 sp=
sp+paru(2)*b*deltab*pacc
149 sop=sop+paru(2)*b*deltab*ov*pacc
150 bsp=bsp+b*paru(2)*b*deltab*pacc
151 IF(ibdiv.EQ.0.AND.paru(1)*xk*ov.LT.1d0)
THEN
155 IF(b.LT.1d0.OR.b*pacc.GT.1d-6) goto 140
169 IF(abs(yk-yke).GE.1d-5*yke) goto 130
180 pik=(vnt146/vnt147)*yke
183 plowb=paru(1)*bdiv**2
184 IF(
mstp(82).EQ.3)
THEN
185 phighb=pik*0.5*exp(-bdiv**2)
186 ELSEIF(
mstp(82).EQ.4)
THEN
187 s4a=p83a*exp(-bdiv**2)
188 s4b=p83b*exp(-bdiv**2*cq2r)
189 s4c=p83c*exp(-bdiv**2*cq2i)
190 phighb=pik*0.5*(s4a+s4b+s4c)
191 ELSEIF(
parp(83).GE.1.999d0)
THEN
197 b2rpmx=
max(2d0*rpwip,b2rpdv)
202 ELSEIF(mmul.EQ.2)
THEN
206 IF(
mstp(82).LE.0)
THEN
207 ELSEIF(
mstp(82).EQ.1)
THEN
210 IF(
mint(141).NE.0.OR.
mint(142).NE.0) sigrat=sigrat*
212 xt2fac=sigrat*
vint(149)/(1d0-
vint(149))
213 ELSEIF(
mstp(82).EQ.2)
THEN
215 xt2fac=vnt146*
xsec(96,1)/
max(1d-10,sigt(0,0,5))*
218 xc2=4d0*ckin(3)**2/
vint(2)
219 IF(ckin(3).LE.ckin(5).OR.
mint(82).GE.2) xc2=0d0
223 IF(
mstp(82).LE.2)
RETURN
224 142
IF(
pyr(0)*pallb.LT.plowb)
THEN
228 IF(
mstp(82).EQ.3)
THEN
229 ov=exp(-b**2)/paru(2)
230 ELSEIF(
mstp(82).EQ.4)
THEN
231 ov=(p83a*exp(-min(50d0,b**2))+
232 & p83b*cq2r*exp(-min(50d0,b**2*cq2r))+
233 & p83c*cq2i*exp(-min(50d0,b**2*cq2i)))/paru(2)
235 ov=exp(-b**powip)/paru(2)
238 pacc=1d0-exp(-min(50d0,pik*ov))
240 xt2fac=vnt146*
vint(148)*
xsec(96,1)/
max(1d-10,sigt(0,0,5))*
245 IF(
mstp(82).EQ.3)
THEN
246 b=sqrt(bdiv**2-
log(
pyr(0)))
247 ov=exp(-b**2)/paru(2)
248 ELSEIF(
mstp(82).EQ.4)
THEN
249 s4rndm=
pyr(0)*(s4a+s4b+s4c)
250 IF(s4rndm.LT.s4a)
THEN
251 b=sqrt(bdiv**2-
log(
pyr(0)))
252 ELSEIF(s4rndm.LT.s4a+s4b)
THEN
253 b=sqrt(bdiv**2-
log(
pyr(0))/cq2r)
255 b=sqrt(bdiv**2-
log(
pyr(0))/cq2i)
257 ov=(p83a*exp(-min(50d0,b**2))+
258 & p83b*cq2r*exp(-min(50d0,b**2*cq2r))+
259 & p83c*cq2i*exp(-min(50d0,b**2*cq2i)))/paru(2)
260 ELSEIF(
parp(83).GE.1.999d0)
THEN
261 144 b2rpw=b2rpdv-
log(
pyr(0))
262 accip=(b2rpw/b2rpdv)**rpwip
263 IF(accip.LT.
pyr(0)) goto 144
264 ov=exp(-b2rpw)/paru(2)
267 146 b2rpw=b2rpdv-2d0*
log(
pyr(0))
268 accip=(b2rpw/b2rpmx)**rpwip*exp(-0.5d0*(b2rpw-b2rpmx))
269 IF(accip.LT.
pyr(0)) goto 146
270 ov=exp(-b2rpw)/paru(2)
274 pacc=(1d0-exp(-min(50d0,pik*ov)))/(pik*ov)
276 IF(pacc.LT.
pyr(0)) goto 142
279 ELSEIF(mmul.EQ.3)
THEN
287 IF(
mstp(82).LE.0)
THEN
289 ELSEIF(
mstp(82).EQ.1)
THEN
290 xt2=xt2fac*xt2/(xt2fac-xt2*
log(
pyr(0)))
292 ELSEIF(
mstp(82).EQ.2.OR.
mint(39).EQ.1)
THEN
293 IF(xt2.LT.1d0.AND.exp(-xt2fac*xt2/(
vint(149)*(xt2+
294 &
vint(149)))).GT.
pyr(0)) xt2=1d0
296 xt2=(1d0+
vint(149))*xt2fac/(xt2fac-(1d0+
vint(149))*
log(1d0-
297 &
pyr(0)*(1d0-exp(-xt2fac/(
vint(149)*(1d0+
vint(149)))))))-
300 xt2=-xt2fac/
log(exp(-xt2fac/(xt2+
vint(149)))+
pyr(0)*
301 & (exp(-xt2fac/
vint(149))-exp(-xt2fac/(xt2+
vint(149)))))-
314 IF(
mstp(82).LE.1.AND.xt2.LT.
vint(149))
THEN
327 IF(
pyr(0).LE.coef(isub,1))
THEN
328 taut=(2d0*(1d0+sqrt(1d0-xt2))/xt2-1d0)**
pyr(0)
329 tau=xt2*(1d0+taut)**2/(4d0*taut)
331 tau=xt2*(1d0+tan(
pyr(0)*atan(sqrt(1d0/xt2-1d0)))**2)
337 IF(ryst.GT.coef(isub,8)) myst=2
338 IF(ryst.GT.coef(isub,8)+coef(isub,9)) myst=3
345 ELSEIF(mmul.EQ.4)
THEN
351 IF(iset(isub).EQ.1) xts=
vint(21)
354 IF(iset(isub).GE.3.AND.iset(isub).LE.5) xts=
vint(26)
355 rbin=
max(0.000001d0,min(0.999999d0,xts*(1d0+
vint(149))/
357 irbin=int(1d0+20d0*rbin)
358 IF(isub.EQ.96.AND.
mstp(171).EQ.0)
THEN
359 nmul(irbin)=nmul(irbin)+1
360 sigm(irbin)=sigm(irbin)+
vint(153)
364 ELSEIF(mmul.EQ.5)
THEN
369 150
IF(
mint(39).GT.0)
THEN
370 ELSEIF(
mstp(82).EQ.3)
THEN
373 vint(148)=expb2/(paru(2)*vnt147)
374 vint(139)=sqrt(b2)/bavg
375 ELSEIF(
mstp(82).EQ.4)
THEN
377 IF(rtype.LT.p83a)
THEN
379 ELSEIF(rtype.LT.p83a+p83b)
THEN
384 vint(148)=(p83a*exp(-min(50d0,b2))+
385 & p83b*cq2r*exp(-min(50d0,b2*cq2r))+
386 & p83c*cq2i*exp(-min(50d0,b2*cq2i)))/(paru(2)*vnt147)
387 vint(139)=sqrt(b2)/bavg
388 ELSEIF(
parp(83).GE.1.999d0)
THEN
391 prob1=powip/(2d0*exp(-1d0)+powip)
392 160
IF(
pyr(0).LT.prob1)
THEN
393 b2rpw=
pyr(0)**(0.5d0*powip)
399 IF(accip.LT.
pyr(0)) goto 160
400 vint(148)=exp(-b2rpw)/(paru(2)*vnt147)
401 vint(139)=b2rpw**(1d0/powip)/bavg
405 prob1=rpwip/(rpwip+2d0**rpwip*exp(-rpwip))
406 170
IF(
pyr(0).LT.prob1)
THEN
407 b2rpw=2d0*rpwip*
pyr(0)
408 accip=(b2rpw/rpwip)**rpwip*exp(rpwip-b2rpw)
410 b2rpw=2d0*(rpwip-
log(
pyr(0)))
411 accip=(0.5d0*b2rpw/rpwip)**rpwip*exp(rpwip-0.5d0*b2rpw)
413 IF(accip.lt .
pyr(0)) goto 170
414 vint(148)=exp(-b2rpw)/(paru(2)*vnt147)
415 vint(139)=b2rpw**(1d0/powip)/bavg
422 IF(
mint(39).NE.1)
THEN
423 rncor=(irbin-20d0*rbin)*nmul(irbin)
424 sigcor=(irbin-20d0*rbin)*sigm(irbin)
425 DO 180 ibin=irbin+1,20
426 rncor=rncor+nmul(ibin)
427 sigcor=sigcor+sigm(ibin)
429 sigabv=(sigcor/rncor)*
vint(149)*(1d0-xts)/(xts+
vint(149))
431 vint(150)=exp(-min(50d0,vnt146*
vint(148)*
432 & sigabv/
max(1d-10,sigt(0,0,5))))
434 IF(
mstp(86).EQ.3.OR.(
mstp(86).EQ.2.AND.isub.NE.11.AND.
435 & isub.NE.12.AND.isub.NE.13.AND.isub.NE.28.AND.isub.NE.53
436 & .AND.isub.NE.68.AND.isub.NE.95.AND.isub.NE.96))
THEN
437 IF(
vint(150).LT.
pyr(0)) goto 150
442 ELSEIF(mmul.EQ.6)
THEN
457 IF(iset(isubsv).EQ.1) nmax=
mint(84)+2
458 IF(iset(isubsv).EQ.11) nmax=
mint(84)+2+
mint(3)
460 DO 210
i=
mint(84)+1,nmax
462 IF(kcs.EQ.0) goto 210
464 IF(kcs.EQ.1.AND.(
j.EQ.2.OR.
j.EQ.4)) goto 200
465 IF(kcs.EQ.-1.AND.(
j.EQ.1.OR.
j.EQ.3)) goto 200
467 ist=mod(
k(
i,
j+3)/mstu(5),mstu(5))
469 ist=mod(
k(
i,
j+1),mstu(5))
471 IF(ist.LT.
mint(84).OR.ist.GT.
i) goto 200
472 IF(kchg(
pycomp(
k(ist,2)),2).EQ.0) goto 200
474 IF(
j.EQ.1.OR.
j.EQ.4)
THEN
486 IF(
mstp(82).LE.1)
THEN
488 IF(
mint(141).NE.0.OR.
mint(142).NE.0) sigrat=sigrat*
490 xt2fac=sigrat*
vint(149)/(1d0-
vint(149))
492 xt2fac=vnt146*
vint(148)*
xsec(isub,1)/
501 220
IF(
mstp(82).LE.1)
THEN
502 xt2=xt2fac*xt2/(xt2fac-xt2*
log(
pyr(0)))
503 IF(xt2.LT.
vint(149)) goto 270
505 IF(xt2.LE.0.01001d0*
vint(149)) goto 270
506 xt2=xt2fac*(xt2+
vint(149))/(xt2fac-(xt2+
vint(149))*
508 IF(xt2.LE.0d0) goto 270
514 IF(
pyr(0).LE.coef(isub,1))
THEN
515 taut=(2d0*(1d0+sqrt(1d0-xt2))/xt2-1d0)**
pyr(0)
516 tau=xt2*(1d0+taut)**2/(4d0*taut)
518 tau=xt2*(1d0+tan(
pyr(0)*atan(sqrt(1d0/xt2-1d0)))**2)
524 IF(ryst.GT.coef(isub,8)) myst=2
525 IF(ryst.GT.coef(isub,8)+coef(isub,9)) myst=3
532 IF(
vint(143)-x1m.LT.0.01d0.OR.
vint(144)-x2m.LT.0.01d0) goto 220
535 IF(
mint(141).NE.0.OR.
mint(142).NE.0) sigs=sigs*
vint(320)
536 IF(sigs.LT.
xsec(isub,1)*
pyr(0)) goto 220
547 pt=0.5d0*
vint(1)*sqrt(xt2)
555 & 1+int((2d0+parj(2))*
pyr(0))
565 IF(
k(
n+1,2).NE.21)
k(
n+2,2)=-
k(
n+1,2)
572 IF(rflav.LT.
parp(85).AND.nstr.GE.1)
THEN
583 IF(istr.EQ.1.OR.
dist.LT.dmin)
THEN
592 IF(
k(ist1,4)/mstu(5).EQ.ist2)
k(ist1,4)=mstu(5)*
i+
593 & mod(
k(ist1,4),mstu(5))
594 IF(mod(
k(ist1,5),mstu(5)).EQ.ist2)
k(ist1,5)=
595 & mstu(5)*(
k(ist1,5)/mstu(5))+
i
598 IF(
k(ist2,5)/mstu(5).EQ.ist1)
k(ist2,5)=mstu(5)*
i+
599 & mod(
k(ist2,5),mstu(5))
600 IF(mod(
k(ist2,4),mstu(5)).EQ.ist1)
k(ist2,4)=
601 & mstu(5)*(
k(ist2,4)/mstu(5))+
i
609 ELSEIF(
k(
n+1,2).EQ.21)
THEN
610 k(
n+1,4)=mstu(5)*(
n+2)
611 k(
n+1,5)=mstu(5)*(
n+2)
612 k(
n+2,4)=mstu(5)*(
n+1)
613 k(
n+2,5)=mstu(5)*(
n+1)
622 k(
n+1,4)=mstu(5)*(
n+2)
623 k(
n+2,5)=mstu(5)*(
n+1)
636 IF(
n.GT.mstu(4)-mstu(32)-10)
THEN
637 CALL
pyerrm(11,
'(PYMULT:) no more memory left in PYJETS')
648 IF(
mint(31).LT.240) goto 220
657 5000
FORMAT(/1
x,
'****** PYMULT: initialization of multiple inter',
658 &
'actions for MSTP(82) =',
i2,
' ******')
659 5100
FORMAT(8
x,
'pT0 =',f5.2,
' GeV gives sigma(parton-parton) =',1
p,
660 &d9.2,
' mb: rejected')
661 5200
FORMAT(8
x,
'pT0 =',f5.2,
' GeV gives sigma(parton-parton) =',1
p,
662 &d9.2,
' mb: accepted')