File indexing completed on 2024-04-06 12:13:22
0001
0002
0003
0004
0005
0006 subroutine hbtout(nnew,nt,ntmax)
0007
0008 PARAMETER (MAXSTR=150001,MAXR=1)
0009
0010 PARAMETER (oneminus=0.99999,oneplus=1.00001)
0011 dimension lastkp(MAXSTR), newkp(MAXSTR),xnew(3)
0012 common /para7/ ioscar,nsmbbbar,nsmmeson
0013
0014 COMMON/hbt/lblast(MAXSTR),xlast(4,MAXSTR),plast(4,MAXSTR),nlast
0015
0016 common/input1/ MASSPR,MASSTA,ISEED,IAVOID,DT
0017
0018 COMMON /AA/ R(3,MAXSTR)
0019
0020 COMMON /BB/ P(3,MAXSTR)
0021
0022 COMMON /CC/ E(MAXSTR)
0023
0024 COMMON /EE/ ID(MAXSTR),LB(MAXSTR)
0025
0026 common /lastt/itimeh,bimp
0027
0028 COMMON/tdecay/tfdcy(MAXSTR),tfdpi(MAXSTR,MAXR),tft(MAXSTR)
0029
0030 COMMON /AREVT/ IAEVT, IARUN, MISS
0031
0032 common/snn/efrm,npart1,npart2,epsiPz,epsiPt,PZPROJ,PZTARG
0033
0034 COMMON/HJGLBR/NELT,NINTHJ,NELP,NINP
0035
0036 COMMON/FTMAX/ftsv(MAXSTR),ftsvt(MAXSTR, MAXR)
0037 COMMON /dpert/dpertt(MAXSTR,MAXR),dpertp(MAXSTR),dplast(MAXSTR),
0038 1 dpdcy(MAXSTR),dpdpi(MAXSTR,MAXR),dpt(MAXSTR, MAXR),
0039 2 dpp1(MAXSTR,MAXR),dppion(MAXSTR,MAXR)
0040
0041 COMMON/HPARNT/HIPR1(100),IHPR2(50),HINT1(100),IHNT2(50)
0042 EXTERNAL IARFLV, INVFLV
0043 common /para8/ idpert,npertd,idxsec
0044
0045 common /phiHJ/iphirp,phiRP
0046 SAVE
0047
0048 do 1001 i=1,max0(nlast,nnew)
0049 lastkp(i)=0
0050 1001 continue
0051 do 1002 i=1,nnew
0052 newkp(i)=0
0053 1002 continue
0054
0055
0056 do 100 ip=1,nnew
0057 do 1004 iplast=1,nlast
0058 if(p(1,ip).eq.plast(1,iplast).and.
0059 1 p(2,ip).eq.plast(2,iplast).and.
0060 2 p(3,ip).eq.plast(3,iplast).and.
0061 3 e(ip).eq.plast(4,iplast).and.
0062 4 lb(ip).eq.lblast(iplast).and.
0063 5 dpertp(ip).eq.dplast(iplast).and.lastkp(iplast).eq.0) then
0064
0065
0066 deltat=nt*dt-xlast(4,iplast)
0067 ene=sqrt(plast(1,iplast)**2+plast(2,iplast)**2
0068 1 +plast(3,iplast)**2+plast(4,iplast)**2)
0069
0070 do 1003 ii=1,3
0071 xnew(ii)=xlast(ii,iplast)+plast(ii,iplast)/ene*deltat
0072 1003 continue
0073 dr=sqrt((r(1,ip)-xnew(1))**2+(r(2,ip)-xnew(2))**2
0074 1 +(r(3,ip)-xnew(3))**2)
0075
0076
0077
0078 if(dr.le.0.01) then
0079 lastkp(iplast)=1
0080 newkp(ip)=1
0081
0082
0083
0084
0085
0086 if(nt.eq.ntmax.and.ftsv(ip).gt.((ntmax-1)*dt))
0087 1 xlast(4,iplast)=ftsv(ip)
0088 goto 100
0089 endif
0090 endif
0091 1004 continue
0092 100 continue
0093
0094
0095 do 150 ip=1,nnew
0096 if(newkp(ip).eq.0) then
0097 do 1005 iplast=1,nnew
0098 if(lastkp(iplast).eq.0) then
0099
0100
0101
0102
0103
0104
0105
0106
0107
0108 xlast(1,iplast)=r(1,ip)
0109 xlast(2,iplast)=r(2,ip)
0110 xlast(3,iplast)=r(3,ip)
0111 xlast(4,iplast)=nt*dt
0112
0113 if(nt.eq.ntmax) then
0114
0115
0116 if(tfdcy(ip).gt.(ntmax*dt+0.001)) then
0117 xlast(4,iplast)=tfdcy(ip)
0118
0119
0120 elseif(ftsv(ip).gt.((ntmax-1)*dt)) then
0121 xlast(4,iplast)=ftsv(ip)
0122 endif
0123 endif
0124 plast(1,iplast)=p(1,ip)
0125 plast(2,iplast)=p(2,ip)
0126 plast(3,iplast)=p(3,ip)
0127 plast(4,iplast)=e(ip)
0128 lblast(iplast)=lb(ip)
0129 lastkp(iplast)=1
0130
0131 dplast(iplast)=dpertp(ip)
0132 goto 150
0133 endif
0134 1005 continue
0135 endif
0136 150 continue
0137
0138
0139
0140 if(nnew.lt.nlast) then
0141 do 170 iplast=1,nlast
0142 if(lastkp(iplast).eq.0) then
0143 do 1006 ip2=iplast+1,nlast
0144 if(lastkp(ip2).eq.1) then
0145 xlast(1,iplast)=xlast(1,ip2)
0146 xlast(2,iplast)=xlast(2,ip2)
0147 xlast(3,iplast)=xlast(3,ip2)
0148 xlast(4,iplast)=xlast(4,ip2)
0149 plast(1,iplast)=plast(1,ip2)
0150 plast(2,iplast)=plast(2,ip2)
0151 plast(3,iplast)=plast(3,ip2)
0152 plast(4,iplast)=plast(4,ip2)
0153 lblast(iplast)=lblast(ip2)
0154 lastkp(iplast)=1
0155
0156 dplast(iplast)=dplast(ip2)
0157 goto 170
0158 endif
0159 1006 continue
0160 endif
0161 170 continue
0162 endif
0163 nlast=nnew
0164
0165
0166
0167
0168
0169
0170
0171
0172 if(nt.eq.ntmax) then
0173
0174 ndpert=0
0175 do ip=1,nlast
0176 if(dplast(ip).gt.oneminus.and.dplast(ip).lt.oneplus) then
0177 else
0178 ndpert=ndpert+1
0179 endif
0180 enddo
0181
0182
0183
0184
0185
0186
0187 write(16,191) IAEVT,IARUN,nlast-ndpert,bimp,npart1,npart2,
0188 1 NELP,NINP,NELT,NINTHJ,phiRP
0189
0190 if(idpert.eq.1.or.idpert.eq.2)
0191 1 write(90,190) IAEVT,IARUN,ndpert,bimp,npart1,npart2,
0192 2 NELP,NINP,NELT,NINTHJ
0193 do 1007 ip=1,nlast
0194
0195
0196
0197
0198
0199
0200
0201
0202
0203
0204
0205 if(abs(plast(1,ip)).le.epsiPt.and.abs(plast(2,ip)).le.epsiPt
0206 1 .and.(plast(3,ip).gt.amax1(0.,PZPROJ-epsiPz)
0207 2 .or.plast(3,ip).lt.(-PZTARG+epsiPz))
0208 3 .and.(lblast(ip).eq.1.or.lblast(ip).eq.2)) then
0209
0210
0211
0212
0213
0214
0215 if(dplast(ip).gt.oneminus.and.dplast(ip).lt.oneplus) then
0216 write(16,200) INVFLV(lblast(ip)), plast(1,ip),
0217 1 plast(2,ip),plast(3,ip),plast(4,ip),
0218 2 xlast(1,ip),xlast(2,ip),xlast(3,ip),
0219 3 xlast(4,ip)
0220
0221 else
0222 if(idpert.eq.1.or.idpert.eq.2) then
0223 write(90,250) INVFLV(lblast(ip)), plast(1,ip),
0224 1 plast(2,ip),plast(3,ip),
0225 2 xlast(1,ip),xlast(2,ip),xlast(3,ip),
0226 3 xlast(4,ip)
0227 else
0228 write(99,*) 'Unexpected perturbative particles'
0229 endif
0230 endif
0231 elseif(amax1(abs(xlast(1,ip)),abs(xlast(2,ip)),
0232 1 abs(xlast(3,ip)),abs(xlast(4,ip))).lt.9999) then
0233 if(dplast(ip).gt.oneminus.and.dplast(ip).lt.oneplus) then
0234 write(16,200) INVFLV(lblast(ip)), plast(1,ip),
0235 1 plast(2,ip),plast(3,ip),plast(4,ip),
0236 2 xlast(1,ip),xlast(2,ip),xlast(3,ip),xlast(4,ip)
0237 else
0238 if(idpert.eq.1.or.idpert.eq.2) then
0239 write(90,250) INVFLV(lblast(ip)),plast(1,ip),
0240 1 plast(2,ip),plast(3,ip),
0241 2 xlast(1,ip),xlast(2,ip),xlast(3,ip),xlast(4,ip),
0242 3 dplast(ip)
0243 else
0244 write(99,*) 'Unexpected perturbative particles'
0245 endif
0246 endif
0247 else
0248
0249 if(dplast(ip).gt.oneminus.and.dplast(ip).lt.oneplus) then
0250 write(16,201) INVFLV(lblast(ip)), plast(1,ip),
0251 1 plast(2,ip),plast(3,ip),plast(4,ip),
0252 2 xlast(1,ip),xlast(2,ip),xlast(3,ip),xlast(4,ip)
0253 else
0254 if(idpert.eq.1.or.idpert.eq.2) then
0255 write(90,251) INVFLV(lblast(ip)), plast(1,ip),
0256 1 plast(2,ip),plast(3,ip),
0257 2 xlast(1,ip),xlast(2,ip),xlast(3,ip),xlast(4,ip),
0258 3 dplast(ip)
0259 else
0260 write(99,*) 'Unexpected perturbative particles'
0261 endif
0262 endif
0263 endif
0264 1007 continue
0265 if(ioscar.eq.1) call hoscar
0266 endif
0267 190 format(3(i7),f10.4,5x,6(i4))
0268 191 format(3(i7),f10.4,5x,6(i4),5x,f7.4)
0269
0270 200 format(I6,2(1x,f8.3),1x,f11.4,1x,f6.3,4(1x,f8.2))
0271 201 format(I6,2(1x,f8.3),1x,f11.4,1x,f6.3,4(1x,e8.2))
0272 250 format(I5,2(1x,f8.3),1x,f10.3,2(1x,f7.1),1x,f8.2,1x,f7.2,1x,e10.4)
0273 251 format(I5,2(1x,f8.3),1x,f10.3,4(1x,e8.2),1x,e10.4)
0274
0275 return
0276 end
0277
0278
0279 SUBROUTINE decomp(px0,py0,pz0,xm0,i,itq1)
0280
0281 IMPLICIT DOUBLE PRECISION(D)
0282 DOUBLE PRECISION enenew, pxnew, pynew, pznew
0283 DOUBLE PRECISION de0, beta2, gam
0284 common /lor/ enenew, pxnew, pynew, pznew
0285
0286 COMMON/HPARNT/HIPR1(100),IHPR2(50),HINT1(100),IHNT2(50)
0287
0288 common /decom/ptwo(2,5)
0289
0290 COMMON/RNDF77/NSEED
0291
0292 COMMON/HMAIN1/EATT,JATT,NATT,NT,NP,N0,N01,N10,N11
0293 common/embed/iembed,nsembd,pxqembd,pyqembd,xembd,yembd,
0294 1 psembd,tmaxembd,phidecomp
0295 SAVE
0296
0297 dcth=dble(RANART(NSEED))*2.d0-1.d0
0298 dPHI=dble(RANART(NSEED)*HIPR1(40))*2.d0
0299
0300 if(iembed.ge.1.and.iembed.le.4) then
0301
0302
0303
0304
0305 if(i.eq.(natt-2*nsembd).or.i.eq.(natt-2*nsembd-1)) then
0306 dcth=0.d0
0307 dphi=dble(phidecomp)
0308 endif
0309 endif
0310
0311 ds=dble(xm0)**2
0312 dpcm=dsqrt((ds-dble(ptwo(1,5)+ptwo(2,5))**2)
0313 1 *(ds-dble(ptwo(1,5)-ptwo(2,5))**2)/ds/4d0)
0314 dpz=dpcm*dcth
0315 dpx=dpcm*dsqrt(1.d0-dcth**2)*dcos(dphi)
0316 dpy=dpcm*dsqrt(1.d0-dcth**2)*dsin(dphi)
0317 de1=dsqrt(dble(ptwo(1,5))**2+dpcm**2)
0318 de2=dsqrt(dble(ptwo(2,5))**2+dpcm**2)
0319
0320 de0=dsqrt(dble(px0)**2+dble(py0)**2+dble(pz0)**2+dble(xm0)**2)
0321 dbex=dble(px0)/de0
0322 dbey=dble(py0)/de0
0323 dbez=dble(pz0)/de0
0324
0325 beta2 = dbex ** 2 + dbey ** 2 + dbez ** 2
0326 gam = 1.d0 / dsqrt(1.d0 - beta2)
0327 if(beta2.ge.0.9999999999999d0) then
0328 write(6,*) '1',dbex,dbey,dbez,beta2,gam
0329 endif
0330
0331 call lorenz(de1,dpx,dpy,dpz,-dbex,-dbey,-dbez)
0332 ptwo(1,1)=sngl(pxnew)
0333 ptwo(1,2)=sngl(pynew)
0334 ptwo(1,3)=sngl(pznew)
0335 ptwo(1,4)=sngl(enenew)
0336 call lorenz(de2,-dpx,-dpy,-dpz,-dbex,-dbey,-dbez)
0337 ptwo(2,1)=sngl(pxnew)
0338 ptwo(2,2)=sngl(pynew)
0339 ptwo(2,3)=sngl(pznew)
0340 ptwo(2,4)=sngl(enenew)
0341
0342 RETURN
0343 END
0344
0345
0346 SUBROUTINE HTOP
0347
0348 PARAMETER (MAXSTR=150001)
0349 PARAMETER (MAXPTN=400001)
0350 PARAMETER (MAXIDL=4001)
0351 DOUBLE PRECISION GX0, GY0, GZ0, FT0, PX0, PY0, PZ0, E0, XMASS0
0352 DOUBLE PRECISION PXSGS,PYSGS,PZSGS,PESGS,PMSGS,
0353 1 GXSGS,GYSGS,GZSGS,FTSGS
0354 dimension it(4)
0355 COMMON/HMAIN2/KATT(MAXSTR,4),PATT(MAXSTR,4)
0356
0357 COMMON/HMAIN1/EATT,JATT,NATT,NT,NP,N0,N01,N10,N11
0358
0359 COMMON /PARA1/ MUL
0360
0361 COMMON /prec1/GX0(MAXPTN),GY0(MAXPTN),GZ0(MAXPTN),FT0(MAXPTN),
0362 & PX0(MAXPTN), PY0(MAXPTN), PZ0(MAXPTN), E0(MAXPTN),
0363 & XMASS0(MAXPTN), ITYP0(MAXPTN)
0364
0365 COMMON /ilist7/ LSTRG0(MAXPTN), LPART0(MAXPTN)
0366
0367 COMMON /ARPRC/ ITYPAR(MAXSTR),
0368 & GXAR(MAXSTR), GYAR(MAXSTR), GZAR(MAXSTR), FTAR(MAXSTR),
0369 & PXAR(MAXSTR), PYAR(MAXSTR), PZAR(MAXSTR), PEAR(MAXSTR),
0370 & XMAR(MAXSTR)
0371
0372 common /decom/ptwo(2,5)
0373
0374 COMMON/RNDF77/NSEED
0375
0376 COMMON /NOPREC/ NNOZPC, ITYPN(MAXIDL),
0377 & GXN(MAXIDL), GYN(MAXIDL), GZN(MAXIDL), FTN(MAXIDL),
0378 & PXN(MAXIDL), PYN(MAXIDL), PZN(MAXIDL), EEN(MAXIDL),
0379 & XMN(MAXIDL)
0380
0381 COMMON/HPARNT/HIPR1(100),IHPR2(50),HINT1(100),IHNT2(50)
0382
0383
0384
0385 COMMON/SOFT/PXSGS(MAXSTR,3),PYSGS(MAXSTR,3),PZSGS(MAXSTR,3),
0386 & PESGS(MAXSTR,3),PMSGS(MAXSTR,3),GXSGS(MAXSTR,3),
0387 & GYSGS(MAXSTR,3),GZSGS(MAXSTR,3),FTSGS(MAXSTR,3),
0388 & K1SGS(MAXSTR,3),K2SGS(MAXSTR,3),NJSGS(MAXSTR)
0389
0390 common/anim/nevent,isoft,isflag,izpc
0391
0392 DOUBLE PRECISION vxp0,vyp0,vzp0
0393 common /precpa/ vxp0(MAXPTN), vyp0(MAXPTN), vzp0(MAXPTN)
0394
0395 common /para7/ ioscar,nsmbbbar,nsmmeson
0396 COMMON /AREVT/ IAEVT, IARUN, MISS
0397 common/snn/efrm,npart1,npart2,epsiPz,epsiPt,PZPROJ,PZTARG
0398 SAVE
0399
0400 npar=0
0401 nnozpc=0
0402
0403 if((isoft.eq.4.or.isoft.eq.5).and.(ioscar.eq.2.or.ioscar.eq.3))
0404 1 then
0405 nsmbbbar=0
0406 nsmmeson=0
0407 do i=1,natt
0408 id=ITYPAR(i)
0409 idabs=iabs(id)
0410 i2=MOD(idabs/10,10)
0411
0412
0413
0414
0415 if(abs(PXAR(i)).le.epsiPt.and.abs(PYAR(i)).le.epsiPt
0416 1 .and.(PZAR(i).gt.amax1(0.,PZPROJ-epsiPz)
0417 2 .or.PZAR(i).lt.(-PZTARG+epsiPz))
0418 3 .and.(id.eq.2112.or.id.eq.2212)) then
0419
0420 elseif(idabs.gt.1000.and.i2.ne.0) then
0421
0422 nsmbbbar=nsmbbbar+1
0423 elseif((idabs.gt.100.and.idabs.lt.1000)
0424 1 .or.idabs.gt.10000) then
0425
0426 nsmmeson=nsmmeson+1
0427 endif
0428 enddo
0429
0430
0431 if(ioscar.eq.2.or.ioscar.eq.3) then
0432 write(92,*) iaevt,miss,3*nsmbbbar+2*nsmmeson,
0433 1 nsmbbbar,nsmmeson,natt,natt-nsmbbbar-nsmmeson
0434 endif
0435
0436
0437
0438
0439
0440
0441
0442
0443 endif
0444
0445 do 100 i=1,natt
0446 id=ITYPAR(i)
0447 idabs=iabs(id)
0448 i4=MOD(idabs/1000,10)
0449 i3=MOD(idabs/100,10)
0450 i2=MOD(idabs/10,10)
0451 i1=MOD(idabs,10)
0452 rnum=RANART(NSEED)
0453 ftime=0.197*PEAR(i)/(PXAR(i)**2+PYAR(i)**2+XMAR(i)**2)
0454 inozpc=0
0455 it(1)=0
0456 it(2)=0
0457 it(3)=0
0458 it(4)=0
0459
0460
0461
0462
0463 if(abs(PXAR(i)).le.epsiPt.and.abs(PYAR(i)).le.epsiPt
0464 1 .and.(PZAR(i).gt.amax1(0.,PZPROJ-epsiPz)
0465 2 .or.PZAR(i).lt.(-PZTARG+epsiPz))
0466 3 .and.(id.eq.2112.or.id.eq.2212)) then
0467
0468 inozpc=1
0469 elseif(idabs.gt.1000.and.i2.ne.0) then
0470
0471 if(((i4.eq.1.or.i4.eq.2).and.i4.eq.i3)
0472 1 .or.(i4.eq.3.and.i3.eq.3)) then
0473 if(i1.eq.2) then
0474 if(rnum.le.(1./2.)) then
0475 it(1)=i4
0476 it(2)=i3*1000+i2*100+1
0477 elseif(rnum.le.(2./3.)) then
0478 it(1)=i4
0479 it(2)=i3*1000+i2*100+3
0480 else
0481 it(1)=i2
0482 it(2)=i4*1000+i3*100+3
0483 endif
0484 elseif(i1.eq.4) then
0485 if(rnum.le.(2./3.)) then
0486 it(1)=i4
0487 it(2)=i3*1000+i2*100+3
0488 else
0489 it(1)=i2
0490 it(2)=i4*1000+i3*100+3
0491 endif
0492 endif
0493 elseif(i4.eq.1.or.i4.eq.2) then
0494 if(i1.eq.2) then
0495 if(rnum.le.(1./2.)) then
0496 it(1)=i2
0497 it(2)=i4*1000+i3*100+1
0498 elseif(rnum.le.(2./3.)) then
0499 it(1)=i2
0500 it(2)=i4*1000+i3*100+3
0501 else
0502 it(1)=i4
0503 it(2)=i3*1000+i2*100+3
0504 endif
0505 elseif(i1.eq.4) then
0506 if(rnum.le.(2./3.)) then
0507 it(1)=i2
0508 it(2)=i4*1000+i3*100+3
0509 else
0510 it(1)=i4
0511 it(2)=i3*1000+i2*100+3
0512 endif
0513 endif
0514 elseif(i4.ge.3) then
0515 it(1)=i4
0516 if(i3.lt.i2) then
0517 it(2)=i2*1000+i3*100+1
0518 else
0519 it(2)=i3*1000+i2*100+3
0520 endif
0521 endif
0522
0523 if(id.lt.0) then
0524 it(1)=-it(1)
0525 it(2)=-it(2)
0526 endif
0527
0528 if(isoft.eq.4.or.isoft.eq.5) then
0529 it(3)=MOD(it(2)/1000,10)
0530 it(4)=MOD(it(2)/100,10)
0531 endif
0532
0533 elseif((idabs.gt.100.and.idabs.lt.1000)
0534 1 .or.idabs.gt.10000) then
0535
0536 if(i3.eq.i2) then
0537 if(i3.eq.1.or.i3.eq.2) then
0538 if(rnum.le.0.5) then
0539 it(1)=1
0540 it(2)=-1
0541 else
0542 it(1)=2
0543 it(2)=-2
0544 endif
0545 else
0546 it(1)=i3
0547 it(2)=-i3
0548 endif
0549 else
0550 if((isign(1,id)*(-1)**i3).eq.1) then
0551 it(1)=i3
0552 it(2)=-i2
0553 else
0554 it(1)=i2
0555 it(2)=-i3
0556 endif
0557 endif
0558 else
0559
0560 inozpc=1
0561 endif
0562
0563 if(inozpc.eq.1) then
0564 NJSGS(i)=0
0565 nnozpc=nnozpc+1
0566 itypn(nnozpc)=ITYPAR(i)
0567 pxn(nnozpc)=PXAR(i)
0568 pyn(nnozpc)=PYAR(i)
0569 pzn(nnozpc)=PZAR(i)
0570 een(nnozpc)=PEAR(i)
0571 xmn(nnozpc)=XMAR(i)
0572 gxn(nnozpc)=GXAR(i)
0573 gyn(nnozpc)=GYAR(i)
0574 gzn(nnozpc)=GZAR(i)
0575 ftn(nnozpc)=FTAR(i)
0576 else
0577 NJSGS(i)=2
0578 ptwo(1,5)=ulmass(it(1))
0579 ptwo(2,5)=ulmass(it(2))
0580 call decomp(patt(i,1),patt(i,2),patt(i,3),XMAR(i),i,it(1))
0581 ipamax=2
0582 if((isoft.eq.4.or.isoft.eq.5)
0583 1 .and.iabs(it(2)).gt.1000) ipamax=1
0584 do 1001 ipar=1,ipamax
0585 npar=npar+1
0586 ityp0(npar)=it(ipar)
0587 px0(npar)=dble(ptwo(ipar,1))
0588 py0(npar)=dble(ptwo(ipar,2))
0589 pz0(npar)=dble(ptwo(ipar,3))
0590 e0(npar)=dble(ptwo(ipar,4))
0591 xmass0(npar)=dble(ptwo(ipar,5))
0592 gx0(npar)=dble(GXAR(i))
0593 gy0(npar)=dble(GYAR(i))
0594 gz0(npar)=dble(GZAR(i))
0595 ft0(npar)=dble(ftime)
0596 lstrg0(npar)=i
0597 lpart0(npar)=ipar
0598 vxp0(npar)=dble(patt(i,1)/patt(i,4))
0599 vyp0(npar)=dble(patt(i,2)/patt(i,4))
0600 vzp0(npar)=dble(patt(i,3)/patt(i,4))
0601 1001 continue
0602
0603
0604
0605 if((isoft.eq.4.or.isoft.eq.5)
0606 1 .and.iabs(it(2)).gt.1000) then
0607 NJSGS(i)=3
0608 xmdq=ptwo(2,5)
0609 ptwo(1,5)=ulmass(it(3))
0610 ptwo(2,5)=ulmass(it(4))
0611
0612
0613 ptwox=ptwo(2,1)
0614 ptwoy=ptwo(2,2)
0615 ptwoz=ptwo(2,3)
0616 call decomp(ptwox,ptwoy,ptwoz,xmdq,i,it(1))
0617
0618 do 1002 ipar=1,2
0619 npar=npar+1
0620 ityp0(npar)=it(ipar+2)
0621 px0(npar)=dble(ptwo(ipar,1))
0622 py0(npar)=dble(ptwo(ipar,2))
0623 pz0(npar)=dble(ptwo(ipar,3))
0624 e0(npar)=dble(ptwo(ipar,4))
0625 xmass0(npar)=dble(ptwo(ipar,5))
0626 gx0(npar)=dble(GXAR(i))
0627 gy0(npar)=dble(GYAR(i))
0628 gz0(npar)=dble(GZAR(i))
0629 ft0(npar)=dble(ftime)
0630 lstrg0(npar)=i
0631 lpart0(npar)=ipar+1
0632 vxp0(npar)=dble(patt(i,1)/patt(i,4))
0633 vyp0(npar)=dble(patt(i,2)/patt(i,4))
0634 vzp0(npar)=dble(patt(i,3)/patt(i,4))
0635 1002 continue
0636 endif
0637
0638 endif
0639 100 continue
0640 MUL=NPAR
0641
0642
0643 if((isoft.eq.4.or.isoft.eq.5).and.(ioscar.eq.2.or.ioscar.eq.3))
0644 1 then
0645 if((natt-nsmbbbar-nsmmeson).ne.nnozpc)
0646 1 write(92,*) 'Problem with the total # of initial particles
0647 2 (gamma,e,muon,...) not entering ZPC'
0648 if((3*nsmbbbar+2*nsmmeson).ne.npar)
0649 1 write(92,*) 'Problem with the total # of initial partons
0650 2 after string melting'
0651 endif
0652
0653 RETURN
0654 END
0655
0656
0657 SUBROUTINE PTOH
0658
0659 PARAMETER (MAXSTR=150001)
0660 DOUBLE PRECISION gxp,gyp,gzp,ftp,pxp,pyp,pzp,pep,pmp
0661 DOUBLE PRECISION gxp0,gyp0,gzp0,ft0fom,drlocl
0662 DOUBLE PRECISION enenew, pxnew, pynew, pznew, beta2, gam
0663 DOUBLE PRECISION ftavg0,gxavg0,gyavg0,gzavg0,bex,bey,bez
0664 DOUBLE PRECISION PXSGS,PYSGS,PZSGS,PESGS,PMSGS,
0665 1 GXSGS,GYSGS,GZSGS,FTSGS
0666 DOUBLE PRECISION xmdiag,px1,py1,pz1,e1,px2,py2,pz2,e2,
0667 1 px3,py3,pz3,e3,xmpair,etot
0668
0669 DOUBLE PRECISION p1,p2,p3
0670 common /loclco/gxp(3),gyp(3),gzp(3),ftp(3),
0671 1 pxp(3),pyp(3),pzp(3),pep(3),pmp(3)
0672
0673 COMMON/HMAIN1/EATT,JATT,NATT,NT,NP,N0,N01,N10,N11
0674
0675 COMMON/HMAIN2/KATT(MAXSTR,4),PATT(MAXSTR,4)
0676
0677 COMMON/HJJET2/NSG,NJSG(MAXSTR),IASG(MAXSTR,3),K1SG(MAXSTR,100),
0678 & K2SG(MAXSTR,100),PXSG(MAXSTR,100),PYSG(MAXSTR,100),
0679 & PZSG(MAXSTR,100),PESG(MAXSTR,100),PMSG(MAXSTR,100)
0680
0681 COMMON /ARPRNT/ ARPAR1(100), IAPAR2(50), ARINT1(100), IAINT2(50)
0682
0683 COMMON /ARPRC/ ITYPAR(MAXSTR),
0684 & GXAR(MAXSTR), GYAR(MAXSTR), GZAR(MAXSTR), FTAR(MAXSTR),
0685 & PXAR(MAXSTR), PYAR(MAXSTR), PZAR(MAXSTR), PEAR(MAXSTR),
0686 & XMAR(MAXSTR)
0687
0688 COMMON/SOFT/PXSGS(MAXSTR,3),PYSGS(MAXSTR,3),PZSGS(MAXSTR,3),
0689 & PESGS(MAXSTR,3),PMSGS(MAXSTR,3),GXSGS(MAXSTR,3),
0690 & GYSGS(MAXSTR,3),GZSGS(MAXSTR,3),FTSGS(MAXSTR,3),
0691 & K1SGS(MAXSTR,3),K2SGS(MAXSTR,3),NJSGS(MAXSTR)
0692
0693 COMMON/RNDF77/NSEED
0694
0695 common/anim/nevent,isoft,isflag,izpc
0696
0697 common /prtn23/ gxp0(3),gyp0(3),gzp0(3),ft0fom
0698
0699 common /nzpc/nattzp
0700
0701 common /lor/ enenew, pxnew, pynew, pznew
0702
0703 COMMON/LUDAT1/MSTU(200),PARU(200),MSTJ(200),PARJ(200)
0704
0705
0706 common /lastt/itimeh,bimp
0707 COMMON/HJGLBR/NELT,NINTHJ,NELP,NINP
0708 COMMON /AREVT/ IAEVT, IARUN, MISS
0709 common /para7/ ioscar,nsmbbbar,nsmmeson
0710
0711 common/input1/ MASSPR,MASSTA,ISEED,IAVOID,DT
0712
0713 dimension xmdiag(MAXSTR),indx(MAXSTR),ndiag(MAXSTR)
0714 SAVE
0715
0716 call coales
0717
0718 mstj24=MSTJ(24)
0719 MSTJ(24)=0
0720 nuudd=0
0721 npich=0
0722 nrhoch=0
0723 ppi0=1.
0724 prho0=0.
0725
0726 DO 1001 ISG = 1, NSG
0727 if(NJSGS(ISG).ne.0) then
0728 NATT=NATT+1
0729 K1=K2SGS(ISG,1)
0730 k1abs=iabs(k1)
0731 PX1=PXSGS(ISG,1)
0732 PY1=PYSGS(ISG,1)
0733 PZ1=PZSGS(ISG,1)
0734 K2=K2SGS(ISG,2)
0735 k2abs=iabs(k2)
0736 PX2=PXSGS(ISG,2)
0737 PY2=PYSGS(ISG,2)
0738 PZ2=PZSGS(ISG,2)
0739
0740
0741 e1=PESGS(ISG,1)
0742 e2=PESGS(ISG,2)
0743 xmpair=dsqrt((e1+e2)**2-(px1+px2)**2-(py1+py2)**2
0744 1 -(pz1+pz2)**2)
0745 ibs=2
0746 imspin=0
0747 if(k1.eq.-k2.and.iabs(k1).le.2.
0748 1 and.NJSGS(ISG).eq.2) then
0749 nuudd=nuudd+1
0750 xmdiag(nuudd)=xmpair
0751 ndiag(nuudd)=natt
0752 endif
0753 K3=0
0754 if((isoft.eq.4.or.isoft.eq.5).and.NJSGS(ISG).eq.3) then
0755 K3=K2SGS(ISG,3)
0756 k3abs=iabs(k3)
0757 PX3=PXSGS(ISG,3)
0758 PY3=PYSGS(ISG,3)
0759 PZ3=PZSGS(ISG,3)
0760 e3=PESGS(ISG,3)
0761 xmpair=dsqrt((e1+e2+e3)**2-(px1+px2+px3)**2
0762 1 -(py1+py2+py3)**2-(pz1+pz2+pz3)**2)
0763 endif
0764
0765 if(isoft.eq.3.and.
0766 1 (k1abs.gt.1000.or.k2abs.gt.1000)) then
0767 if(k1abs.gt.1000) then
0768 kdq=k1abs
0769 kk=k2abs
0770 else
0771 kdq=k2abs
0772 kk=k1abs
0773 endif
0774 ki=MOD(kdq/1000,10)
0775 kj=MOD(kdq/100,10)
0776 if(MOD(kdq,10).eq.1) then
0777 idqspn=0
0778 else
0779 idqspn=1
0780 endif
0781
0782 if(kk.gt.ki) then
0783 ktemp=kk
0784 kk=kj
0785 kj=ki
0786 ki=ktemp
0787 elseif(kk.gt.kj) then
0788 ktemp=kk
0789 kk=kj
0790 kj=ktemp
0791 endif
0792
0793 if(ki.ne.kj.and.ki.ne.kk.and.kj.ne.kk) then
0794 if(idqspn.eq.0) then
0795 kf=1000*ki+100*kk+10*kj+ibs
0796 else
0797 kf=1000*ki+100*kj+10*kk+ibs
0798 endif
0799 elseif(ki.eq.kj.and.ki.eq.kk) then
0800
0801 kf=1000*ki+100*kj+10*kk+4
0802 else
0803 kf=1000*ki+100*kj+10*kk+ibs
0804 endif
0805
0806
0807
0808
0809 if(kf.eq.2112.or.kf.eq.2212) then
0810 if(abs(sngl(xmpair)-ULMASS(kf)).gt.
0811 1 abs(sngl(xmpair)-ULMASS(kf+2))) kf=kf+2
0812 endif
0813 if(k1.lt.0) kf=-kf
0814
0815 elseif((isoft.eq.4.or.isoft.eq.5).and.NJSGS(ISG).eq.3)
0816 1 then
0817 if(k1abs.gt.k2abs) then
0818 ki=k1abs
0819 kk=k2abs
0820 else
0821 ki=k2abs
0822 kk=k1abs
0823 endif
0824 if(k3abs.gt.ki) then
0825 kj=ki
0826 ki=k3abs
0827 elseif(k3abs.lt.kk) then
0828 kj=kk
0829 kk=k3abs
0830 else
0831 kj=k3abs
0832 endif
0833
0834 if(ki.eq.kj.and.ki.eq.kk) then
0835
0836 ibs=4
0837 kf=1000*ki+100*kj+10*kk+ibs
0838 elseif(ki.ne.kj.and.ki.ne.kk.and.kj.ne.kk) then
0839
0840
0841 ibs=2
0842 kf1=1000*ki+100*kj+10*kk+ibs
0843 kf2=1000*ki+100*kk+10*kj+ibs
0844 kf=kf1
0845 if(abs(sngl(xmpair)-ULMASS(kf1)).gt.
0846 1 abs(sngl(xmpair)-ULMASS(kf2))) kf=kf2
0847 else
0848 ibs=2
0849 kf=1000*ki+100*kj+10*kk+ibs
0850
0851 if(kf.eq.2112.or.kf.eq.2212) then
0852 if(abs(sngl(xmpair)-ULMASS(kf)).gt.
0853 1 abs(sngl(xmpair)-ULMASS(kf+2))) kf=kf+2
0854 endif
0855 endif
0856 if(k1.lt.0) kf=-kf
0857
0858 else
0859 if(k1abs.eq.k2abs) then
0860 if(k1abs.le.2) then
0861
0862 kf=0
0863 elseif(k1abs.le.3) then
0864
0865 kf=333
0866 else
0867 kf=100*k1abs+10*k1abs+2*imspin+1
0868 endif
0869 else
0870 if(k1abs.gt.k2abs) then
0871 kmax=k1abs
0872 kmin=k2abs
0873 elseif(k1abs.lt.k2abs) then
0874 kmax=k2abs
0875 kmin=k1abs
0876 endif
0877 kf=(100*kmax+10*kmin+2*imspin+1)
0878 1 *isign(1,k1+k2)*(-1)**kmax
0879
0880 if(MOD(iabs(kf),10).eq.1) then
0881 if(abs(sngl(xmpair)-ULMASS(iabs(kf))).gt.
0882 1 abs(sngl(xmpair)-ULMASS(iabs(kf)+2)))
0883 2 kf=(iabs(kf)+2)*isign(1,kf)
0884 endif
0885 endif
0886 endif
0887 ITYPAR(NATT)=kf
0888 KATT(NATT,1)=kf
0889 if(iabs(kf).eq.211) then
0890 npich=npich+1
0891 elseif(iabs(kf).eq.213) then
0892 nrhoch=nrhoch+1
0893 endif
0894 endif
0895
0896
0897
0898
0899
0900
0901
0902
0903
0904
0905
0906 1001 CONTINUE
0907
0908 if(nuudd.ne.0) then
0909 ppi0=float(npich/2)/float(nuudd)
0910 prho0=float(nrhoch/2)/float(nuudd)
0911 endif
0912
0913 npi0=0
0914 DO 1002 ISG = 1, NSG
0915 if(K2SGS(ISG,1).eq.-K2SGS(ISG,2)
0916 1 .and.iabs(K2SGS(ISG,1)).le.2.and.NJSGS(ISG).eq.2) then
0917 if(RANART(NSEED).le.ppi0) npi0=npi0+1
0918 endif
0919 1002 CONTINUE
0920
0921 if(nuudd.gt.1) then
0922 call index1(MAXSTR,nuudd,xmdiag,indx)
0923 else
0924 indx(1)=1
0925 end if
0926
0927 DO 1003 ix=1,nuudd
0928 iuudd=indx(ix)
0929 inatt=ndiag(iuudd)
0930 if(ix.le.npi0) then
0931 kf=111
0932 elseif(RANART(NSEED).le.(prho0/(1-ppi0+0.00001))) then
0933 kf=113
0934 else
0935
0936 if(RANART(NSEED).le.0.5) then
0937 kf=221
0938 else
0939 kf=223
0940 endif
0941 endif
0942 ITYPAR(inatt)=kf
0943 KATT(inatt,1)=kf
0944 1003 CONTINUE
0945
0946 inatt=0
0947
0948 if(ioscar.eq.3) then
0949 WRITE (85, 395) IAEVT, 3*nsmbbbar+2*nsmmeson,nsmbbbar,nsmmeson,
0950 1 bimp, NELP,NINP,NELT,NINTHJ,MISS
0951 endif
0952 395 format(4I8,f10.4,5I5)
0953
0954 DO 1006 ISG = 1, NSG
0955 if(NJSGS(ISG).ne.0) then
0956 inatt=inatt+1
0957 K1=K2SGS(ISG,1)
0958 k1abs=iabs(k1)
0959 PX1=PXSGS(ISG,1)
0960 PY1=PYSGS(ISG,1)
0961 PZ1=PZSGS(ISG,1)
0962 K2=K2SGS(ISG,2)
0963 k2abs=iabs(k2)
0964 PX2=PXSGS(ISG,2)
0965 PY2=PYSGS(ISG,2)
0966 PZ2=PZSGS(ISG,2)
0967 e1=PESGS(ISG,1)
0968 e2=PESGS(ISG,2)
0969
0970 if(NJSGS(ISG).eq.2) then
0971 PXAR(inatt)=sngl(px1+px2)
0972 PYAR(inatt)=sngl(py1+py2)
0973 PZAR(inatt)=sngl(pz1+pz2)
0974 PATT(inatt,1)=PXAR(inatt)
0975 PATT(inatt,2)=PYAR(inatt)
0976 PATT(inatt,3)=PZAR(inatt)
0977 etot=e1+e2
0978
0979 p1=px1+px2
0980 p2=py1+py2
0981 p3=pz1+pz2
0982
0983 elseif((isoft.eq.4.or.isoft.eq.5).and.NJSGS(ISG).eq.3)
0984 1 then
0985 PX3=PXSGS(ISG,3)
0986 PY3=PYSGS(ISG,3)
0987 PZ3=PZSGS(ISG,3)
0988 e3=PESGS(ISG,3)
0989 PXAR(inatt)=sngl(px1+px2+px3)
0990 PYAR(inatt)=sngl(py1+py2+py3)
0991 PZAR(inatt)=sngl(pz1+pz2+pz3)
0992 PATT(inatt,1)=PXAR(inatt)
0993 PATT(inatt,2)=PYAR(inatt)
0994 PATT(inatt,3)=PZAR(inatt)
0995 etot=e1+e2+e3
0996
0997 p1=px1+px2+px3
0998 p2=py1+py2+py3
0999 p3=pz1+pz2+pz3
1000
1001 endif
1002 XMAR(inatt)=ULMASS(ITYPAR(inatt))
1003
1004 kf=KATT(inatt,1)
1005 if(kf.eq.113.or.abs(kf).eq.213.or.kf.eq.221.or.kf.eq.223
1006 1 .or.abs(kf).eq.313.or.abs(kf).eq.323.or.kf.eq.333
1007 2 .or.abs(kf).eq.1114.or.abs(kf).eq.2114
1008 3 .or.abs(kf).eq.2214.or.abs(kf).eq.2224) then
1009 XMAR(inatt)=resmass(kf)
1010 endif
1011
1012 PEAR(inatt)=sqrt(PXAR(inatt)**2+PYAR(inatt)**2
1013 1 +PZAR(inatt)**2+XMAR(inatt)**2)
1014 PATT(inatt,4)=PEAR(inatt)
1015 EATT=EATT+PEAR(inatt)
1016 ipartn=NJSGS(ISG)
1017 DO 1004 i=1,ipartn
1018 ftp(i)=ftsgs(isg,i)
1019 gxp(i)=gxsgs(isg,i)
1020 gyp(i)=gysgs(isg,i)
1021 gzp(i)=gzsgs(isg,i)
1022 pxp(i)=pxsgs(isg,i)
1023 pyp(i)=pysgs(isg,i)
1024 pzp(i)=pzsgs(isg,i)
1025 pmp(i)=pmsgs(isg,i)
1026 pep(i)=pesgs(isg,i)
1027 1004 CONTINUE
1028 call locldr(ipartn,drlocl)
1029
1030 tau0=ARPAR1(1)
1031 ftavg0=ft0fom+dble(tau0)
1032 gxavg0=0d0
1033 gyavg0=0d0
1034 gzavg0=0d0
1035 DO 1005 i=1,ipartn
1036 gxavg0=gxavg0+gxp0(i)/ipartn
1037 gyavg0=gyavg0+gyp0(i)/ipartn
1038 gzavg0=gzavg0+gzp0(i)/ipartn
1039 1005 CONTINUE
1040
1041
1042
1043
1044 bex=p1/etot
1045 bey=p2/etot
1046 bez=p3/etot
1047
1048 beta2 = bex ** 2 + bey ** 2 + bez ** 2
1049 gam = 1.d0 / dsqrt(1.d0 - beta2)
1050 if(beta2.ge.0.9999999999999d0) then
1051 write(6,*) '2',bex,bey,bez,beta2,gam
1052 endif
1053
1054 call lorenz(ftavg0,gxavg0,gyavg0,gzavg0,-bex,-bey,-bez)
1055 GXAR(inatt)=sngl(pxnew)
1056 GYAR(inatt)=sngl(pynew)
1057 GZAR(inatt)=sngl(pznew)
1058 FTAR(inatt)=sngl(enenew)
1059
1060 if(ioscar.eq.3) then
1061 WRITE (85, 313) K2SGS(ISG,1),px1,py1,pz1,PMSGS(ISG,1),
1062 1 inatt,katt(inatt,1),xmar(inatt)
1063 WRITE (85, 312) K2SGS(ISG,2),px2,py2,pz2,PMSGS(ISG,2),
1064 1 inatt,katt(inatt,1)
1065 if(NJSGS(ISG).eq.3) WRITE (85, 312) K2SGS(ISG,3),
1066 1 px3,py3,pz3,PMSGS(ISG,3),inatt,katt(inatt,1)
1067 endif
1068 312 FORMAT(I6,4(1X,F10.3),1X,I6,1X,I6)
1069
1070 313 FORMAT(I6,4(1X,F10.3),1X,I6,1X,I6,1X,F10.3)
1071
1072 endif
1073 1006 CONTINUE
1074
1075 nattzp=natt
1076 MSTJ(24)=mstj24
1077
1078 RETURN
1079 END
1080
1081
1082
1083 FUNCTION resmass(kf)
1084
1085 PARAMETER (arho=0.775,aomega=0.783,aeta=0.548,aks=0.894,
1086 1 aphi=1.019,adelta=1.232)
1087 PARAMETER (wrho=0.149,womega=0.00849,weta=1.30E-6,wks=0.0498,
1088 1 wphi=0.00426,wdelta=0.118)
1089 common/input1/ MASSPR,MASSTA,ISEED,IAVOID,DT
1090 COMMON/RNDF77/NSEED
1091 SAVE
1092
1093 if(kf.eq.113.or.abs(kf).eq.213) then
1094 amass=arho
1095 wid=wrho
1096 elseif(kf.eq.221) then
1097 amass=aeta
1098 wid=weta
1099 elseif(kf.eq.223) then
1100 amass=aomega
1101 wid=womega
1102 elseif(abs(kf).eq.313.or.abs(kf).eq.323) then
1103 amass=aks
1104 wid=wks
1105 elseif(kf.eq.333) then
1106 amass=aphi
1107 wid=wphi
1108 elseif(abs(kf).eq.1114.or.abs(kf).eq.2114
1109 1 .or.abs(kf).eq.2214.or.abs(kf).eq.2224) then
1110 amass=adelta
1111 wid=wdelta
1112 endif
1113 dmin=amass-2*wid
1114 dmax=amass+2*wid
1115
1116 if(amass.eq.adelta) dmin=1.078
1117
1118 FM=1.
1119 NTRY1=0
1120 10 DM = RANART(NSEED) * (DMAX-DMIN) + DMIN
1121 NTRY1=NTRY1+1
1122 fmass=(amass*wid)**2/((DM**2-amass**2)**2+(amass*wid)**2)
1123
1124 IF((RANART(NSEED) .GT. FMASS/FM).AND. (NTRY1.LE.10)) GOTO 10
1125
1126 resmass=DM
1127
1128 RETURN
1129 END
1130
1131
1132 SUBROUTINE coales
1133
1134 PARAMETER (MAXSTR=150001)
1135 IMPLICIT DOUBLE PRECISION(D)
1136 DOUBLE PRECISION gxp,gyp,gzp,ftp,pxp,pyp,pzp,pep,pmp
1137 DIMENSION IOVER(MAXSTR),dp1(2:3),dr1(2:3)
1138 DOUBLE PRECISION PXSGS,PYSGS,PZSGS,PESGS,PMSGS,
1139 1 GXSGS,GYSGS,GZSGS,FTSGS
1140 double precision dpcoal,drcoal,ecritl
1141 COMMON/SOFT/PXSGS(MAXSTR,3),PYSGS(MAXSTR,3),PZSGS(MAXSTR,3),
1142 & PESGS(MAXSTR,3),PMSGS(MAXSTR,3),GXSGS(MAXSTR,3),
1143 & GYSGS(MAXSTR,3),GZSGS(MAXSTR,3),FTSGS(MAXSTR,3),
1144 & K1SGS(MAXSTR,3),K2SGS(MAXSTR,3),NJSGS(MAXSTR)
1145
1146 common /coal/dpcoal,drcoal,ecritl
1147
1148 common /loclco/gxp(3),gyp(3),gzp(3),ftp(3),
1149 1 pxp(3),pyp(3),pzp(3),pep(3),pmp(3)
1150
1151 COMMON/HJJET2/NSG,NJSG(MAXSTR),IASG(MAXSTR,3),K1SG(MAXSTR,100),
1152 & K2SG(MAXSTR,100),PXSG(MAXSTR,100),PYSG(MAXSTR,100),
1153 & PZSG(MAXSTR,100),PESG(MAXSTR,100),PMSG(MAXSTR,100)
1154
1155 SAVE
1156
1157 do 1001 ISG=1, NSG
1158 IOVER(ISG)=0
1159 1001 continue
1160
1161 do 150 ISG=1,NSG
1162 if(NJSGS(ISG).ne.2.or.IOVER(ISG).eq.1) goto 150
1163
1164 if(K2SGS(ISG,1).lt.0) then
1165 write(6,*) 'Antiquark appears in quark loop; stop'
1166 stop
1167 endif
1168
1169 do 1002 j=1,2
1170 ftp(j)=ftsgs(isg,j)
1171 gxp(j)=gxsgs(isg,j)
1172 gyp(j)=gysgs(isg,j)
1173 gzp(j)=gzsgs(isg,j)
1174 pxp(j)=pxsgs(isg,j)
1175 pyp(j)=pysgs(isg,j)
1176 pzp(j)=pzsgs(isg,j)
1177 pmp(j)=pmsgs(isg,j)
1178 pep(j)=pesgs(isg,j)
1179 1002 continue
1180 call locldr(2,drlocl)
1181 dr0=drlocl
1182
1183 dp0=dsqrt(2*(pep(1)*pep(2)-pxp(1)*pxp(2)
1184 & -pyp(1)*pyp(2)-pzp(1)*pzp(2)-pmp(1)*pmp(2)))
1185
1186 do 120 JSG=1,NSG
1187
1188 if(JSG.eq.ISG.or.IOVER(JSG).eq.1) goto 120
1189 if(NJSGS(JSG).eq.2) then
1190 ipmin=2
1191 ipmax=2
1192 elseif(NJSGS(JSG).eq.3.and.K2SGS(JSG,1).lt.0) then
1193 ipmin=1
1194 ipmax=3
1195 else
1196 goto 120
1197 endif
1198 do 100 ip=ipmin,ipmax
1199 dplocl=dsqrt(2*(pep(1)*pesgs(jsg,ip)
1200 1 -pxp(1)*pxsgs(jsg,ip)
1201 2 -pyp(1)*pysgs(jsg,ip)
1202 3 -pzp(1)*pzsgs(jsg,ip)
1203 4 -pmp(1)*pmsgs(jsg,ip)))
1204
1205 if(dplocl.gt.dpcoal) goto 120
1206 ftp(2)=ftsgs(jsg,ip)
1207 gxp(2)=gxsgs(jsg,ip)
1208 gyp(2)=gysgs(jsg,ip)
1209 gzp(2)=gzsgs(jsg,ip)
1210 pxp(2)=pxsgs(jsg,ip)
1211 pyp(2)=pysgs(jsg,ip)
1212 pzp(2)=pzsgs(jsg,ip)
1213 pmp(2)=pmsgs(jsg,ip)
1214 pep(2)=pesgs(jsg,ip)
1215 call locldr(2,drlocl)
1216
1217 if(drlocl.gt.drcoal) goto 120
1218
1219 if((dp0.gt.dpcoal.or.dr0.gt.drcoal)
1220 1 .or.(drlocl.lt.dr0)) then
1221 dp0=dplocl
1222 dr0=drlocl
1223 call exchge(isg,2,jsg,ip)
1224 endif
1225 100 continue
1226 120 continue
1227 if(dp0.le.dpcoal.and.dr0.le.drcoal) IOVER(ISG)=1
1228 150 continue
1229
1230
1231 do 250 ISG=1,NSG
1232 if(NJSGS(ISG).ne.2.or.IOVER(ISG).eq.1) goto 250
1233
1234 do 1003 j=1,2
1235 ftp(j)=ftsgs(isg,j)
1236 gxp(j)=gxsgs(isg,j)
1237 gyp(j)=gysgs(isg,j)
1238 gzp(j)=gzsgs(isg,j)
1239 pxp(j)=pxsgs(isg,j)
1240 pyp(j)=pysgs(isg,j)
1241 pzp(j)=pzsgs(isg,j)
1242 pmp(j)=pmsgs(isg,j)
1243 pep(j)=pesgs(isg,j)
1244 1003 continue
1245 call locldr(2,drlocl)
1246 dr0=drlocl
1247 dp0=dsqrt(2*(pep(1)*pep(2)-pxp(1)*pxp(2)
1248 & -pyp(1)*pyp(2)-pzp(1)*pzp(2)-pmp(1)*pmp(2)))
1249
1250 do 220 JSG=1,NSG
1251 if(JSG.eq.ISG.or.IOVER(JSG).eq.1) goto 220
1252 if(NJSGS(JSG).eq.2) then
1253 ipmin=1
1254 ipmax=1
1255 elseif(NJSGS(JSG).eq.3.and.K2SGS(JSG,1).gt.0) then
1256 ipmin=1
1257 ipmax=3
1258 else
1259 goto 220
1260 endif
1261 do 200 ip=ipmin,ipmax
1262 dplocl=dsqrt(2*(pep(2)*pesgs(jsg,ip)
1263 1 -pxp(2)*pxsgs(jsg,ip)
1264 2 -pyp(2)*pysgs(jsg,ip)
1265 3 -pzp(2)*pzsgs(jsg,ip)
1266 4 -pmp(2)*pmsgs(jsg,ip)))
1267
1268 if(dplocl.gt.dpcoal) goto 220
1269 ftp(1)=ftsgs(jsg,ip)
1270 gxp(1)=gxsgs(jsg,ip)
1271 gyp(1)=gysgs(jsg,ip)
1272 gzp(1)=gzsgs(jsg,ip)
1273 pxp(1)=pxsgs(jsg,ip)
1274 pyp(1)=pysgs(jsg,ip)
1275 pzp(1)=pzsgs(jsg,ip)
1276 pmp(1)=pmsgs(jsg,ip)
1277 pep(1)=pesgs(jsg,ip)
1278 call locldr(2,drlocl)
1279
1280 if(drlocl.gt.drcoal) goto 220
1281
1282 if((dp0.gt.dpcoal.or.dr0.gt.drcoal)
1283 1 .or.(drlocl.lt.dr0)) then
1284 dp0=dplocl
1285 dr0=drlocl
1286 call exchge(isg,1,jsg,ip)
1287 endif
1288 200 continue
1289 220 continue
1290 if(dp0.le.dpcoal.and.dr0.le.drcoal) IOVER(ISG)=1
1291 250 continue
1292
1293
1294 do 350 ISG=1,NSG
1295 if(NJSGS(ISG).ne.3.or.IOVER(ISG).eq.1) goto 350
1296 ibaryn=K2SGS(ISG,1)
1297
1298 do 1004 j=1,2
1299 ftp(j)=ftsgs(isg,j)
1300 gxp(j)=gxsgs(isg,j)
1301 gyp(j)=gysgs(isg,j)
1302 gzp(j)=gzsgs(isg,j)
1303 pxp(j)=pxsgs(isg,j)
1304 pyp(j)=pysgs(isg,j)
1305 pzp(j)=pzsgs(isg,j)
1306 pmp(j)=pmsgs(isg,j)
1307 pep(j)=pesgs(isg,j)
1308 1004 continue
1309 call locldr(2,drlocl)
1310 dr1(2)=drlocl
1311 dp1(2)=dsqrt(2*(pep(1)*pep(2)-pxp(1)*pxp(2)
1312 & -pyp(1)*pyp(2)-pzp(1)*pzp(2)-pmp(1)*pmp(2)))
1313
1314 ftp(2)=ftsgs(isg,3)
1315 gxp(2)=gxsgs(isg,3)
1316 gyp(2)=gysgs(isg,3)
1317 gzp(2)=gzsgs(isg,3)
1318 pxp(2)=pxsgs(isg,3)
1319 pyp(2)=pysgs(isg,3)
1320 pzp(2)=pzsgs(isg,3)
1321 pmp(2)=pmsgs(isg,3)
1322 pep(2)=pesgs(isg,3)
1323 call locldr(2,drlocl)
1324 dr1(3)=drlocl
1325 dp1(3)=dsqrt(2*(pep(1)*pep(2)-pxp(1)*pxp(2)
1326 & -pyp(1)*pyp(2)-pzp(1)*pzp(2)-pmp(1)*pmp(2)))
1327
1328 do 320 JSG=1,NSG
1329 if(JSG.eq.ISG.or.IOVER(JSG).eq.1) goto 320
1330 if(NJSGS(JSG).eq.2) then
1331 if(ibaryn.gt.0) then
1332 ipmin=1
1333 else
1334 ipmin=2
1335 endif
1336 ipmax=ipmin
1337 elseif(NJSGS(JSG).eq.3.and.
1338 1 (ibaryn*K2SGS(JSG,1)).gt.0) then
1339 ipmin=1
1340 ipmax=3
1341 else
1342 goto 320
1343 endif
1344 do 300 ip=ipmin,ipmax
1345 dplocl=dsqrt(2*(pep(1)*pesgs(jsg,ip)
1346 1 -pxp(1)*pxsgs(jsg,ip)
1347 2 -pyp(1)*pysgs(jsg,ip)
1348 3 -pzp(1)*pzsgs(jsg,ip)
1349 4 -pmp(1)*pmsgs(jsg,ip)))
1350
1351 if(dplocl.gt.dpcoal) goto 320
1352 ftp(2)=ftsgs(jsg,ip)
1353 gxp(2)=gxsgs(jsg,ip)
1354 gyp(2)=gysgs(jsg,ip)
1355 gzp(2)=gzsgs(jsg,ip)
1356 pxp(2)=pxsgs(jsg,ip)
1357 pyp(2)=pysgs(jsg,ip)
1358 pzp(2)=pzsgs(jsg,ip)
1359 pmp(2)=pmsgs(jsg,ip)
1360 pep(2)=pesgs(jsg,ip)
1361 call locldr(2,drlocl)
1362
1363 if(drlocl.gt.drcoal) goto 320
1364
1365 ipi=0
1366 if(dp1(2).gt.dpcoal.or.dr1(2).gt.drcoal) then
1367 ipi=2
1368 if((dp1(3).gt.dpcoal.or.dr1(3).gt.drcoal)
1369 1 .and.dr1(3).gt.dr1(2)) ipi=3
1370 elseif(dp1(3).gt.dpcoal.or.dr1(3).gt.drcoal) then
1371 ipi=3
1372 elseif(dr1(2).lt.dr1(3)) then
1373 if(drlocl.lt.dr1(3)) ipi=3
1374 elseif(dr1(3).le.dr1(2)) then
1375 if(drlocl.lt.dr1(2)) ipi=2
1376 endif
1377 if(ipi.ne.0) then
1378 dp1(ipi)=dplocl
1379 dr1(ipi)=drlocl
1380 call exchge(isg,ipi,jsg,ip)
1381 endif
1382 300 continue
1383 320 continue
1384 if(dp1(2).le.dpcoal.and.dr1(2).le.drcoal
1385 1 .and.dp1(3).le.dpcoal.and.dr1(3).le.drcoal)
1386 2 IOVER(ISG)=1
1387 350 continue
1388
1389 RETURN
1390 END
1391
1392
1393 SUBROUTINE exchge(isg,ipi,jsg,ipj)
1394
1395 implicit double precision (a-h, o-z)
1396 PARAMETER (MAXSTR=150001)
1397 COMMON/SOFT/PXSGS(MAXSTR,3),PYSGS(MAXSTR,3),PZSGS(MAXSTR,3),
1398 & PESGS(MAXSTR,3),PMSGS(MAXSTR,3),GXSGS(MAXSTR,3),
1399 & GYSGS(MAXSTR,3),GZSGS(MAXSTR,3),FTSGS(MAXSTR,3),
1400 & K1SGS(MAXSTR,3),K2SGS(MAXSTR,3),NJSGS(MAXSTR)
1401
1402 SAVE
1403
1404 k1=K1SGS(isg,ipi)
1405 k2=K2SGS(isg,ipi)
1406 px=PXSGS(isg,ipi)
1407 py=PYSGS(isg,ipi)
1408 pz=PZSGS(isg,ipi)
1409 pe=PESGS(isg,ipi)
1410 pm=PMSGS(isg,ipi)
1411 gx=GXSGS(isg,ipi)
1412 gy=GYSGS(isg,ipi)
1413 gz=GZSGS(isg,ipi)
1414 ft=FTSGS(isg,ipi)
1415 K1SGS(isg,ipi)=K1SGS(jsg,ipj)
1416 K2SGS(isg,ipi)=K2SGS(jsg,ipj)
1417 PXSGS(isg,ipi)=PXSGS(jsg,ipj)
1418 PYSGS(isg,ipi)=PYSGS(jsg,ipj)
1419 PZSGS(isg,ipi)=PZSGS(jsg,ipj)
1420 PESGS(isg,ipi)=PESGS(jsg,ipj)
1421 PMSGS(isg,ipi)=PMSGS(jsg,ipj)
1422 GXSGS(isg,ipi)=GXSGS(jsg,ipj)
1423 GYSGS(isg,ipi)=GYSGS(jsg,ipj)
1424 GZSGS(isg,ipi)=GZSGS(jsg,ipj)
1425 FTSGS(isg,ipi)=FTSGS(jsg,ipj)
1426 K1SGS(jsg,ipj)=k1
1427 K2SGS(jsg,ipj)=k2
1428 PXSGS(jsg,ipj)=px
1429 PYSGS(jsg,ipj)=py
1430 PZSGS(jsg,ipj)=pz
1431 PESGS(jsg,ipj)=pe
1432 PMSGS(jsg,ipj)=pm
1433 GXSGS(jsg,ipj)=gx
1434 GYSGS(jsg,ipj)=gy
1435 GZSGS(jsg,ipj)=gz
1436 FTSGS(jsg,ipj)=ft
1437
1438 RETURN
1439 END
1440
1441
1442 SUBROUTINE locldr(icall,drlocl)
1443
1444 implicit double precision (a-h, o-z)
1445 dimension ftp0(3),pxp0(3),pyp0(3),pzp0(3),pep0(3)
1446 common /loclco/gxp(3),gyp(3),gzp(3),ftp(3),
1447 1 pxp(3),pyp(3),pzp(3),pep(3),pmp(3)
1448
1449 common /prtn23/ gxp0(3),gyp0(3),gzp0(3),ft0fom
1450
1451 common /lor/ enenew, pxnew, pynew, pznew
1452
1453 SAVE
1454
1455 if(icall.eq.2) then
1456 etot=pep(1)+pep(2)
1457 bex=(pxp(1)+pxp(2))/etot
1458 bey=(pyp(1)+pyp(2))/etot
1459 bez=(pzp(1)+pzp(2))/etot
1460
1461 do 1001 j=1,2
1462 beta2 = bex ** 2 + bey ** 2 + bez ** 2
1463 gam = 1.d0 / dsqrt(1.d0 - beta2)
1464 if(beta2.ge.0.9999999999999d0) then
1465 write(6,*) '4',pxp(1),pxp(2),pyp(1),pyp(2),
1466 1 pzp(1),pzp(2),pep(1),pep(2),pmp(1),pmp(2),
1467 2 dsqrt(pxp(1)**2+pyp(1)**2+pzp(1)**2+pmp(1)**2)/pep(1),
1468 3 dsqrt(pxp(1)**2+pyp(1)**2+pzp(1)**2)/pep(1)
1469 write(6,*) '4a',pxp(1)+pxp(2),pyp(1)+pyp(2),
1470 1 pzp(1)+pzp(2),etot
1471 write(6,*) '4b',bex,bey,bez,beta2,gam
1472 endif
1473
1474 call lorenz(ftp(j),gxp(j),gyp(j),gzp(j),bex,bey,bez)
1475 gxp0(j)=pxnew
1476 gyp0(j)=pynew
1477 gzp0(j)=pznew
1478 ftp0(j)=enenew
1479 call lorenz(pep(j),pxp(j),pyp(j),pzp(j),bex,bey,bez)
1480 pxp0(j)=pxnew
1481 pyp0(j)=pynew
1482 pzp0(j)=pznew
1483 pep0(j)=enenew
1484 1001 continue
1485
1486 if(ftp0(1).ge.ftp0(2)) then
1487 ilate=1
1488 iearly=2
1489 else
1490 ilate=2
1491 iearly=1
1492 endif
1493 ft0fom=ftp0(ilate)
1494
1495 dt0=ftp0(ilate)-ftp0(iearly)
1496 gxp0(iearly)=gxp0(iearly)+pxp0(iearly)/pep0(iearly)*dt0
1497 gyp0(iearly)=gyp0(iearly)+pyp0(iearly)/pep0(iearly)*dt0
1498 gzp0(iearly)=gzp0(iearly)+pzp0(iearly)/pep0(iearly)*dt0
1499 drlocl=dsqrt((gxp0(ilate)-gxp0(iearly))**2
1500 1 +(gyp0(ilate)-gyp0(iearly))**2
1501 2 +(gzp0(ilate)-gzp0(iearly))**2)
1502
1503 elseif(icall.eq.3) then
1504 etot=pep(1)+pep(2)+pep(3)
1505 bex=(pxp(1)+pxp(2)+pxp(3))/etot
1506 bey=(pyp(1)+pyp(2)+pyp(3))/etot
1507 bez=(pzp(1)+pzp(2)+pzp(3))/etot
1508 beta2 = bex ** 2 + bey ** 2 + bez ** 2
1509 gam = 1.d0 / dsqrt(1.d0 - beta2)
1510 if(beta2.ge.0.9999999999999d0) then
1511 write(6,*) '5',bex,bey,bez,beta2,gam
1512 endif
1513
1514 do 1002 j=1,3
1515 call lorenz(ftp(j),gxp(j),gyp(j),gzp(j),bex,bey,bez)
1516 gxp0(j)=pxnew
1517 gyp0(j)=pynew
1518 gzp0(j)=pznew
1519 ftp0(j)=enenew
1520 call lorenz(pep(j),pxp(j),pyp(j),pzp(j),bex,bey,bez)
1521 pxp0(j)=pxnew
1522 pyp0(j)=pynew
1523 pzp0(j)=pznew
1524 pep0(j)=enenew
1525 1002 continue
1526
1527 if(ftp0(1).gt.ftp0(2)) then
1528 ilate=1
1529 if(ftp0(3).gt.ftp0(1)) ilate=3
1530 else
1531 ilate=2
1532 if(ftp0(3).ge.ftp0(2)) ilate=3
1533 endif
1534 ft0fom=ftp0(ilate)
1535
1536 if(ilate.eq.1) then
1537 imin=2
1538 imax=3
1539 istep=1
1540 elseif(ilate.eq.2) then
1541 imin=1
1542 imax=3
1543 istep=2
1544 elseif(ilate.eq.3) then
1545 imin=1
1546 imax=2
1547 istep=1
1548 endif
1549
1550 do 1003 iearly=imin,imax,istep
1551 dt0=ftp0(ilate)-ftp0(iearly)
1552 gxp0(iearly)=gxp0(iearly)+pxp0(iearly)/pep0(iearly)*dt0
1553 gyp0(iearly)=gyp0(iearly)+pyp0(iearly)/pep0(iearly)*dt0
1554 gzp0(iearly)=gzp0(iearly)+pzp0(iearly)/pep0(iearly)*dt0
1555 1003 continue
1556 endif
1557
1558 RETURN
1559 END
1560
1561
1562 subroutine hoscar
1563
1564 parameter (MAXSTR=150001,AMN=0.939457,AMP=0.93828)
1565 character*8 code, reffra, FRAME
1566 character*25 amptvn
1567 common/snn/efrm,npart1,npart2,epsiPz,epsiPt,PZPROJ,PZTARG
1568
1569 common /lastt/itimeh,bimp
1570
1571 COMMON/hbt/lblast(MAXSTR),xlast(4,MAXSTR),plast(4,MAXSTR),nlast
1572
1573 common/oscar1/iap,izp,iat,izt
1574
1575 common/oscar2/FRAME,amptvn
1576
1577 SAVE
1578 data nff/0/
1579
1580
1581 if(nff.eq.0) then
1582 write (19, 101) 'OSCAR1997A'
1583 write (19, 111) 'final_id_p_x'
1584 code = 'AMPT'
1585 if(FRAME.eq.'CMS') then
1586 reffra = 'nncm'
1587 xmp=(amp*izp+amn*(iap-izp))/iap
1588 xmt=(amp*izt+amn*(iat-izt))/iat
1589 ebeam=(efrm**2-xmp**2-xmt**2)/2./xmt
1590 elseif(FRAME.eq.'LAB') then
1591 reffra = 'lab'
1592 ebeam=efrm
1593 else
1594 reffra = 'unknown'
1595 ebeam=0.
1596 endif
1597 ntestp = 1
1598 write (19, 102) code, amptvn, iap, izp, iat, izt,
1599 & reffra, ebeam, ntestp
1600 nff = 1
1601 ievent = 1
1602 phi = 0.
1603 if(FRAME.eq.'CMS') write(19,112) efrm
1604 endif
1605
1606
1607 write (19, 103) ievent, nlast, bimp, phi
1608
1609 do 99 i = 1, nlast
1610 ene=sqrt(plast(1,i)**2+plast(2,i)**2+plast(3,i)**2
1611 1 +plast(4,i)**2)
1612 write (19, 104) i, INVFLV(lblast(i)), plast(1,i),
1613 1 plast(2,i),plast(3,i),ene,plast(4,i),
1614 2 xlast(1,i),xlast(2,i),xlast(3,i),xlast(4,i)
1615 99 continue
1616 ievent = ievent + 1
1617 101 format (a10)
1618 111 format (a12)
1619 102 format (a4,1x,a20,1x,'(', i3, ',', i3, ')+(', i3, ',',
1620 & i3, ')', 2x, a4, 2x, e10.4, 2x, i8)
1621 103 format (i10, 2x, i10, 2x, f8.3, 2x, f8.3)
1622 104 format (i10, 2x, i10, 2x, 9(e12.6, 2x))
1623 112 format ('# Center-of-mass energy/nucleon-pair is',
1624 & f12.3,'GeV')
1625
1626 return
1627 end
1628
1629
1630 subroutine getnp
1631
1632 PARAMETER (MAXSTR=150001)
1633 COMMON/HMAIN1/EATT,JATT,NATT,NT,NP,N0,N01,N10,N11
1634
1635 COMMON/HMAIN2/KATT(MAXSTR,4),PATT(MAXSTR,4)
1636
1637 COMMON /HPARNT/HIPR1(100), IHPR2(50), HINT1(100), IHNT2(50)
1638
1639 common/snn/efrm,npart1,npart2,epsiPz,epsiPt,PZPROJ,PZTARG
1640
1641 SAVE
1642
1643 if(NATT.eq.0) then
1644 npart1=0
1645 npart2=0
1646 return
1647 endif
1648
1649 PZPROJ=SQRT(HINT1(6)**2-HINT1(8)**2)
1650 PZTARG=SQRT(HINT1(7)**2-HINT1(9)**2)
1651 epsiPz=0.01
1652
1653
1654 epsiPt=1e-6
1655
1656 nspec1=0
1657 nspec2=0
1658 DO 1000 I = 1, NATT
1659
1660
1661
1662 if((KATT(I,1).eq.2112.or.KATT(I,1).eq.2212)
1663 1 .and.abs(PATT(I, 1)).le.epsiPt
1664 2 .and.abs(PATT(I, 2)).le.epsiPt) then
1665 if(PATT(I, 3).gt.amax1(0.,PZPROJ-epsiPz)) then
1666 nspec1=nspec1+1
1667 elseif(PATT(I, 3).lt.(-PZTARG+epsiPz)) then
1668 nspec2=nspec2+1
1669 endif
1670 endif
1671 1000 CONTINUE
1672 npart1=IHNT2(1)-nspec1
1673 npart2=IHNT2(3)-nspec2
1674
1675 return
1676 end
1677
1678
1679
1680
1681
1682 subroutine resdec(i1,nt,nnn,wid,idecay,ipion)
1683
1684 PARAMETER (hbarc=0.19733)
1685 PARAMETER (AK0=0.498,APICH=0.140,API0=0.135,AN=0.940,ADDM=0.02)
1686 PARAMETER (MAXSTR=150001, MAXR=1)
1687 COMMON /INPUT2/ ILAB, MANYB, NTMAX, ICOLL, INSYS, IPOT, MODE,
1688 & IMOMEN, NFREQ, ICFLOW, ICRHO, ICOU, KPOTEN, KMUL
1689
1690 COMMON/LUJETS/N,K(9000,5),P(9000,5),V(9000,5)
1691
1692 COMMON/LUDAT1/MSTU(200),PARU(200),MSTJ(200),PARJ(200)
1693
1694 COMMON/LUDAT2/KCHG(500,3),PMAS(500,4),PARF(2000),VCKM(4,4)
1695
1696 COMMON/LUDAT3/MDCY(500,3),MDME(2000,2),BRAT(2000),KFDP(2000,5)
1697
1698 COMMON /CC/ E(MAXSTR)
1699
1700 COMMON /EE/ ID(MAXSTR),LB(MAXSTR)
1701
1702 COMMON /PA/RPION(3,MAXSTR,MAXR)
1703
1704 COMMON /PB/PPION(3,MAXSTR,MAXR)
1705
1706 COMMON /PC/EPION(MAXSTR,MAXR)
1707
1708 COMMON /PD/LPION(MAXSTR,MAXR)
1709
1710 common/input1/ MASSPR,MASSTA,ISEED,IAVOID,DT
1711
1712 common/resdcy/NSAV,iksdcy
1713
1714 common/leadng/lb1,px1,py1,pz1,em1,e1,xfnl,yfnl,zfnl,tfnl,
1715 1 px1n,py1n,pz1n,dp1n
1716
1717 EXTERNAL IARFLV, INVFLV
1718 COMMON/tdecay/tfdcy(MAXSTR),tfdpi(MAXSTR,MAXR),tft(MAXSTR)
1719
1720 COMMON/RNDF77/NSEED
1721 COMMON /dpert/dpertt(MAXSTR,MAXR),dpertp(MAXSTR),dplast(MAXSTR),
1722 1 dpdcy(MAXSTR),dpdpi(MAXSTR,MAXR),dpt(MAXSTR, MAXR),
1723 2 dpp1(MAXSTR,MAXR),dppion(MAXSTR,MAXR)
1724
1725 common/phidcy/iphidcy,pttrig,ntrig,maxmiss,ipi0dcy
1726 SAVE
1727 irun=idecay
1728
1729 if(nt.eq.ntmax.and.ipi0dcy.eq.1
1730 & .and.((lb1.eq.4.and.ipion.eq.0).or.ipion.ge.1)) then
1731 kf=111
1732
1733 elseif(lb1.eq.0.or.lb1.eq.25.or.lb1.eq.26.or.lb1.eq.27
1734 & .or.lb1.eq.28.or.lb1.eq.29.or.iabs(lb1).eq.30
1735 & .or.lb1.eq.24.or.(iabs(lb1).ge.6.and.iabs(lb1).le.9)
1736 & .or.iabs(lb1).eq.16) then
1737 kf=INVFLV(lb1)
1738 else
1739 return
1740 endif
1741
1742 IP=1
1743
1744 N=1
1745 K(IP,1)=1
1746 K(IP,3)=0
1747 K(IP,4)=0
1748 K(IP,5)=0
1749
1750 K(IP,2)=kf
1751
1752 if(ipion.eq.0) then
1753
1754 P(IP,1)=px1
1755 P(IP,2)=py1
1756 P(IP,3)=pz1
1757
1758
1759
1760
1761 if((lb1.eq.0.or.lb1.eq.28).and.em1.lt.(2*APICH+API0+ADDM)) then
1762 em1=2*APICH+API0+ADDM
1763
1764 elseif(lb1.ge.25.and.lb1.le.27.and.em1.lt.(2*APICH+ADDM)) then
1765 em1=2*APICH+ADDM
1766
1767 elseif(iabs(lb1).eq.30.and.em1.lt.(APICH+AK0+ADDM)) then
1768 em1=APICH+AK0+ADDM
1769
1770 elseif(iabs(lb1).ge.6.and.iabs(lb1).le.9
1771 1 .and.em1.lt.(APICH+AN+ADDM)) then
1772 em1=APICH+AN+ADDM
1773 endif
1774
1775
1776 e1=SQRT(EM1**2+PX1**2+PY1**2+PZ1**2)
1777 P(IP,4)=e1
1778 P(IP,5)=em1
1779
1780 dpdecp=dpertp(i1)
1781
1782 elseif(nt.eq.ntmax.and.ipi0dcy.eq.1.and.ipion.ge.1) then
1783 P(IP,1)=PPION(1,ipion,IRUN)
1784 P(IP,2)=PPION(2,ipion,IRUN)
1785 P(IP,3)=PPION(3,ipion,IRUN)
1786 P(IP,5)=EPION(ipion,IRUN)
1787 P(IP,4)=SQRT(P(IP,5)**2+P(IP,1)**2+P(IP,2)**2+P(IP,3)**2)
1788 dpdecp=dppion(ipion,IRUN)
1789
1790
1791 else
1792 print *, 'stopped in resdec() a'
1793 stop
1794 endif
1795
1796 call ludecy(IP)
1797
1798 if(nt.eq.ntmax) then
1799 tau0=hbarc/wid
1800 taudcy=tau0*(-1.)*alog(1.-RANART(NSEED))
1801 ndaut=n-nsav
1802 if(ndaut.le.1) then
1803 write(10,*) 'note: ndaut(<1)=',ndaut
1804 call lulist(2)
1805 stop
1806 endif
1807
1808
1809 if(ipion.eq.0) then
1810 taudcy=taudcy*e1/em1
1811 tfnl=tfnl+taudcy
1812 xfnl=xfnl+px1/e1*taudcy
1813 yfnl=yfnl+py1/e1*taudcy
1814 zfnl=zfnl+pz1/e1*taudcy
1815 elseif(ipion.ge.1) then
1816 taudcy=taudcy*P(IP,4)/P(IP,5)
1817 tfnl=tfdpi(ipion,IRUN)+taudcy
1818 xfnl=RPION(1,ipion,IRUN)+P(IP,1)/P(IP,4)*taudcy
1819 yfnl=RPION(2,ipion,IRUN)+P(IP,2)/P(IP,4)*taudcy
1820 zfnl=RPION(3,ipion,IRUN)+P(IP,3)/P(IP,4)*taudcy
1821 else
1822 print *, 'stopped in resdec() b',ipion,wid,P(ip,4)
1823 stop
1824 endif
1825
1826
1827
1828
1829 if(n.ge.(nsav+2).and.ipion.eq.0) then
1830 do 1001 idau=nsav+2,n
1831 kdaut=K(idau,2)
1832 if(kdaut.eq.221.or.kdaut.eq.113
1833 1 .or.kdaut.eq.213.or.kdaut.eq.-213
1834 2 .or.kdaut.eq.310) then
1835
1836 ksave=kdaut
1837 pxsave=p(idau,1)
1838 pysave=p(idau,2)
1839 pzsave=p(idau,3)
1840 esave=p(idau,4)
1841 xmsave=p(idau,5)
1842 K(idau,2)=K(nsav+1,2)
1843 p(idau,1)=p(nsav+1,1)
1844 p(idau,2)=p(nsav+1,2)
1845 p(idau,3)=p(nsav+1,3)
1846 p(idau,4)=p(nsav+1,4)
1847 p(idau,5)=p(nsav+1,5)
1848 K(nsav+1,2)=ksave
1849 p(nsav+1,1)=pxsave
1850 p(nsav+1,2)=pysave
1851 p(nsav+1,3)=pzsave
1852 p(nsav+1,4)=esave
1853 p(nsav+1,5)=xmsave
1854
1855
1856 goto 111
1857 endif
1858 1001 continue
1859 endif
1860 111 continue
1861
1862 enet=0.
1863 do 1002 idau=nsav+1,n
1864 enet=enet+p(idau,4)
1865 1002 continue
1866
1867
1868 endif
1869
1870 do 1003 idau=nsav+1,n
1871 kdaut=K(idau,2)
1872 lbdaut=IARFLV(kdaut)
1873
1874
1875
1876 if(nt.eq.ntmax.and.(kdaut.eq.130.or.kdaut.eq.310
1877 1 .or.iabs(kdaut).eq.311)) then
1878 if(kdaut.eq.130) then
1879 lbdaut=22
1880 elseif(kdaut.eq.310) then
1881 lbdaut=24
1882 elseif(iabs(kdaut).eq.311) then
1883 if(RANART(NSEED).lt.0.5) then
1884 lbdaut=22
1885 else
1886 lbdaut=24
1887 endif
1888 endif
1889 endif
1890
1891 if(idau.eq.(nsav+1)) then
1892
1893 if(ipion.eq.0) then
1894 LB(i1)=lbdaut
1895 E(i1)=p(idau,5)
1896 px1n=p(idau,1)
1897 py1n=p(idau,2)
1898 pz1n=p(idau,3)
1899
1900 dp1n=dpdecp
1901 elseif(ipion.ge.1) then
1902 LPION(ipion,IRUN)=lbdaut
1903 EPION(ipion,IRUN)=p(idau,5)
1904 PPION(1,ipion,IRUN)=p(idau,1)
1905 PPION(2,ipion,IRUN)=p(idau,2)
1906 PPION(3,ipion,IRUN)=p(idau,3)
1907 RPION(1,ipion,IRUN)=xfnl
1908 RPION(2,ipion,IRUN)=yfnl
1909 RPION(3,ipion,IRUN)=zfnl
1910 tfdpi(ipion,IRUN)=tfnl
1911 dppion(ipion,IRUN)=dpdecp
1912 endif
1913
1914 else
1915 nnn=nnn+1
1916 LPION(NNN,IRUN)=lbdaut
1917 EPION(NNN,IRUN)=p(idau,5)
1918 PPION(1,NNN,IRUN)=p(idau,1)
1919 PPION(2,NNN,IRUN)=p(idau,2)
1920 PPION(3,NNN,IRUN)=p(idau,3)
1921 RPION(1,NNN,IRUN)=xfnl
1922 RPION(2,NNN,IRUN)=yfnl
1923 RPION(3,NNN,IRUN)=zfnl
1924 tfdpi(NNN,IRUN)=tfnl
1925
1926 dppion(NNN,IRUN)=dpdecp
1927 endif
1928 1003 continue
1929 return
1930 end
1931
1932
1933 subroutine inidcy
1934
1935 COMMON/LUJETS/N,K(9000,5),P(9000,5),V(9000,5)
1936
1937 common/resdcy/NSAV,iksdcy
1938
1939 SAVE
1940 N=1
1941 NSAV=N
1942 return
1943 end
1944
1945
1946
1947 subroutine local(t)
1948
1949 implicit double precision (a-h, o-z)
1950 PARAMETER (MAXPTN=400001)
1951 PARAMETER (r0=1d0)
1952 COMMON /para1/ mul
1953
1954 COMMON /prec2/GX5(MAXPTN),GY5(MAXPTN),GZ5(MAXPTN),FT5(MAXPTN),
1955 & PX5(MAXPTN), PY5(MAXPTN), PZ5(MAXPTN), E5(MAXPTN),
1956 & XMASS5(MAXPTN), ITYP5(MAXPTN)
1957
1958 common /frzprc/
1959 & gxfrz(MAXPTN), gyfrz(MAXPTN), gzfrz(MAXPTN), ftfrz(MAXPTN),
1960 & pxfrz(MAXPTN), pyfrz(MAXPTN), pzfrz(MAXPTN), efrz(MAXPTN),
1961 & xmfrz(MAXPTN),
1962 & tfrz(302), ifrz(MAXPTN), idfrz(MAXPTN), itlast
1963
1964 common /prec4/ vx(MAXPTN), vy(MAXPTN), vz(MAXPTN)
1965
1966 common /prec5/ eta(MAXPTN), rap(MAXPTN), tau(MAXPTN)
1967
1968 common /coal/dpcoal,drcoal,ecritl
1969
1970 SAVE
1971
1972 do 1001 it=1,301
1973 if(t.ge.tfrz(it).and.t.lt.tfrz(it+1)) then
1974 if(it.eq.itlast) then
1975 return
1976 else
1977 itlast=it
1978 goto 50
1979 endif
1980 endif
1981 1001 continue
1982 write(1,*) 'local time out of range in LOCAL, stop',t,it
1983 stop
1984 50 continue
1985
1986 do 200 ip=1,mul
1987
1988 if(ifrz(ip).eq.1) goto 200
1989 if(it.eq.301) then
1990
1991 etcrit=1d6
1992 goto 150
1993 else
1994
1995 etcrit=(ecritl*2d0/3d0)
1996 endif
1997
1998 if(t.lt.FT5(ip)) goto 200
1999 rap0=rap(ip)
2000 eta0=eta(ip)
2001 x0=GX5(ip)+vx(ip)*(t-FT5(ip))
2002 y0=GY5(ip)+vy(ip)*(t-FT5(ip))
2003 detdy=0d0
2004 do 100 itest=1,mul
2005
2006 if(itest.eq.ip.or.t.lt.FT5(itest)) goto 100
2007 ettest=eta(itest)
2008 xtest=GX5(itest)+vx(itest)*(t-FT5(itest))
2009 ytest=GY5(itest)+vy(itest)*(t-FT5(itest))
2010 drt=sqrt((xtest-x0)**2+(ytest-y0)**2)
2011
2012 if(dabs(ettest-eta0).le.1d0.and.drt.le.r0)
2013 1 detdy=detdy+dsqrt(PX5(itest)**2+PY5(itest)**2
2014 2 +XMASS5(itest)**2)*0.5d0
2015 100 continue
2016 detdy=detdy*(dcosh(eta0)**2)/(t*3.1416d0*r0**2*dcosh(rap0))
2017
2018 150 if(detdy.le.etcrit) then
2019 ifrz(ip)=1
2020 idfrz(ip)=ITYP5(ip)
2021 pxfrz(ip)=PX5(ip)
2022 pyfrz(ip)=PY5(ip)
2023 pzfrz(ip)=PZ5(ip)
2024 efrz(ip)=E5(ip)
2025 xmfrz(ip)=XMASS5(ip)
2026 if(t.gt.FT5(ip)) then
2027 gxfrz(ip)=x0
2028 gyfrz(ip)=y0
2029 gzfrz(ip)=GZ5(ip)+vz(ip)*(t-FT5(ip))
2030 ftfrz(ip)=t
2031 else
2032
2033
2034 gxfrz(ip)=GX5(ip)
2035 gyfrz(ip)=GY5(ip)
2036 gzfrz(ip)=GZ5(ip)
2037 ftfrz(ip)=FT5(ip)
2038 endif
2039 endif
2040 200 continue
2041
2042 return
2043 end
2044
2045
2046
2047 subroutine inifrz
2048
2049 implicit double precision (a-h, o-z)
2050 PARAMETER (MAXPTN=400001)
2051 common /ilist5/ ct(MAXPTN), ot(MAXPTN), tlarge
2052
2053 common /frzprc/
2054 & gxfrz(MAXPTN), gyfrz(MAXPTN), gzfrz(MAXPTN), ftfrz(MAXPTN),
2055 & pxfrz(MAXPTN), pyfrz(MAXPTN), pzfrz(MAXPTN), efrz(MAXPTN),
2056 & xmfrz(MAXPTN),
2057 & tfrz(302), ifrz(MAXPTN), idfrz(MAXPTN), itlast
2058
2059 SAVE
2060
2061
2062
2063
2064
2065 step1=0.1d0
2066 step2=1d0
2067 step3=10d0
2068 step4=100d0
2069
2070 do 1001 it=1,101
2071 tfrz(it)=0d0+dble(it-1)*step1
2072 1001 continue
2073 do 1002 it=102,191
2074 tfrz(it)=10d0+dble(it-101)*step2
2075 1002 continue
2076 do 1003 it=192,281
2077 tfrz(it)=100d0+dble(it-191)*step3
2078 1003 continue
2079 do 1004 it=282,301
2080 tfrz(it)=1000d0+dble(it-281)*step4
2081 1004 continue
2082 tfrz(302)=tlarge
2083
2084 return
2085 end
2086
2087
2088
2089
2090 subroutine flowp(idd)
2091
2092 implicit double precision (a-h, o-z)
2093 real dt
2094 parameter (MAXPTN=400001)
2095
2096 parameter (bmt=0.05d0)
2097 dimension nlfile(3),nsfile(3),nmfile(3)
2098
2099 dimension v2pp(3),xnpp(3),v2psum(3),v2p2sm(3),nfile(3)
2100 dimension tsp(31),v2pevt(3),v2pavg(3),varv2p(3)
2101 common /ilist1/
2102 & iscat, jscat, next(MAXPTN), last(MAXPTN),
2103 & ictype, icsta(MAXPTN),
2104 & nic(MAXPTN), icels(MAXPTN)
2105
2106 COMMON /para1/ mul
2107
2108 COMMON /prec2/GX5(MAXPTN),GY5(MAXPTN),GZ5(MAXPTN),FT5(MAXPTN),
2109 & PX5(MAXPTN), PY5(MAXPTN), PZ5(MAXPTN), E5(MAXPTN),
2110 & XMASS5(MAXPTN), ITYP5(MAXPTN)
2111
2112 COMMON /pflow/ v2p(30,3),xnpart(30,3),etp(30,3),
2113 1 s2p(30,3),v2p2(30,3),nevt(30)
2114
2115 COMMON /pflowf/ v2pf(30,3),xnpf(30,3),etpf(30,3),
2116 1 xncoll(30),s2pf(30,3),v2pf2(30,3)
2117
2118 COMMON /pfrz/ v2pfrz(30,3),xnpfrz(30,3),etpfrz(30,3),
2119 1 s2pfrz(30,3),v2p2fz(30,3),tscatt(31),
2120 2 nevtfz(30),iscatt(30)
2121
2122 COMMON /hflow/ v2h(30,3),xnhadr(30,3),eth(30,3),
2123 1 v2h2(30,3),s2h(30,3)
2124
2125 COMMON /AREVT/ IAEVT, IARUN, MISS
2126
2127 common/anim/nevent,isoft,isflag,izpc
2128
2129 common/input1/ MASSPR,MASSTA,ISEED,IAVOID,DT
2130
2131 COMMON /INPUT2/ ILAB, MANYB, NTMAX, ICOLL, INSYS, IPOT, MODE,
2132 & IMOMEN, NFREQ, ICFLOW, ICRHO, ICOU, KPOTEN, KMUL
2133
2134
2135
2136 SAVE
2137
2138 dimension etpl(30,3),etps(30,3),etplf(30,3),etpsf(30,3),
2139 & etlfrz(30,3),etsfrz(30,3),
2140 & xnpl(30,3),xnps(30,3),xnplf(30,3),xnpsf(30,3),
2141 & xnlfrz(30,3),xnsfrz(30,3),
2142 & v2pl(30,3),v2ps(30,3),v2plf(30,3),v2psf(30,3),
2143 & s2pl(30,3),s2ps(30,3),s2plf(30,3),s2psf(30,3),
2144 & DMYil(50,3),DMYfl(50,3),
2145 & DMYis(50,3),DMYfs(50,3)
2146 data tsp/0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9,
2147 & 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9,
2148 & 2 , 3, 4, 5, 6, 7, 8, 9, 10, 20, 30/
2149
2150 if(idd.eq.0) then
2151 nfile(1)=60
2152 nfile(2)=64
2153 nfile(3)=20
2154 OPEN (nfile(1),FILE='ana1/v2p.dat', STATUS = 'UNKNOWN')
2155 OPEN (nfile(1)+1,
2156 1 FILE = 'ana1/v2p-formed.dat', STATUS = 'UNKNOWN')
2157 OPEN (nfile(1)+2,
2158 1 FILE = 'ana1/v2p-active.dat', STATUS = 'UNKNOWN')
2159 OPEN (nfile(1)+3,
2160 1 FILE = 'ana1/v2ph.dat', STATUS = 'UNKNOWN')
2161 OPEN (nfile(2),FILE='ana1/v2p-y2.dat', STATUS = 'UNKNOWN')
2162 OPEN (nfile(2)+1,
2163 1 FILE = 'ana1/v2p-formed2.dat', STATUS = 'UNKNOWN')
2164 OPEN (nfile(2)+2,
2165 1 FILE = 'ana1/v2p-active2.dat', STATUS = 'UNKNOWN')
2166 OPEN (nfile(2)+3,
2167 1 FILE = 'ana1/v2ph-y2.dat', STATUS = 'UNKNOWN')
2168 OPEN (nfile(3),FILE='ana1/v2p-y1.dat', STATUS = 'UNKNOWN')
2169 OPEN (nfile(3)+1,
2170 1 FILE = 'ana1/v2p-formed1.dat', STATUS = 'UNKNOWN')
2171 OPEN (nfile(3)+2,
2172 1 FILE = 'ana1/v2p-active1.dat', STATUS = 'UNKNOWN')
2173 OPEN (nfile(3)+3,
2174 1 FILE = 'ana1/v2ph-y1.dat', STATUS = 'UNKNOWN')
2175 OPEN (49, FILE = 'ana1/v2p-ebe.dat', STATUS = 'UNKNOWN')
2176 write(49, *) ' ievt, v2p, v2p_y2, v2p_y1'
2177
2178 OPEN (59, FILE = 'ana1/v2h.dat', STATUS = 'UNKNOWN')
2179 OPEN (68, FILE = 'ana1/v2h-y2.dat', STATUS = 'UNKNOWN')
2180 OPEN (69, FILE = 'ana1/v2h-y1.dat', STATUS = 'UNKNOWN')
2181 OPEN (88, FILE = 'ana1/v2h-ebe.dat', STATUS = 'UNKNOWN')
2182 write(88, *) ' ievt, v2h, v2h_y2, v2h_y1'
2183
2184 nlfile(1)=70
2185 nlfile(2)=72
2186 nlfile(3)=74
2187 OPEN (nlfile(1),FILE='ana1/mtl.dat', STATUS = 'UNKNOWN')
2188 OPEN (nlfile(1)+1,
2189 1 FILE = 'ana1/mtl-formed.dat', STATUS = 'UNKNOWN')
2190 OPEN (nlfile(2),FILE='ana1/mtl-y2.dat', STATUS = 'UNKNOWN')
2191 OPEN (nlfile(2)+1,
2192 1 FILE = 'ana1/mtl-formed2.dat', STATUS = 'UNKNOWN')
2193 OPEN (nlfile(3),FILE='ana1/mtl-y1.dat', STATUS = 'UNKNOWN')
2194 OPEN (nlfile(3)+1,
2195 1 FILE = 'ana1/mtl-formed1.dat', STATUS = 'UNKNOWN')
2196 nsfile(1)=76
2197 nsfile(2)=78
2198 nsfile(3)=80
2199 OPEN (nsfile(1),FILE='ana1/mts.dat', STATUS = 'UNKNOWN')
2200 OPEN (nsfile(1)+1,
2201 1 FILE = 'ana1/mts-formed.dat', STATUS = 'UNKNOWN')
2202 OPEN (nsfile(2),FILE='ana1/mts-y2.dat', STATUS = 'UNKNOWN')
2203 OPEN (nsfile(2)+1,
2204 1 FILE = 'ana1/mts-formed2.dat', STATUS = 'UNKNOWN')
2205 OPEN (nsfile(3),FILE='ana1/mts-y1.dat', STATUS = 'UNKNOWN')
2206 OPEN (nsfile(3)+1,
2207 1 FILE = 'ana1/mts-formed1.dat', STATUS = 'UNKNOWN')
2208 nmfile(1)=82
2209 nmfile(2)=83
2210 nmfile(3)=84
2211 OPEN (nmfile(1),FILE='ana1/Nmt.dat', STATUS = 'UNKNOWN')
2212 OPEN (nmfile(2),FILE='ana1/Nmt-y2.dat', STATUS = 'UNKNOWN')
2213 OPEN (nmfile(3),FILE='ana1/Nmt-y1.dat', STATUS = 'UNKNOWN')
2214
2215 if(nevent.eq.1) then
2216
2217
2218
2219 OPEN (93, FILE = 'ana1/p-finalft.dat', STATUS = 'UNKNOWN')
2220 endif
2221
2222 itimep=0
2223 itanim=0
2224 iaevtp=0
2225
2226 do 1002 ii=1,50
2227 do 1001 iy=1,3
2228 DMYil(ii,iy) = 0d0
2229 DMYfl(ii,iy) = 0d0
2230 DMYis(ii,iy) = 0d0
2231 DMYfs(ii,iy) = 0d0
2232 1001 continue
2233 1002 continue
2234
2235 do 1003 ii=1,31
2236 tscatt(ii)=0d0
2237 1003 continue
2238 do 1005 ii=1,30
2239 nevt(ii)=0
2240 xncoll(ii)=0d0
2241 nevtfz(ii)=0
2242 iscatt(ii)=0
2243 do 1004 iy=1,3
2244 v2p(ii,iy)=0d0
2245 v2p2(ii,iy)=0d0
2246 s2p(ii,iy)=0d0
2247 etp(ii,iy)=0d0
2248 xnpart(ii,iy)=0d0
2249 v2pf(ii,iy)=0d0
2250 v2pf2(ii,iy)=0d0
2251 s2pf(ii,iy)=0d0
2252 etpf(ii,iy)=0d0
2253 xnpf(ii,iy)=0d0
2254 v2pfrz(ii,iy)=0d0
2255 v2p2fz(ii,iy)=0d0
2256 s2pfrz(ii,iy)=0d0
2257 etpfrz(ii,iy)=0d0
2258 xnpfrz(ii,iy)=0d0
2259
2260 etpl(ii,iy)=0d0
2261 etps(ii,iy)=0d0
2262 etplf(ii,iy)=0d0
2263 etpsf(ii,iy)=0d0
2264 etlfrz(ii,iy)=0d0
2265 etsfrz(ii,iy)=0d0
2266 xnpl(ii,iy)=0d0
2267 xnps(ii,iy)=0d0
2268 xnplf(ii,iy)=0d0
2269 xnpsf(ii,iy)=0d0
2270 xnlfrz(ii,iy)=0d0
2271 xnsfrz(ii,iy)=0d0
2272 v2pl(ii,iy)=0d0
2273 v2ps(ii,iy)=0d0
2274 v2plf(ii,iy)=0d0
2275 v2psf(ii,iy)=0d0
2276 s2pl(ii,iy)=0d0
2277 s2ps(ii,iy)=0d0
2278 s2plf(ii,iy)=0d0
2279 s2psf(ii,iy)=0d0
2280 1004 continue
2281 1005 continue
2282 do 1006 iy=1,3
2283 v2pevt(iy)=0d0
2284 v2pavg(iy)=0d0
2285 varv2p(iy)=0d0
2286 v2pp(iy)=0.d0
2287 xnpp(iy)=0d0
2288 v2psum(iy)=0.d0
2289 v2p2sm(iy)=0.d0
2290 1006 continue
2291
2292 else if(idd.eq.1) then
2293 t2time = FT5(iscat)
2294 do 1008 ianp = 1, 30
2295 if (t2time.lt.tsp(ianp+1).and.t2time.ge.tsp(ianp)) then
2296
2297 xncoll(ianp)=xncoll(ianp)+1d0
2298
2299
2300 if(ianp.le.itimep.and.iaevt.eq.iaevtp) goto 101
2301 nevt(ianp)=nevt(ianp)+1
2302 tscatt(ianp+1)=t2time
2303 iscatt(ianp)=1
2304 nevtfz(ianp)=nevtfz(ianp)+1
2305 do 100 I=1,mul
2306 ypartn=0.5d0*dlog((E5(i)+PZ5(i))/(E5(i)-PZ5(i)+1.d-8))
2307 pt2=PX5(I)**2+PY5(I)**2
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338 iloop=1
2339 if(dabs(ypartn).le.1d0) then
2340 iloop=2
2341 if(dabs(ypartn).le.0.5d0) then
2342 iloop=3
2343 endif
2344 endif
2345 do 50 iy=1,iloop
2346
2347
2348 if(pt2.gt.0d0) then
2349 v2prtn=(PX5(I)**2-PY5(I)**2)/pt2
2350
2351
2352 if(dabs(v2prtn).gt.1d0)
2353 1 write(nfile(iy),*) 'v2prtn>1',v2prtn
2354 v2p(ianp,iy)=v2p(ianp,iy)+v2prtn
2355 v2p2(ianp,iy)=v2p2(ianp,iy)+v2prtn**2
2356 endif
2357 xperp2=GX5(I)**2+GY5(I)**2
2358
2359
2360 if(xperp2.gt.0d0)
2361 1 s2p(ianp,iy)=s2p(ianp,iy)+(GX5(I)**2-GY5(I)**2)/xperp2
2362 xnpart(ianp,iy)=xnpart(ianp,iy)+1d0
2363 etp(ianp,iy)=etp(ianp,iy)+dsqrt(pt2+XMASS5(I)**2)
2364
2365
2366
2367
2368 if(FT5(I).le.t2time) then
2369 v2pf(ianp,iy)=v2pf(ianp,iy)+v2prtn
2370 v2pf2(ianp,iy)=v2pf2(ianp,iy)+v2prtn**2
2371
2372
2373 if(xperp2.gt.0d0)
2374 1 s2pf(ianp,iy)=s2pf(ianp,iy)+(GX5(I)**2-GY5(I)**2)/xperp2
2375 xnpf(ianp,iy)=xnpf(ianp,iy)+1d0
2376 etpf(ianp,iy)=etpf(ianp,iy)+dsqrt(pt2+XMASS5(I)**2)
2377
2378
2379
2380 endif
2381 50 continue
2382 100 continue
2383 itimep=ianp
2384 iaevtp=iaevt
2385
2386 if(ianp.eq.30) then
2387 do 1007 iy=1,3
2388 npartn=IDINT(xnpart(ianp,iy)-xnpp(iy))
2389 if(npartn.ne.0) then
2390 v2pevt(iy)=(v2p(ianp,iy)-v2pp(iy))/npartn
2391 v2psum(iy)=v2psum(iy)+v2pevt(iy)
2392 v2p2sm(iy)=v2p2sm(iy)+v2pevt(iy)**2
2393 v2pp(iy)=v2p(ianp,iy)
2394 xnpp(iy)=xnpart(ianp,iy)
2395 endif
2396 1007 continue
2397 write(49, 160) iaevt,v2pevt
2398 endif
2399 goto 101
2400 endif
2401 1008 continue
2402
2403 101 if(nevent.eq.1) then
2404 do 110 nt = 1, ntmax
2405 time1=dble(nt*dt)
2406 time2=dble((nt+1)*dt)
2407 if (t2time.lt.time2.and.t2time.ge.time1) then
2408 if(nt.le.itanim) return
2409
2410 iform=0
2411 do 1009 I=1,mul
2412
2413 if(FT5(I).le.t2time) then
2414 iform=iform+1
2415 endif
2416 1009 continue
2417
2418 do 120 I=1,mul
2419 if(FT5(I).le.t2time) then
2420
2421
2422
2423
2424
2425
2426
2427
2428 endif
2429 120 continue
2430 itanim=nt
2431 endif
2432 110 continue
2433 endif
2434
2435 140 format(i10,4(2x,f7.2))
2436 160 format(i10,3(2x,f9.5))
2437
2438
2439
2440 else if(idd.eq.3) then
2441 do 1010 ianp=1,30
2442 if(iscatt(ianp).eq.0) tscatt(ianp+1)=tscatt(ianp)
2443 1010 continue
2444 do 350 I=1,mul
2445 ypartn=0.5d0*dlog((E5(i)+PZ5(i)+1.d-8)
2446 1 /(E5(i)-PZ5(i)+1.d-8))
2447 pt2=PX5(I)**2+PY5(I)**2
2448 iloop=1
2449 if(dabs(ypartn).le.1d0) then
2450 iloop=2
2451 if(dabs(ypartn).le.0.5d0) then
2452 iloop=3
2453 endif
2454 endif
2455
2456 do 325 ianp=1,30
2457 if(iscatt(ianp).ne.0) then
2458 if(FT5(I).lt.tscatt(ianp+1)
2459 1 .and.FT5(I).ge.tscatt(ianp)) then
2460 do 1011 iy=1,iloop
2461
2462
2463 if(pt2.gt.0d0) then
2464 v2prtn=(PX5(I)**2-PY5(I)**2)/pt2
2465 v2pfrz(ianp,iy)=v2pfrz(ianp,iy)+v2prtn
2466 v2p2fz(ianp,iy)=v2p2fz(ianp,iy)+v2prtn**2
2467 endif
2468 xperp2=GX5(I)**2+GY5(I)**2
2469
2470
2471 if(xperp2.gt.0d0) s2pfrz(ianp,iy)=
2472 1 s2pfrz(ianp,iy)+(GX5(I)**2-GY5(I)**2)/xperp2
2473 etpfrz(ianp,iy)=etpfrz(ianp,iy)+dsqrt(pt2+XMASS5(I)**2)
2474 xnpfrz(ianp,iy)=xnpfrz(ianp,iy)+1d0
2475
2476
2477
2478
2479 if(ITYP5(I).eq.1.or.ITYP5(I).eq.2)then
2480 etlfrz(ianp,iy)=etlfrz(ianp,iy)+dsqrt(pt2+XMASS5(I)**2)
2481 xnlfrz(ianp,iy)=xnlfrz(ianp,iy)+1d0
2482 elseif(ITYP5(I).eq.3)then
2483 etsfrz(ianp,iy)=etsfrz(ianp,iy)+dsqrt(pt2+XMASS5(I)**2)
2484 xnsfrz(ianp,iy)=xnsfrz(ianp,iy)+1d0
2485 endif
2486
2487 1011 continue
2488
2489 goto 350
2490 endif
2491 endif
2492 325 continue
2493 350 continue
2494
2495 else if(idd.eq.2) then
2496 do 1012 i=1,3
2497 write(nfile(i),*) ' tsp, v2p, v2p2, '//
2498 1 ' s2p, etp, xmult, nevt, xnctot'
2499 write ((nfile(i)+1),*) ' tsp, v2pf, v2pf2, '//
2500 1 ' s2pf, etpf, xnform, xcrate'
2501 write ((nfile(i)+2),*) ' tsp, v2pa, v2pa2, '//
2502 1 ' s2pa, etpa, xmult_ap, xnform, nevt'
2503 write ((nfile(i)+3),*) ' tsph, v2ph, v2ph2, '//
2504 1 ' s2ph, etph, xmult_(ap/2+h),xmult_ap/2,nevt'
2505
2506 write(nlfile(i),*) ' tsp, v2, s2, etp, xmul'
2507 write(nsfile(i),*) ' tsp, v2, s2, etp, xmul'
2508 write(nlfile(i)+1,*) ' tsp, v2, s2, etp, xmul'
2509 write(nsfile(i)+1,*) ' tsp, v2, s2, etp, xmul'
2510
2511 1012 continue
2512
2513 do 150 ii=1, 30
2514 if(nevt(ii).eq.0) goto 150
2515 do 1014 iy=1,3
2516
2517
2518 if(xnpart(ii,iy).gt.1d0) then
2519 v2p(ii,iy)=v2p(ii,iy)/xnpart(ii,iy)
2520 v2p2(ii,iy)=dsqrt((v2p2(ii,iy)/xnpart(ii,iy)
2521 1 -v2p(ii,iy)**2)/(xnpart(ii,iy)-1))
2522 s2p(ii,iy)=s2p(ii,iy)/xnpart(ii,iy)
2523
2524 xmult=dble(xnpart(ii,iy)/dble(nevt(ii)))
2525 etp(ii,iy)=etp(ii,iy)/dble(nevt(ii))
2526
2527 etpl(ii,iy)=etpl(ii,iy)/dble(nevt(ii))
2528 etps(ii,iy)=etps(ii,iy)/dble(nevt(ii))
2529
2530 xnctot=0d0
2531 do 1013 inum=1,ii
2532 xnctot=xnctot+xncoll(inum)
2533 1013 continue
2534 if(nevt(1).ne.0) xnctot=xnctot/nevt(1)
2535 write (nfile(iy),200) tsp(ii),v2p(ii,iy),
2536 1 v2p2(ii,iy),s2p(ii,iy),etp(ii,iy),xmult,nevt(ii),xnctot
2537 endif
2538 if(nevt(ii).ne.0)
2539 1 xcrate=xncoll(ii)/(tsp(ii+1)-tsp(ii))/nevt(ii)
2540
2541
2542
2543 if(xnpf(ii,iy).gt.1d0) then
2544 v2pf(ii,iy)=v2pf(ii,iy)/xnpf(ii,iy)
2545 v2pf2(ii,iy)=dsqrt((v2pf2(ii,iy)/xnpf(ii,iy)
2546 1 -v2pf(ii,iy)**2)/(xnpf(ii,iy)-1))
2547 s2pf(ii,iy)=s2pf(ii,iy)/xnpf(ii,iy)
2548 xnform=dble(xnpf(ii,iy)/dble(nevt(ii)))
2549 etpf(ii,iy)=etpf(ii,iy)/dble(nevt(ii))
2550
2551 etplf(ii,iy)=etplf(ii,iy)/dble(nevt(ii))
2552 etpsf(ii,iy)=etpsf(ii,iy)/dble(nevt(ii))
2553
2554 write (nfile(iy)+1, 210) tsp(ii),v2pf(ii,iy),
2555 1 v2pf2(ii,iy),s2pf(ii,iy),etpf(ii,iy),xnform,xcrate
2556 endif
2557
2558
2559
2560 if(xnpl(ii,iy).gt.1d0) then
2561 v2pl(ii,iy)=v2pl(ii,iy)/xnpl(ii,iy)
2562 s2pl(ii,iy)=s2pl(ii,iy)/xnpl(ii,iy)
2563 xmult=dble(xnpl(ii,iy)/dble(nevt(ii)))
2564 etpl(ii,iy)=etpl(ii,iy)/dble(nevt(ii))
2565 write (nlfile(iy),201) tsp(ii),v2pl(ii,iy),
2566 1 s2pl(ii,iy),etpl(ii,iy),xmult
2567 endif
2568
2569
2570 if(xnps(ii,iy).gt.1d0) then
2571 v2ps(ii,iy)=v2ps(ii,iy)/xnps(ii,iy)
2572 s2ps(ii,iy)=s2ps(ii,iy)/xnps(ii,iy)
2573 xmult=dble(xnps(ii,iy)/dble(nevt(ii)))
2574 etps(ii,iy)=etps(ii,iy)/dble(nevt(ii))
2575 write (nsfile(iy),201) tsp(ii),v2ps(ii,iy),
2576 1 s2ps(ii,iy),etps(ii,iy),xmult
2577 endif
2578
2579
2580 if(xnplf(ii,iy).gt.1d0) then
2581 v2plf(ii,iy)=v2plf(ii,iy)/xnplf(ii,iy)
2582 s2plf(ii,iy)=s2plf(ii,iy)/xnplf(ii,iy)
2583 xmult=dble(xnplf(ii,iy)/dble(nevt(ii)))
2584 etplf(ii,iy)=etplf(ii,iy)/dble(nevt(ii))
2585 write (nlfile(iy)+1,201) tsp(ii),v2plf(ii,iy),
2586 1 s2plf(ii,iy),etplf(ii,iy),xmult
2587 endif
2588
2589
2590 if(xnpsf(ii,iy).gt.1d0) then
2591 v2psf(ii,iy)=v2psf(ii,iy)/xnpsf(ii,iy)
2592 s2psf(ii,iy)=s2psf(ii,iy)/xnpsf(ii,iy)
2593 xmult=dble(xnpsf(ii,iy)/dble(nevt(ii)))
2594 etpsf(ii,iy)=etpsf(ii,iy)/dble(nevt(ii))
2595 write (nsfile(iy)+1,201) tsp(ii),v2psf(ii,iy),
2596 1 s2psf(ii,iy),etpsf(ii,iy),xmult
2597 endif
2598
2599 1014 continue
2600 150 continue
2601
2602 scalei=0d0
2603 scalef=0d0
2604 if(nevt(1).ne.0) SCALEi = 1d0 / dble(nevt(1)) / BMT
2605 if(nevt(30).ne.0) SCALEf = 1d0 / dble(nevt(30)) / BMT
2606 do 1016 iy=2,3
2607 yra = 1d0
2608 if(iy .eq. 2)yra = 2d0
2609 do 1015 i=1,50
2610 WRITE(nmfile(iy),251) BMT*dble(I - 0.5),
2611 & SCALEi*DMYil(I,iy)/yra, SCALEf*DMYfl(I,iy)/yra,
2612 & SCALEi*DMYis(I,iy)/yra, SCALEf*DMYfs(I,iy)/yra
2613 1015 continue
2614 1016 continue
2615
2616
2617 if(nevt(30).ge.1) then
2618 do 1017 iy=1,3
2619 v2pavg(iy)=v2psum(iy)/nevt(30)
2620 v2var0=v2p2sm(iy)/nevt(30)-v2pavg(iy)**2
2621
2622
2623 if(v2var0.gt.0d0) varv2p(iy)=dsqrt(v2var0)
2624 1017 continue
2625 write(49, 240) 'EBE v2p,v2p(y2),v2p(y1): avg=', v2pavg
2626 write(49, 240) 'EBE v2p,v2p(y2),v2p(y1): var=', varv2p
2627 endif
2628
2629 if(nevent.eq.1) then
2630 do 1018 I=1,mul
2631 if(FT5(I).le.t2time) then
2632 write(93,140) ITYP5(i),GX5(i),GY5(i),GZ5(i),FT5(i)
2633 endif
2634 1018 continue
2635
2636
2637
2638
2639
2640
2641
2642 close (93)
2643 endif
2644
2645 do 450 ianp=1,30
2646 do 400 iy=1,3
2647 v2pact=0d0
2648 v2p2ac=0d0
2649 s2pact=0d0
2650 etpact=0d0
2651 xnacti=0d0
2652
2653
2654 if(xnpf(ianp,iy).gt.1d0) then
2655
2656 v2pact=v2pf(ianp,iy)*xnpf(ianp,iy)
2657 v2p2ac=(v2pf2(ianp,iy)**2*(xnpf(ianp,iy)-1)
2658 1 +v2pf(ianp,iy)**2)*xnpf(ianp,iy)
2659 s2pact=s2pf(ianp,iy)*xnpf(ianp,iy)
2660 etpact=etpf(ianp,iy)*dble(nevt(ianp))
2661 xnpact=xnpf(ianp,iy)
2662
2663 do 1019 kanp=1,ianp
2664 v2pact=v2pact-v2pfrz(kanp,iy)
2665 v2p2ac=v2p2ac-v2p2fz(kanp,iy)
2666 s2pact=s2pact-s2pfrz(kanp,iy)
2667 etpact=etpact-etpfrz(kanp,iy)
2668 xnpact=xnpact-xnpfrz(kanp,iy)
2669 1019 continue
2670
2671 v2ph=v2pact
2672 v2ph2=v2p2ac
2673 s2ph=s2pact
2674 etph=etpact
2675 xnp2=xnpact/2d0
2676
2677
2678
2679 if(xnpact.gt.1d0.and.nevt(ianp).ne.0) then
2680 v2pact=v2pact/xnpact
2681 v2p2ac=dsqrt((v2p2ac/xnpact
2682 1 -v2pact**2)/(xnpact-1))
2683 s2pact=s2pact/xnpact
2684 xnacti=dble(xnpact/dble(nevt(ianp)))
2685 etpact=etpact/dble(nevt(ianp))
2686 write (nfile(iy)+2, 250) tsp(ianp),v2pact,
2687 1 v2p2ac,s2pact,etpact,xnacti,
2688 2 xnpf(ianp,iy)/dble(nevt(ianp)),nevt(ianp)
2689 endif
2690 endif
2691
2692
2693
2694 shadr=dble(nevt(ianp))/dble(nevent)
2695 ianh=ianp
2696 v2ph=v2ph+v2h(ianh,iy)*xnhadr(ianh,iy)*shadr
2697 v2ph2=v2ph2+(v2h2(ianh,iy)**2*(xnhadr(ianh,iy)-1)
2698 1 +v2h(ianh,iy)**2)*xnhadr(ianh,iy)*shadr
2699 s2ph=s2ph+s2h(ianh,iy)*xnhadr(ianh,iy)*shadr
2700 etph=etph+eth(ianh,iy)*dble(nevent)*shadr
2701 xnph=xnpact+xnhadr(ianh,iy)*shadr
2702 xnp2h=xnp2+xnhadr(ianh,iy)*shadr
2703
2704
2705 if(xnph.gt.1d0) then
2706 v2ph=v2ph/xnph
2707 v2ph2=dsqrt((v2ph2/xnph-v2ph**2)/(xnph-1))
2708 s2ph=s2ph/xnph
2709 etph=etph/dble(nevt(ianp))
2710 xnp2=xnp2/dble(nevt(ianp))
2711 xnp2h=xnp2h/dble(nevent)
2712 if(tsp(ianp).le.(ntmax*dt))
2713 1 write (nfile(iy)+3, 250) tsp(ianp),v2ph,
2714 2 v2ph2,s2ph,etph,xnp2h,xnp2,nevt(ianp)
2715 endif
2716
2717 400 continue
2718 450 continue
2719 do 550 ianp=1,30
2720 do 500 iy=1,3
2721 v2pact=0d0
2722 v2p2ac=0d0
2723 s2pact=0d0
2724 etpact=0d0
2725 xnacti=0d0
2726
2727 v2pact=v2pf(ianp,iy)*xnpf(ianp,iy)
2728 v2p2ac=(v2pf2(ianp,iy)**2*(xnpf(ianp,iy)-1)
2729 1 +v2pf(ianp,iy)**2)*xnpf(ianp,iy)
2730 s2pact=s2pf(ianp,iy)*xnpf(ianp,iy)
2731 etpact=etpf(ianp,iy)*dble(nevt(ianp))
2732 xnpact=xnpf(ianp,iy)
2733 500 continue
2734 550 continue
2735 close (620)
2736 close (630)
2737 do 1021 nf=1,3
2738 do 1020 ifile=0,3
2739 close(nfile(nf)+ifile)
2740 1020 continue
2741 1021 continue
2742 do 1022 nf=1,3
2743 close(740+nf)
2744 1022 continue
2745 endif
2746 200 format(2x,f5.2,3(2x,f7.4),2(2x,f9.2),i6,2x,f9.2)
2747 210 format(2x,f5.2,3(2x,f7.4),3(2x,f9.2))
2748 240 format(a30,3(2x,f9.5))
2749 250 format(2x,f5.2,3(2x,f7.4),3(2x,f9.2),i6)
2750
2751 201 format(2x,f5.2,4(2x,f9.2))
2752 251 format(5e15.5)
2753
2754 return
2755 end
2756
2757
2758
2759
2760 subroutine flowh(ct)
2761 PARAMETER (MAXSTR=150001, MAXR=1)
2762 dimension tsh(31)
2763 DOUBLE PRECISION v2h,xnhadr,eth,v2h2,s2h
2764 DOUBLE PRECISION v2hp,xnhadp,v2hsum,v2h2sm,v2hevt(3)
2765 DOUBLE PRECISION pt2, v2hadr
2766 COMMON /hflow/ v2h(30,3),xnhadr(30,3),eth(30,3),
2767 1 v2h2(30,3),s2h(30,3)
2768
2769 common/ebe/v2hp(3),xnhadp(3),v2hsum(3),v2h2sm(3)
2770
2771 common /lastt/itimeh,bimp
2772
2773 COMMON /RUN/ NUM
2774
2775 COMMON /AA/ R(3,MAXSTR)
2776
2777 COMMON /BB/ P(3,MAXSTR)
2778
2779 COMMON /CC/ E(MAXSTR)
2780
2781 COMMON /EE/ ID(MAXSTR),LB(MAXSTR)
2782
2783 COMMON /RR/ MASSR(0:MAXR)
2784
2785 common/anim/nevent,isoft,isflag,izpc
2786
2787 COMMON /AREVT/ IAEVT, IARUN, MISS
2788
2789 SAVE
2790
2791 do 1001 ii = 1, 31
2792 tsh(ii)=float(ii-1)
2793 1001 continue
2794
2795 do 1004 ianh = 1, 30
2796 if ((ct+0.0001).lt.tsh(ianh+1)
2797 1 .and.(ct+0.0001).ge.tsh(ianh)) then
2798 if(ianh.eq.itimeh) goto 101
2799 IA = 0
2800 DO 1002 J = 1, NUM
2801 mult=MASSR(J)
2802 IA = IA + MASSR(J - 1)
2803 DO 100 IC = 1, mult
2804 I = IA + IC
2805
2806 if(iabs(LB(I)-10000).lt.100) goto 100
2807 px=p(1,i)
2808 py=p(2,i)
2809 pt2=dble(px)**2+dble(py)**2
2810
2811 ene=sqrt(e(i)**2+sngl(pt2)+p(3,i)**2)
2812 RAP=0.5*alog((ene+p(3,i))/(ene-p(3,i)))
2813
2814
2815
2816
2817
2818
2819
2820 iloop=1
2821 if(abs(rap).le.1) then
2822 iloop=2
2823 if(abs(rap).le.0.5) then
2824 iloop=3
2825 endif
2826 endif
2827 do 50 iy=1,iloop
2828 if(pt2.gt.0d0) then
2829 v2hadr=(dble(px)**2-dble(py)**2)/pt2
2830 v2h(ianh,iy)=v2h(ianh,iy)+v2hadr
2831 v2h2(ianh,iy)=v2h2(ianh,iy)+v2hadr**2
2832 if(dabs(v2hadr).gt.1d0)
2833 1 write(1,*) 'v2hadr>1',v2hadr,px,py
2834 endif
2835 xperp2=r(1,I)**2+r(2,I)**2
2836 if(xperp2.gt.0.)
2837 1 s2h(ianh,iy)=s2h(ianh,iy)+dble((r(1,I)**2-r(2,I)**2)/xperp2)
2838 eth(ianh,iy)=eth(ianh,iy)+dble(SQRT(e(i)**2+sngl(pt2)))
2839
2840
2841
2842 xnhadr(ianh,iy)=xnhadr(ianh,iy)+1d0
2843 50 continue
2844 100 continue
2845 1002 CONTINUE
2846 itimeh=ianh
2847
2848 if(ianh.eq.30) then
2849 do 1003 iy=1,3
2850 nhadrn=IDINT(xnhadr(ianh,iy)-xnhadp(iy))
2851 if(nhadrn.ne.0) then
2852 v2hevt(iy)=(v2h(ianh,iy)-v2hp(iy))/dble(nhadrn)
2853 v2hsum(iy)=v2hsum(iy)+v2hevt(iy)
2854 v2h2sm(iy)=v2h2sm(iy)+v2hevt(iy)**2
2855 v2hp(iy)=v2h(ianh,iy)
2856 xnhadp(iy)=xnhadr(ianh,iy)
2857 endif
2858 1003 continue
2859 write(88, 160) iaevt,v2hevt
2860 endif
2861 goto 101
2862 endif
2863 1004 continue
2864 160 format(i10,3(2x,f9.5))
2865
2866 101 if(nevent.eq.1) then
2867 IA = 0
2868 do 1005 J = 1, NUM
2869 mult=MASSR(J)
2870 IA = IA + MASSR(J - 1)
2871
2872
2873 DO 150 IC = 1, mult
2874 I = IA + IC
2875
2876
2877 150 continue
2878 1005 continue
2879 return
2880 endif
2881
2882 return
2883 end
2884
2885
2886 subroutine flowh0(NEVNT,idd)
2887
2888 dimension tsh(31)
2889 DOUBLE PRECISION v2h,xnhadr,eth,v2h2,s2h
2890 DOUBLE PRECISION v2hp,xnhadp,v2hsum,v2h2sm,
2891 1 v2havg(3),varv2h(3)
2892 COMMON /hflow/ v2h(30,3),xnhadr(30,3),eth(30,3),
2893 1 v2h2(30,3),s2h(30,3)
2894
2895 common/ebe/v2hp(3),xnhadp(3),v2hsum(3),v2h2sm(3)
2896
2897 common/input1/ MASSPR,MASSTA,ISEED,IAVOID,DT
2898
2899 COMMON /INPUT2/ ILAB, MANYB, NTMAX, ICOLL, INSYS, IPOT, MODE,
2900 & IMOMEN, NFREQ, ICFLOW, ICRHO, ICOU, KPOTEN, KMUL
2901
2902 common /lastt/itimeh,bimp
2903
2904 SAVE
2905
2906
2907 if(idd.eq.0) then
2908 itimeh=0
2909
2910 do 1001 ii = 1, 31
2911 tsh(ii)=float(ii-1)
2912 1001 continue
2913
2914 do 1003 ii=1,30
2915 do 1002 iy=1,3
2916 v2h(ii,iy)=0d0
2917 xnhadr(ii,iy)=0d0
2918 eth(ii,iy)=0d0
2919 v2h2(ii,iy)=0d0
2920 s2h(ii,iy)=0d0
2921 1002 continue
2922 1003 continue
2923 do 1004 iy=1,3
2924 v2hp(iy)=0d0
2925 xnhadp(iy)=0d0
2926 v2hsum(iy)=0d0
2927 v2h2sm(iy)=0d0
2928 if(iy.eq.1) then
2929 nunit=59
2930 elseif(iy.eq.2) then
2931 nunit=68
2932 else
2933 nunit=69
2934 endif
2935 write(nunit,*) ' tsh, v2h, v2h2, s2h, '//
2936 1 ' eth, xmulth'
2937 1004 continue
2938
2939 else if(idd.eq.2) then
2940 do 100 ii=1, 30
2941 do 1005 iy=1,3
2942 if(xnhadr(ii,iy).eq.0) then
2943 xmulth=0.
2944 elseif(xnhadr(ii,iy).gt.1) then
2945 v2h(ii,iy)=v2h(ii,iy)/xnhadr(ii,iy)
2946 eth(ii,iy)=eth(ii,iy)/dble(NEVNT)
2947 v2h2(ii,iy)=dsqrt((v2h2(ii,iy)/xnhadr(ii,iy)
2948 1 -v2h(ii,iy)**2)/(xnhadr(ii,iy)-1))
2949 s2h(ii,iy)=s2h(ii,iy)/xnhadr(ii,iy)
2950 xmulth=sngl(xnhadr(ii,iy)/NEVNT)
2951 endif
2952 if(iy.eq.1) then
2953 nunit=59
2954 elseif(iy.eq.2) then
2955 nunit=68
2956 else
2957 nunit=69
2958 endif
2959 if(tsh(ii).le.(ntmax*dt))
2960 1 write (nunit,200) tsh(ii),v2h(ii,iy),
2961 2 v2h2(ii,iy),s2h(ii,iy),eth(ii,iy),xmulth
2962 1005 continue
2963 100 continue
2964
2965 do 1006 iy=1,3
2966 v2havg(iy)=v2hsum(iy)/dble(NEVNT)
2967 varv2h(iy)=dsqrt(v2h2sm(iy)/dble(NEVNT)-v2havg(iy)**2)
2968 1006 continue
2969 write(88, 240) 'EBE v2h,v2h(y2),v2h(y1): avg=', v2havg
2970 write(88, 240) 'EBE v2h,v2h(y2),v2h(y1): var=', varv2h
2971 endif
2972 200 format(2x,f5.2,3(2x,f7.4),2(2x,f9.2))
2973 240 format(a30,3(2x,f9.5))
2974 return
2975 end
2976
2977
2978
2979 subroutine iniflw(NEVNT,idd)
2980 PARAMETER (MAXSTR=150001, MAXR=1)
2981 DOUBLE PRECISION v2i,eti,xmulti,v2mi,s2mi,xmmult,
2982 1 v2bi,s2bi,xbmult
2983 COMMON /RUN/ NUM
2984
2985 COMMON /ARERC1/MULTI1(MAXR)
2986
2987 COMMON /ARPRC1/ITYP1(MAXSTR, MAXR),
2988 & GX1(MAXSTR, MAXR), GY1(MAXSTR, MAXR), GZ1(MAXSTR, MAXR),
2989 & FT1(MAXSTR, MAXR),
2990 & PX1(MAXSTR, MAXR), PY1(MAXSTR, MAXR), PZ1(MAXSTR, MAXR),
2991 & EE1(MAXSTR, MAXR), XM1(MAXSTR, MAXR)
2992
2993 COMMON/iflow/v2i,eti,xmulti,v2mi,s2mi,xmmult,v2bi,s2bi,xbmult
2994
2995 SAVE
2996
2997 if(idd.eq.0) then
2998 v2i=0d0
2999 eti=0d0
3000 xmulti=0d0
3001 v2mi=0d0
3002 s2mi=0d0
3003 xmmult=0d0
3004 v2bi=0d0
3005 s2bi=0d0
3006 xbmult=0d0
3007 else if(idd.eq.1) then
3008 do 1002 J = 1, NUM
3009 do 1001 I = 1, MULTI1(J)
3010 ITYP = ITYP1(I, J)
3011
3012 IF (ITYP .GT. -100 .AND. ITYP .LT. 100) GOTO 100
3013 xmulti=xmulti+1.d0
3014 PX = PX1(I, J)
3015 PY = PY1(I, J)
3016 XM = XM1(I, J)
3017 pt2=px**2+py**2
3018 xh=gx1(I,J)
3019 yh=gy1(I,J)
3020 xt2=xh**2+yh**2
3021 if(pt2.gt.0) v2i=v2i+dble((px**2-py**2)/pt2)
3022 eti=eti+dble(SQRT(PX ** 2 + PY ** 2 + XM ** 2))
3023
3024 IF (ITYP .LT. -1000 .or. ITYP .GT. 1000) then
3025 xbmult=xbmult+1.d0
3026 if(pt2.gt.0) v2bi=v2bi+dble((px**2-py**2)/pt2)
3027 if(xt2.gt.0) s2bi=s2bi+dble((xh**2-yh**2)/xt2)
3028
3029 else
3030 xmmult=xmmult+1.d0
3031 if(pt2.gt.0) v2mi=v2mi+dble((px**2-py**2)/pt2)
3032 if(xt2.gt.0) s2mi=s2mi+dble((xh**2-yh**2)/xt2)
3033 endif
3034 100 continue
3035 1001 continue
3036 1002 continue
3037 else if(idd.eq.2) then
3038 if(xmulti.ne.0) v2i=v2i/xmulti
3039 eti=eti/dble(NEVNT)
3040 xmulti=xmulti/dble(NEVNT)
3041 if(xmmult.ne.0) then
3042 v2mi=v2mi/xmmult
3043 s2mi=s2mi/xmmult
3044 endif
3045 xmmult=xmmult/dble(NEVNT)
3046 if(xbmult.ne.0) then
3047 v2bi=v2bi/xbmult
3048 s2bi=s2bi/xbmult
3049 endif
3050 xbmult=xbmult/dble(NEVNT)
3051 endif
3052
3053 return
3054 end
3055
3056
3057
3058
3059 subroutine frztm(NEVNT,idd)
3060
3061 implicit double precision (a-h, o-z)
3062 PARAMETER (MAXPTN=400001)
3063 dimension tsf(31)
3064 COMMON /PARA1/ MUL
3065
3066 COMMON /prec1/GX0(MAXPTN),GY0(MAXPTN),GZ0(MAXPTN),FT0(MAXPTN),
3067 & PX0(MAXPTN), PY0(MAXPTN), PZ0(MAXPTN), E0(MAXPTN),
3068 & XMASS0(MAXPTN), ITYP0(MAXPTN)
3069
3070 COMMON /prec2/GX5(MAXPTN),GY5(MAXPTN),GZ5(MAXPTN),FT5(MAXPTN),
3071 & PX5(MAXPTN), PY5(MAXPTN), PZ5(MAXPTN), E5(MAXPTN),
3072 & XMASS5(MAXPTN), ITYP5(MAXPTN)
3073
3074 COMMON /frzout/ xnprod(30),etprod(30),xnfrz(30),etfrz(30),
3075 & dnprod(30),detpro(30),dnfrz(30),detfrz(30)
3076
3077 SAVE
3078 data tsf/0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9,
3079 & 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9,
3080 & 2 , 3, 4, 5, 6, 7, 8, 9, 10, 20, 30/
3081
3082 if(idd.eq.0) then
3083 do 1001 ii=1,30
3084 xnprod(ii)=0d0
3085 etprod(ii)=0d0
3086 xnfrz(ii)=0d0
3087 etfrz(ii)=0d0
3088 dnprod(ii)=0d0
3089 detpro(ii)=0d0
3090 dnfrz(ii)=0d0
3091 detfrz(ii)=0d0
3092 1001 continue
3093 OPEN (86, FILE = 'ana1/production.dat', STATUS = 'UNKNOWN')
3094 OPEN (87, FILE = 'ana1/freezeout.dat', STATUS = 'UNKNOWN')
3095 else if(idd.eq.1) then
3096 DO 100 ip = 1, MUL
3097 do 1002 ii=1,30
3098 eth0=dSQRT(PX0(ip)**2+PY0(ip)**2+XMASS0(ip)**2)
3099 eth2=dSQRT(PX5(ip)**2+PY5(ip)**2+XMASS5(ip)**2)
3100
3101 if (ft0(ip).lt.tsf(ii+1)) then
3102 xnprod(ii)=xnprod(ii)+1d0
3103 etprod(ii)=etprod(ii)+eth0
3104
3105 if (ft0(ip).ge.tsf(ii)) then
3106 dnprod(ii)=dnprod(ii)+1d0
3107 detpro(ii)=detpro(ii)+eth0
3108 endif
3109 endif
3110
3111 if (FT5(ip).lt.tsf(ii+1)) then
3112 xnfrz(ii)=xnfrz(ii)+1d0
3113 etfrz(ii)=etfrz(ii)+eth2
3114
3115 if (FT5(ip).ge.tsf(ii)) then
3116 dnfrz(ii)=dnfrz(ii)+1d0
3117 detfrz(ii)=detfrz(ii)+eth2
3118 endif
3119 endif
3120 1002 continue
3121 100 continue
3122 else if(idd.eq.2) then
3123 write (86,*) ' t, np, dnp/dt, etp '//
3124 1 ' detp/dt'
3125 write (87,*) ' t, nf, dnf/dt, etf '//
3126 1 ' detf/dt'
3127 do 1003 ii=1,30
3128 xnp=xnprod(ii)/dble(NEVNT)
3129 xnf=xnfrz(ii)/dble(NEVNT)
3130 etp=etprod(ii)/dble(NEVNT)
3131 etf=etfrz(ii)/dble(NEVNT)
3132 dxnp=dnprod(ii)/dble(NEVNT)/(tsf(ii+1)-tsf(ii))
3133 dxnf=dnfrz(ii)/dble(NEVNT)/(tsf(ii+1)-tsf(ii))
3134 detp=detpro(ii)/dble(NEVNT)/(tsf(ii+1)-tsf(ii))
3135 detf=detfrz(ii)/dble(NEVNT)/(tsf(ii+1)-tsf(ii))
3136 write (86, 200)
3137 1 tsf(ii+1),xnp,dxnp,etp,detp
3138 write (87, 200)
3139 1 tsf(ii+1),xnf,dxnf,etf,detf
3140 1003 continue
3141 endif
3142 200 format(2x,f9.2,4(2x,f10.2))
3143
3144 return
3145 end
3146
3147
3148
3149
3150
3151
3152 subroutine minijet_out(BB,phiRP)
3153 PARAMETER (MAXSTR=150001)
3154 COMMON/HPARNT/HIPR1(100),IHPR2(50),HINT1(100),IHNT2(50)
3155 COMMON/hjcrdn/YP(3,300),YT(3,300)
3156 COMMON/HJJET1/NPJ(300),KFPJ(300,500),PJPX(300,500),
3157 & PJPY(300,500),PJPZ(300,500),PJPE(300,500),
3158 & PJPM(300,500),NTJ(300),KFTJ(300,500),
3159 & PJTX(300,500),PJTY(300,500),PJTZ(300,500),
3160 & PJTE(300,500),PJTM(300,500)
3161 COMMON/HJJET2/NSG,NJSG(MAXSTR),IASG(MAXSTR,3),K1SG(MAXSTR,100),
3162 & K2SG(MAXSTR,100),PXSG(MAXSTR,100),PYSG(MAXSTR,100),
3163 & PZSG(MAXSTR,100),PESG(MAXSTR,100),PMSG(MAXSTR,100)
3164 COMMON /AREVT/ IAEVT, IARUN, MISS
3165 common /para7/ ioscar,nsmbbbar,nsmmeson
3166 common/phidcy/iphidcy,pttrig,ntrig,maxmiss,ipi0dcy
3167 SAVE
3168 ntrig=0
3169 do I = 1, IHNT2(1)
3170 do J = 1, NPJ(I)
3171 pt=sqrt(PJPX(I,J)**2+PJPY(I,J)**2)
3172 if(pt.ge.pttrig) ntrig=ntrig+1
3173 enddo
3174 enddo
3175 do I = 1, IHNT2(3)
3176 do J = 1, NTJ(I)
3177 pt=sqrt(PJTX(I,J)**2+PJTY(I,J)**2)
3178 if(pt.ge.pttrig) ntrig=ntrig+1
3179 enddo
3180 enddo
3181 do I = 1, NSG
3182 do J = 1, NJSG(I)
3183 pt=sqrt(PXSG(I,J)**2+PYSG(I,J)**2)
3184 if(pt.ge.pttrig) ntrig=ntrig+1
3185 enddo
3186 enddo
3187
3188 if(ntrig.eq.0) return
3189
3190
3191 if(ioscar.eq.3) write(96,*) IAEVT,MISS,IHNT2(1),IHNT2(3)
3192 DO 1008 I = 1, IHNT2(1)
3193 DO 1007 J = 1, NPJ(I)
3194 ityp=KFPJ(I,J)
3195
3196
3197
3198
3199
3200 gx=YP(1,I)+0.5*BB*cos(phiRP)
3201 gy=YP(2,I)+0.5*BB*sin(phiRP)
3202 gz=0.
3203 ft=0.
3204 px=PJPX(I,J)
3205 py=PJPY(I,J)
3206 pz=PJPZ(I,J)
3207 xmass=PJPM(I,J)
3208 if(ioscar.eq.3) then
3209 if(amax1(abs(gx),abs(gy),
3210 1 abs(gz),abs(ft)).lt.9999) then
3211 write(96,200) ityp,px,py,pz,xmass,gx,gy,gz,ft,1
3212 else
3213 write(96,201) ityp,px,py,pz,xmass,gx,gy,gz,ft,1
3214 endif
3215 endif
3216 1007 CONTINUE
3217 1008 CONTINUE
3218 DO 1010 I = 1, IHNT2(3)
3219 DO 1009 J = 1, NTJ(I)
3220 ityp=KFTJ(I,J)
3221
3222
3223
3224
3225 gx=YT(1,I)-0.5*BB*cos(phiRP)
3226 gy=YT(2,I)-0.5*BB*sin(phiRP)
3227 gz=0.
3228 ft=0.
3229 px=PJTX(I,J)
3230 py=PJTY(I,J)
3231 pz=PJTZ(I,J)
3232 xmass=PJTM(I,J)
3233 if(ioscar.eq.3) then
3234 if(amax1(abs(gx),abs(gy),
3235 1 abs(gz),abs(ft)).lt.9999) then
3236 write(96,200) ityp,px,py,pz,xmass,gx,gy,gz,ft,2
3237 else
3238 write(96,201) ityp,px,py,pz,xmass,gx,gy,gz,ft,2
3239 endif
3240 endif
3241 1009 CONTINUE
3242 1010 CONTINUE
3243 DO 1012 I = 1, NSG
3244 DO 1011 J = 1, NJSG(I)
3245 ityp=K2SG(I,J)
3246
3247 gx=0.5*(YP(1,IASG(I,1))+YT(1,IASG(I,2)))
3248 gy=0.5*(YP(2,IASG(I,1))+YT(2,IASG(I,2)))
3249 gz=0.
3250 ft=0.
3251 px=PXSG(I,J)
3252 py=PYSG(I,J)
3253 pz=PZSG(I,J)
3254 xmass=PMSG(I,J)
3255 if(ioscar.eq.3) then
3256 if(amax1(abs(gx),abs(gy),
3257 1 abs(gz),abs(ft)).lt.9999) then
3258 write(96,200) ityp,px,py,pz,xmass,gx,gy,gz,ft,3
3259 else
3260 write(96,201) ityp,px,py,pz,xmass,gx,gy,gz,ft,3
3261 endif
3262 endif
3263 1011 CONTINUE
3264 1012 CONTINUE
3265 200 format(I6,2(1x,f8.3),1x,f10.3,1x,f6.3,2(1x,f8.2),2(2x,f2.0),2x,I2)
3266 201 format(I6,2(1x,f8.3),1x,f10.3,1x,f6.3,2(1x,e8.2),2(2x,f2.0),2x,I2)
3267
3268 return
3269 end
3270
3271
3272
3273
3274
3275
3276 subroutine embedHighPt
3277 PARAMETER (MAXSTR=150001,MAXR=1,pichmass=0.140,pi0mass=0.135,
3278 1 pi=3.1415926,nxymax=10001)
3279 common/embed/iembed,nsembd,pxqembd,pyqembd,xembd,yembd,
3280 1 psembd,tmaxembd,phidecomp
3281 COMMON/RNDF77/NSEED
3282 COMMON/HMAIN1/EATT,JATT,NATT,NT,NP,N0,N01,N10,N11
3283 COMMON/HMAIN2/KATT(MAXSTR,4),PATT(MAXSTR,4)
3284 COMMON /ARPRC/ ITYPAR(MAXSTR),
3285 & GXAR(MAXSTR), GYAR(MAXSTR), GZAR(MAXSTR), FTAR(MAXSTR),
3286 & PXAR(MAXSTR), PYAR(MAXSTR), PZAR(MAXSTR), PEAR(MAXSTR),
3287 & XMAR(MAXSTR)
3288 common/anim/nevent,isoft,isflag,izpc
3289 COMMON /AREVT/ IAEVT, IARUN, MISS
3290 common/xyembed/nxyjet,xyjet(nxymax,2)
3291 SAVE
3292
3293 if(iembed.eq.1.or.iembed.eq.2) then
3294 xjet=xembd
3295 yjet=yembd
3296 elseif(iembed.eq.3.or.iembed.eq.4) then
3297 if(nevent.le.nxyjet) then
3298 read(97,*) xjet,yjet
3299 else
3300 ixy=mod(IAEVT,nxyjet)
3301 if(ixy.eq.0) ixy=nxyjet
3302 xjet=xyjet(ixy,1)
3303 yjet=xyjet(ixy,2)
3304 endif
3305 else
3306 return
3307 endif
3308
3309 ptq=sqrt(pxqembd**2+pyqembd**2)
3310 if(ptq.lt.(pichmass/2.)) then
3311 print *, 'Embedded quark transverse momentum is too small'
3312 stop
3313 endif
3314
3315 idqembd=1+int(2*RANART(NSEED))
3316
3317 if(idqembd.eq.1) then
3318 idqsoft=-2
3319 idpi1=-211
3320 elseif(idqembd.eq.2) then
3321 idqsoft=-1
3322 idpi1=211
3323 else
3324 print *, 'Wrong quark flavor embedded'
3325 stop
3326 endif
3327
3328 xmq=ulmass(idqembd)
3329 xmqsoft=ulmass(idqsoft)
3330 ptpi=((pichmass**2+xmq**2-xmqsoft**2)*ptq
3331 1 -sqrt((xmq**2+ptq**2)*(pichmass**4
3332 2 -2.*pichmass**2*(xmq**2+xmqsoft**2)+(xmq**2-xmqsoft**2)**2)))
3333 3 /(2.*xmq**2)
3334 if(iembed.eq.1.or.iembed.eq.3) then
3335 pxpi1=ptpi*pxqembd/ptq
3336 pypi1=ptpi*pyqembd/ptq
3337 phidecomp=acos(pxqembd/ptq)
3338 if(pyqembd.lt.0) phidecomp=2.*pi-phidecomp
3339 else
3340 phidecomp=2.*pi*RANART(NSEED)
3341 pxpi1=ptpi*cos(phidecomp)
3342 pypi1=ptpi*sin(phidecomp)
3343 endif
3344
3345 pzpi1=0.
3346
3347
3348
3349 do ipion=1,2
3350 if(ipion.eq.1) then
3351 idpi=idpi1
3352 pxpi=pxpi1
3353 pypi=pypi1
3354 pzpi=pzpi1
3355 elseif(ipion.eq.2) then
3356 idpi=-idpi1
3357 pxpi=-pxpi1
3358 pypi=-pypi1
3359 pzpi=-pzpi1
3360 endif
3361 NATT=NATT+1
3362 KATT(NATT,1)=idpi
3363 KATT(NATT,2)=40
3364 KATT(NATT,3)=0
3365 PATT(NATT,1)=pxpi
3366 PATT(NATT,2)=pypi
3367 PATT(NATT,3)=pzpi
3368 PATT(NATT,4)=sqrt(pxpi**2+pypi**2+pzpi**2+pichmass**2)
3369 EATT=EATT+PATT(NATT,4)
3370 GXAR(NATT)=xjet
3371 GYAR(NATT)=yjet
3372 GZAR(NATT)=0.
3373 FTAR(NATT)=0.
3374 ITYPAR(NATT)=KATT(NATT,1)
3375 PXAR(NATT)=PATT(NATT,1)
3376 PYAR(NATT)=PATT(NATT,2)
3377 PZAR(NATT)=PATT(NATT,3)
3378 PEAR(NATT)=PATT(NATT,4)
3379 XMAR(NATT)=pichmass
3380 enddo
3381
3382
3383
3384 if(nsembd.gt.0) then
3385 do ipion=1,2
3386 do ispion=1,nsembd
3387 idsart=3+int(3*RANART(NSEED))
3388 if(idsart.eq.3) then
3389 pimass=pichmass
3390 idpis=-211
3391 elseif(idsart.eq.4) then
3392 pimass=pi0mass
3393 idpis=111
3394 else
3395 pimass=pichmass
3396 idpis=211
3397 endif
3398 NATT=NATT+1
3399 KATT(NATT,1)=idpis
3400 KATT(NATT,2)=40
3401 KATT(NATT,3)=0
3402
3403
3404
3405
3406 theta=tmaxembd*RANART(NSEED)
3407 phi=2.*pi*RANART(NSEED)
3408 pxspi=psembd*sin(theta)*cos(phi)
3409 pyspi=psembd*sin(theta)*sin(phi)
3410 pzspi=psembd*cos(theta)
3411 if(ipion.eq.1) then
3412 call rotate(pxpi1,pypi1,pzpi1,pxspi,pyspi,pzspi)
3413 else
3414 call rotate(-pxpi1,-pypi1,-pzpi1,pxspi,pyspi,pzspi)
3415 endif
3416
3417
3418 PATT(NATT,1)=pxspi
3419 PATT(NATT,2)=pyspi
3420 PATT(NATT,3)=pzspi
3421 PATT(NATT,4)=sqrt(psembd**2+pimass**2)
3422 EATT=EATT+PATT(NATT,4)
3423 GXAR(NATT)=xjet
3424 GYAR(NATT)=yjet
3425 GZAR(NATT)=0.
3426 FTAR(NATT)=0.
3427 ITYPAR(NATT)=KATT(NATT,1)
3428 PXAR(NATT)=PATT(NATT,1)
3429 PYAR(NATT)=PATT(NATT,2)
3430 PZAR(NATT)=PATT(NATT,3)
3431 PEAR(NATT)=PATT(NATT,4)
3432 XMAR(NATT)=pimass
3433 enddo
3434 enddo
3435 endif
3436
3437
3438 return
3439 end