1 c.................... linana.f
2 c=======================================================================
3 c 10/26/01 update freezeout positions in case of interactions:
4 clin-3/2009 Note: freezeout spacetime values cannot be trusted for K0S & K0L
5 c as K0S/K0L are converted from K+/K- by hand at the end of hadron cascade.
7 cms dlw & gsfs Commented out output file writing
9 subroutine hbtout(nnew,nt,ntmax)
11 PARAMETER (MAXSTR=150001,MAXR=1)
12 clin-5/2008 give tolerance to regular particles (perturbative probability 1):
13 PARAMETER (oneminus=0.99999,oneplus=1.00001)
14 dimension lastkp(MAXSTR), newkp(MAXSTR),xnew(3)
15 common /para7/ ioscar,nsmbbbar,nsmmeson
17 COMMON/hbt/lblast(MAXSTR),xlast(4,MAXSTR),plast(4,MAXSTR),nlast
19 common/input1/ MASSPR,MASSTA,ISEED,IAVOID,DT
21 COMMON /AA/ R(3,MAXSTR)
23 COMMON /BB/ P(3,MAXSTR)
27 COMMON /EE/ ID(MAXSTR),LB(MAXSTR)
29 common /lastt/itimeh,bimp
31 COMMON/tdecay/tfdcy(MAXSTR),tfdpi(MAXSTR,MAXR),tft(MAXSTR)
33 COMMON /AREVT/ IAEVT, IARUN, MISS
35 common/snn/efrm,npart1,npart2
37 COMMON/HJGLBR/NELT,NINTHJ,NELP,NINP
39 COMMON/FTMAX/ftsv(MAXSTR),ftsvt(MAXSTR, MAXR)
40 COMMON /dpert/dpertt(MAXSTR,MAXR),dpertp(MAXSTR),dplast(MAXSTR),
41 1 dpdcy(MAXSTR),dpdpi(MAXSTR,MAXR),dpt(MAXSTR, MAXR),
42 2 dpp1(MAXSTR,MAXR),dppion(MAXSTR,MAXR)
44 COMMON/HPARNT/HIPR1(100),IHPR2(50),HINT1(100),IHNT2(50)
45 EXTERNAL IARFLV, INVFLV
46 common /para8/ idpert,npertd,idxsec
49 do 1001 i=1,max0(nlast,nnew)
55 c for each of the particles, search the freezeout record (common /hbt/)
56 c to find & keep those which do not have interactions during this timestep:
58 do 1004 iplast=1,nlast
59 if(p(1,ip).eq.plast(1,iplast).and.
60 1 p(2,ip).eq.plast(2,iplast).and.
61 2 p(3,ip).eq.plast(3,iplast).and.
62 3 e(ip).eq.plast(4,iplast).and.
63 4 lb(ip).eq.lblast(iplast).and.
64 5 dpertp(ip).eq.dplast(iplast).and.lastkp(iplast).eq.0) then
65 clin-5/2008 modified below to the above in case we have perturbative particles:
66 c 5 lastkp(iplast).eq.0) then
67 deltat=nt*dt-xlast(4,iplast)
68 ene=sqrt(plast(1,iplast)**2+plast(2,iplast)**2
69 1 +plast(3,iplast)**2+plast(4,iplast)**2)
70 c xnew gives the coordinate if a particle free-streams to current time:
72 xnew(ii)=xlast(ii,iplast)+plast(ii,iplast)/ene*deltat
74 dr=sqrt((r(1,ip)-xnew(1))**2+(r(2,ip)-xnew(2))**2
75 1 +(r(3,ip)-xnew(3))**2)
76 c find particles with dp=0 and dr<0.01, considered to be those
77 c without any interactions during this timestep,
78 c thus keep their last positions and time:
82 c if(lb(ip).eq.41) then
83 c write(95,*) 'nt,ip,px,x=',nt,ip,p(1,ip),r(1,ip),ftsv(ip)
84 c write(95,*) 'xnew=',xnew(1),xnew(2),xnew(3),xlast(4,ip)
86 clin-5/2009 Take care of formation time of particles read in at nt=ntmax-1:
87 if(nt.eq.ntmax.and.ftsv(ip).gt.((ntmax-1)*dt))
88 1 xlast(4,iplast)=ftsv(ip)
94 c for current particles with interactions, fill their current info in
95 c the freezeout record (if that record entry needs not to be kept):
97 if(newkp(ip).eq.0) then
99 if(lastkp(iplast).eq.0) then
100 ctest off: write collision info
101 c if(lb(ip).eq.41) then
102 c write(95,*) 'nt,lb(ip)=',nt,lb(ip)
103 c write(95,*) ' last p=',plast(1,iplast),
104 c 1 plast(2,iplast),plast(3,iplast),plast(4,iplast)
105 c write(95,*) ' after p=',p(1,ip),p(2,ip),p(3,ip),e(ip)
106 c write(95,*) 'after x=',r(1,ip),r(2,ip),r(3,ip),ftsv(ip)
109 xlast(1,iplast)=r(1,ip)
110 xlast(2,iplast)=r(2,ip)
111 xlast(3,iplast)=r(3,ip)
112 xlast(4,iplast)=nt*dt
115 c freezeout time for decay daughters at the last timestep
116 c needs to include the decay time of the parent:
117 if(tfdcy(ip).gt.(ntmax*dt+0.001)) then
118 xlast(4,iplast)=tfdcy(ip)
119 c freezeout time for particles unformed at the next-to-last timestep
120 c needs to be their formation time instead of (ntmax*dt):
121 elseif(ftsv(ip).gt.((ntmax-1)*dt)) then
122 xlast(4,iplast)=ftsv(ip)
125 plast(1,iplast)=p(1,ip)
126 plast(2,iplast)=p(2,ip)
127 plast(3,iplast)=p(3,ip)
128 plast(4,iplast)=e(ip)
129 lblast(iplast)=lb(ip)
132 dplast(iplast)=dpertp(ip)
138 c if the current particle list is shorter than the freezeout record,
139 c condense the last-collision record by filling new record from 1 to nnew,
140 c and label these entries as keep:
141 if(nnew.lt.nlast) then
142 do 170 iplast=1,nlast
143 if(lastkp(iplast).eq.0) then
144 do 1006 ip2=iplast+1,nlast
145 if(lastkp(ip2).eq.1) then
146 xlast(1,iplast)=xlast(1,ip2)
147 xlast(2,iplast)=xlast(2,ip2)
148 xlast(3,iplast)=xlast(3,ip2)
149 xlast(4,iplast)=xlast(4,ip2)
150 plast(1,iplast)=plast(1,ip2)
151 plast(2,iplast)=plast(2,ip2)
152 plast(3,iplast)=plast(3,ip2)
153 plast(4,iplast)=plast(4,ip2)
154 lblast(iplast)=lblast(ip2)
157 dplast(iplast)=dplast(ip2)
165 ctest off look inside each NT timestep (for debugging purpose):
167 c if(nt.eq.5000) then
168 c write(95,*) ' p ',nt,ip,INVFLV(lblast(ip)),plast(1,ip),
169 c 1 plast(2,ip),plast(3,ip),plast(4,ip),dplast(ip)
170 c write(95,*) ' x ',nt,ip,INVFLV(lblast(ip)),xlast(1,ip),
171 c 1 xlast(2,ip),xlast(3,ip),xlast(4,ip),dplast(ip)
176 clin-5/2008 find final number of perturbative particles (deuterons only):
179 if(dplast(ip).gt.oneminus.and.dplast(ip).lt.oneplus) then
185 c write(16,190) IAEVT,IARUN,nlast,bimp,npart1,npart2,
186 c 1 NELP,NINP,NELT,NINTHJ
187 c write(16,190) IAEVT,IARUN,nlast-ndpert,bimp,npart1,npart2,
188 c 1 NELP,NINP,NELT,NINTHJ
189 clin-5/2008 write out perturbatively-produced particles (deuterons only):
190 c if(idpert.eq.1.or.idpert.eq.2)
191 c 1 write(90,190) IAEVT,IARUN,ndpert,bimp,npart1,npart2,
192 c 2 NELP,NINP,NELT,NINTHJ
194 clin-12/14/03 No formation time for spectator projectile or target nucleons,
195 c see ARINI1 in 'amptsub.f':
196 clin-3/2009 To be consistent with new particles produced in hadron cascade
197 c that are limited by the time-resolution (DT) of the hadron cascade,
198 c freezeout time of spectator projectile or target nucleons is written as
199 c DT as they are read at the 1st timestep and then propagated to time DT:
200 c if(plast(1,ip).eq.0.and.plast(2,ip).eq.0
201 c 1 .and.(sqrt(plast(3,ip)**2+plast(4,ip)**2)*2/HINT1(1))
202 c 2 .gt.0.99.and.(lblast(ip).eq.1.or.lblast(ip).eq.2)) then
203 clin-5/2008 perturbatively-produced particles (currently only deuterons)
204 c are written to ana/ampt_pert.dat (without the column for the mass);
205 c ana/ampt.dat has regularly-produced particles (including deuterons);
206 c these two sets of deuteron data are close to each other(but not the same
207 c because of the bias from triggering the perturbative production);
208 c ONLY use one data set for analysis to avoid double-counting:
209 c if(dplast(ip).gt.oneminus.and.dplast(ip).lt.oneplus) then
210 c write(16,200) INVFLV(lblast(ip)), plast(1,ip),
211 c 1 plast(2,ip),plast(3,ip),plast(4,ip),
212 c 2 xlast(1,ip),xlast(2,ip),xlast(3,ip),
216 c if(idpert.eq.1.or.idpert.eq.2) then
217 c write(90,250) INVFLV(lblast(ip)), plast(1,ip),
218 c 1 plast(2,ip),plast(3,ip),
219 c 2 xlast(1,ip),xlast(2,ip),xlast(3,ip),
222 c write(99,*) 'Unexpected perturbative particles'
225 c elseif(amax1(abs(xlast(1,ip)),abs(xlast(2,ip)),
226 c 1 abs(xlast(3,ip)),abs(xlast(4,ip))).lt.9999) then
227 c if(dplast(ip).gt.oneminus.and.dplast(ip).lt.oneplus) then
228 c write(16,200) INVFLV(lblast(ip)), plast(1,ip),
229 c 1 plast(2,ip),plast(3,ip),plast(4,ip),
230 c 2 xlast(1,ip),xlast(2,ip),xlast(3,ip),xlast(4,ip)
232 c if(idpert.eq.1.or.idpert.eq.2) then
233 c write(90,250) INVFLV(lblast(ip)),plast(1,ip),
234 c 1 plast(2,ip),plast(3,ip),
235 c 2 xlast(1,ip),xlast(2,ip),xlast(3,ip),xlast(4,ip),
238 c write(99,*) 'Unexpected perturbative particles'
242 c change format for large numbers:
243 c if(dplast(ip).gt.oneminus.and.dplast(ip).lt.oneplus) then
244 c write(16,201) INVFLV(lblast(ip)), plast(1,ip),
245 c 1 plast(2,ip),plast(3,ip),plast(4,ip),
246 c 2 xlast(1,ip),xlast(2,ip),xlast(3,ip),xlast(4,ip)
248 c if(idpert.eq.1.or.idpert.eq.2) then
249 c write(90,251) INVFLV(lblast(ip)), plast(1,ip),
250 c 1 plast(2,ip),plast(3,ip),
251 c 2 xlast(1,ip),xlast(2,ip),xlast(3,ip),xlast(4,ip),
254 c write(99,*) 'Unexpected perturbative particles'
259 if(ioscar.eq.1) call hoscar
261 190 format(3(i7),f10.4,5x,6(i4))
262 clin-3/2009 improve the output accuracy of Pz
263 200 format(I6,2(1x,f8.3),1x,f11.4,1x,f6.3,4(1x,f8.2))
264 201 format(I6,2(1x,f8.3),1x,f11.4,1x,f6.3,4(1x,e8.2))
265 250 format(I5,2(1x,f8.3),1x,f10.3,2(1x,f7.1),1x,f8.2,1x,f7.2,1x,e10.4)
266 251 format(I5,2(1x,f8.3),1x,f10.3,4(1x,e8.2),1x,e10.4)
271 c=======================================================================
272 SUBROUTINE decomp(px0,py0,pz0,xm0,i,itq1)
274 IMPLICIT DOUBLE PRECISION(D)
275 DOUBLE PRECISION enenew, pxnew, pynew, pznew
276 DOUBLE PRECISION de0, beta2, gam
277 common /lora/ enenew, pxnew, pynew, pznew
279 COMMON/HPARNT/HIPR1(100),IHPR2(50),HINT1(100),IHNT2(50)
281 common /decom/ptwo(2,5)
285 COMMON/HMAIN1/EATT,JATT,NATT,NT,NP,N0,N01,N10,N11
286 common/embed/iembed,pxqembd,pyqembd,xembd,yembd
290 dcth=dble(RANART(NSEED))*2.d0-1.d0
291 dPHI=dble(RANART(NSEED)*HIPR1(40))*2.d0
292 clin-6/2009 Added if embedding a high-Pt quark pair after string melting:
294 c Decompose the parent high-Pt pion to q and qbar with an internal momentum
295 c parallel to the pion direction so that one parton has ~the same hight Pt
296 c and the other parton has a very soft Pt:
297 c Note: htop() decomposes a meson to q as it(1) followed by qbar as it(2):
298 if(i.eq.(natt-1).or.i.eq.natt) then
300 dphi=dble(acos(pxqembd/sqrt(pxqembd**2+pyqembd**2)))
301 if(pyqembd.lt.0) dphi=HIPR1(40)*2.d0-dphi
306 dpcm=dsqrt((ds-dble(ptwo(1,5)+ptwo(2,5))**2)
307 1 *(ds-dble(ptwo(1,5)-ptwo(2,5))**2)/ds/4d0)
309 dpx=dpcm*dsqrt(1.d0-dcth**2)*dcos(dphi)
310 dpy=dpcm*dsqrt(1.d0-dcth**2)*dsin(dphi)
311 de1=dsqrt(dble(ptwo(1,5))**2+dpcm**2)
312 de2=dsqrt(dble(ptwo(2,5))**2+dpcm**2)
314 de0=dsqrt(dble(px0)**2+dble(py0)**2+dble(pz0)**2+dble(xm0)**2)
318 c boost the reference frame up by beta (pznew=gam(pz+beta e)):
319 beta2 = dbex ** 2 + dbey ** 2 + dbez ** 2
320 gam = 1.d0 / dsqrt(1.d0 - beta2)
321 if(beta2.ge.0.9999999999999d0) then
322 write(6,*) '1',dbex,dbey,dbez,beta2,gam
325 call lorenza(de1,dpx,dpy,dpz,-dbex,-dbey,-dbez)
326 ptwo(1,1)=sngl(pxnew)
327 ptwo(1,2)=sngl(pynew)
328 ptwo(1,3)=sngl(pznew)
329 ptwo(1,4)=sngl(enenew)
330 call lorenza(de2,-dpx,-dpy,-dpz,-dbex,-dbey,-dbez)
331 ptwo(2,1)=sngl(pxnew)
332 ptwo(2,2)=sngl(pynew)
333 ptwo(2,3)=sngl(pznew)
334 ptwo(2,4)=sngl(enenew)
339 c=======================================================================
342 PARAMETER (MAXSTR=150001)
343 PARAMETER (MAXPTN=400001)
344 PARAMETER (MAXIDL=4001)
345 DOUBLE PRECISION GX0, GY0, GZ0, FT0, PX0, PY0, PZ0, E0, XMASS0
346 DOUBLE PRECISION PXSGS,PYSGS,PZSGS,PESGS,PMSGS,
347 1 GXSGS,GYSGS,GZSGS,FTSGS
349 COMMON/HMAIN2/KATT(MAXSTR,4),PATT(MAXSTR,4)
350 cwei DOUBLE PRECISION PATT
352 COMMON/HMAIN1/EATT,JATT,NATT,NT,NP,N0,N01,N10,N11
356 COMMON /prec1/GX0(MAXPTN),GY0(MAXPTN),GZ0(MAXPTN),FT0(MAXPTN),
357 & PX0(MAXPTN), PY0(MAXPTN), PZ0(MAXPTN), E0(MAXPTN),
358 & XMASS0(MAXPTN), ITYP0(MAXPTN)
360 COMMON /ilist7/ LSTRG0(MAXPTN), LPART0(MAXPTN)
362 COMMON /ARPRC/ ITYPAR(MAXSTR),
363 & GXAR(MAXSTR), GYAR(MAXSTR), GZAR(MAXSTR), FTAR(MAXSTR),
364 & PXAR(MAXSTR), PYAR(MAXSTR), PZAR(MAXSTR), PEAR(MAXSTR),
367 common /decom/ptwo(2,5)
371 COMMON /NOPREC/ NNOZPC, ITYPN(MAXIDL),
372 & GXN(MAXIDL), GYN(MAXIDL), GZN(MAXIDL), FTN(MAXIDL),
373 & PXN(MAXIDL), PYN(MAXIDL), PZN(MAXIDL), EEN(MAXIDL),
376 COMMON/HPARNT/HIPR1(100),IHPR2(50),HINT1(100),IHNT2(50)
378 c 7/20/01: use double precision
379 c otherwise sometimes beta>1 and gamma diverge in lorenza():
380 COMMON/SOFT/PXSGS(MAXSTR,3),PYSGS(MAXSTR,3),PZSGS(MAXSTR,3),
381 & PESGS(MAXSTR,3),PMSGS(MAXSTR,3),GXSGS(MAXSTR,3),
382 & GYSGS(MAXSTR,3),GZSGS(MAXSTR,3),FTSGS(MAXSTR,3),
383 & K1SGS(MAXSTR,3),K2SGS(MAXSTR,3),NJSGS(MAXSTR)
385 common/anim/nevent,isoft,isflag,izpc
387 DOUBLE PRECISION vxp0,vyp0,vzp0
388 common /precpa/ vxp0(MAXPTN), vyp0(MAXPTN), vzp0(MAXPTN)
390 common /para7/ ioscar,nsmbbbar,nsmmeson
391 COMMON /AREVT/ IAEVT, IARUN, MISS
396 clin-5b/2008 calculate the number of hadrons to be converted to q/qbar:
397 if((isoft.eq.4.or.isoft.eq.5).and.(ioscar.eq.2.or.ioscar.eq.3))
405 if(PXAR(i).eq.0.and.PYAR(i).eq.0.and.PEAR(i)
406 1 .ge.(HINT1(1)/2*0.99).and.
407 2 ((id.eq.2112).or.(id.eq.2212))) then
408 c proj or targ nucleons without interactions, do not enter ZPC:
409 elseif(idabs.gt.1000.and.i2.ne.0) then
410 c baryons to be converted to q/qbar:
412 elseif((idabs.gt.100.and.idabs.lt.1000)
413 1 .or.idabs.gt.10000) then
414 c mesons to be converted to q/qbar:
420 if(ioscar.eq.2.or.ioscar.eq.3) then
421 write(92,*) iaevt,miss,3*nsmbbbar+2*nsmmeson,
422 1 nsmbbbar,nsmmeson,natt,natt-nsmbbbar-nsmmeson
424 c write(92,*) iaevt, 3*nsmbbbar+2*nsmmeson
425 c write(92,*) ' event#, total # of initial partons after string
427 c write(92,*) 'String melting converts ',nsmbbbar, ' baryons &'
428 c 1, nsmmeson, ' mesons'
429 c write(92,*) 'Total # of initial particles= ',natt
430 c write(92,*) 'Total # of initial particles (gamma,e,muon,...)
431 c 1 not entering ZPC= ',natt-nsmbbbar-nsmmeson
437 i4=MOD(idabs/1000,10)
442 ftime=0.197*PEAR(i)/(PXAR(i)**2+PYAR(i)**2+XMAR(i)**2)
449 if(PXAR(i).eq.0.and.PYAR(i).eq.0.and.PEAR(i)
450 1 .ge.(HINT1(1)/2*0.99).and.((id.eq.2112).or.(id.eq.2212))) then
451 c proj or targ nucleons without interactions, do not enter ZPC:
453 elseif(idabs.gt.1000.and.i2.ne.0) then
455 if(((i4.eq.1.or.i4.eq.2).and.i4.eq.i3)
456 1 .or.(i4.eq.3.and.i3.eq.3)) then
458 if(rnum.le.(1./2.)) then
460 it(2)=i3*1000+i2*100+1
461 elseif(rnum.le.(2./3.)) then
463 it(2)=i3*1000+i2*100+3
466 it(2)=i4*1000+i3*100+3
469 if(rnum.le.(2./3.)) then
471 it(2)=i3*1000+i2*100+3
474 it(2)=i4*1000+i3*100+3
477 elseif(i4.eq.1.or.i4.eq.2) then
479 if(rnum.le.(1./2.)) then
481 it(2)=i4*1000+i3*100+1
482 elseif(rnum.le.(2./3.)) then
484 it(2)=i4*1000+i3*100+3
487 it(2)=i3*1000+i2*100+3
490 if(rnum.le.(2./3.)) then
492 it(2)=i4*1000+i3*100+3
495 it(2)=i3*1000+i2*100+3
501 it(2)=i2*1000+i3*100+1
503 it(2)=i3*1000+i2*100+3
511 c isoft=4or5 decompose diquark flavor it(2) to two quarks it(3)&(4):
512 if(isoft.eq.4.or.isoft.eq.5) then
513 it(3)=MOD(it(2)/1000,10)
514 it(4)=MOD(it(2)/100,10)
517 elseif((idabs.gt.100.and.idabs.lt.1000)
518 1 .or.idabs.gt.10000) then
521 if(i3.eq.1.or.i3.eq.2) then
534 if((isign(1,id)*(-1)**i3).eq.1) then
543 c save other particles (leptons and photons) outside of ZPC:
550 itypn(nnozpc)=ITYPAR(i)
562 ptwo(1,5)=ulmass(it(1))
563 ptwo(2,5)=ulmass(it(2))
564 call decomp(patt(i,1),patt(i,2),patt(i,3),XMAR(i),i,it(1))
566 if((isoft.eq.4.or.isoft.eq.5)
567 1 .and.iabs(it(2)).gt.1000) ipamax=1
568 do 1001 ipar=1,ipamax
571 px0(npar)=dble(ptwo(ipar,1))
572 py0(npar)=dble(ptwo(ipar,2))
573 pz0(npar)=dble(ptwo(ipar,3))
574 e0(npar)=dble(ptwo(ipar,4))
575 xmass0(npar)=dble(ptwo(ipar,5))
576 gx0(npar)=dble(GXAR(i))
577 gy0(npar)=dble(GYAR(i))
578 gz0(npar)=dble(GZAR(i))
579 ft0(npar)=dble(ftime)
582 vxp0(npar)=dble(patt(i,1)/patt(i,4))
583 vyp0(npar)=dble(patt(i,2)/patt(i,4))
584 vzp0(npar)=dble(patt(i,3)/patt(i,4))
586 cyy 200 format(I6,2(1x,f8.3),1x,f10.3,1x,f6.3,4(1x,f8.2))
587 cyy 201 format(I6,2(1x,f8.3),1x,f10.3,1x,f6.3,4(1x,e8.2))
589 if((isoft.eq.4.or.isoft.eq.5)
590 1 .and.iabs(it(2)).gt.1000) then
593 ptwo(1,5)=ulmass(it(3))
594 ptwo(2,5)=ulmass(it(4))
595 c 8/19/02 avoid actual argument in common blocks of DECOMP:
596 c call decomp(ptwo(2,1),ptwo(2,2),ptwo(2,3),xmdq)
600 call decomp(ptwox,ptwoy,ptwoz,xmdq,i,it(1))
604 ityp0(npar)=it(ipar+2)
605 px0(npar)=dble(ptwo(ipar,1))
606 py0(npar)=dble(ptwo(ipar,2))
607 pz0(npar)=dble(ptwo(ipar,3))
608 e0(npar)=dble(ptwo(ipar,4))
609 xmass0(npar)=dble(ptwo(ipar,5))
610 gx0(npar)=dble(GXAR(i))
611 gy0(npar)=dble(GYAR(i))
612 gz0(npar)=dble(GZAR(i))
613 ft0(npar)=dble(ftime)
616 vxp0(npar)=dble(patt(i,1)/patt(i,4))
617 vyp0(npar)=dble(patt(i,2)/patt(i,4))
618 vzp0(npar)=dble(patt(i,3)/patt(i,4))
627 if((isoft.eq.4.or.isoft.eq.5).and.(ioscar.eq.2.or.ioscar.eq.3))
629 if((natt-nsmbbbar-nsmmeson).ne.nnozpc)
630 1 write(92,*) 'Problem with the total # of initial particles
631 2 (gamma,e,muon,...) not entering ZPC'
632 if((3*nsmbbbar+2*nsmmeson).ne.npar)
633 1 write(92,*) 'Problem with the total # of initial partons
634 2 after string melting'
640 c=======================================================================
643 PARAMETER (MAXSTR=150001)
644 DOUBLE PRECISION gxp,gyp,gzp,ftp,pxp,pyp,pzp,pep,pmp
645 DOUBLE PRECISION gxp0,gyp0,gzp0,ft0fom,drlocl
646 DOUBLE PRECISION enenew, pxnew, pynew, pznew, beta2, gam
647 DOUBLE PRECISION ftavg0,gxavg0,gyavg0,gzavg0,bex,bey,bez
648 DOUBLE PRECISION PXSGS,PYSGS,PZSGS,PESGS,PMSGS,
649 1 GXSGS,GYSGS,GZSGS,FTSGS
650 DOUBLE PRECISION xmdiag,px1,py1,pz1,e1,px2,py2,pz2,e2,
651 1 px3,py3,pz3,e3,xmpair,etot
652 common /loclco/gxp(3),gyp(3),gzp(3),ftp(3),
653 1 pxp(3),pyp(3),pzp(3),pep(3),pmp(3)
655 COMMON/HMAIN1/EATT,JATT,NATT,NT,NP,N0,N01,N10,N11
657 COMMON/HMAIN2/KATT(MAXSTR,4),PATT(MAXSTR,4)
659 COMMON/HJJET2/NSG,NJSG(MAXSTR),IASG(MAXSTR,3),K1SG(MAXSTR,100),
660 & K2SG(MAXSTR,100),PXSG(MAXSTR,100),PYSG(MAXSTR,100),
661 & PZSG(MAXSTR,100),PESG(MAXSTR,100),PMSG(MAXSTR,100)
663 COMMON /ARPRNT/ ARPAR1(100), IAPAR2(50), ARINT1(100), IAINT2(50)
665 COMMON /ARPRC/ ITYPAR(MAXSTR),
666 & GXAR(MAXSTR), GYAR(MAXSTR), GZAR(MAXSTR), FTAR(MAXSTR),
667 & PXAR(MAXSTR), PYAR(MAXSTR), PZAR(MAXSTR), PEAR(MAXSTR),
670 COMMON/SOFT/PXSGS(MAXSTR,3),PYSGS(MAXSTR,3),PZSGS(MAXSTR,3),
671 & PESGS(MAXSTR,3),PMSGS(MAXSTR,3),GXSGS(MAXSTR,3),
672 & GYSGS(MAXSTR,3),GZSGS(MAXSTR,3),FTSGS(MAXSTR,3),
673 & K1SGS(MAXSTR,3),K2SGS(MAXSTR,3),NJSGS(MAXSTR)
677 common/anim/nevent,isoft,isflag,izpc
679 common /prtn23/ gxp0(3),gyp0(3),gzp0(3),ft0fom
683 common /lora/ enenew, pxnew, pynew, pznew
685 COMMON/LUDAT1A/MSTU(200),PARU(200),MSTJ(200),PARJ(200)
688 common /lastt/itimeh,bimp
689 COMMON/HJGLBR/NELT,NINTHJ,NELP,NINP
690 COMMON /AREVT/ IAEVT, IARUN, MISS
691 common /para7/ ioscar,nsmbbbar,nsmmeson
693 dimension xmdiag(MAXSTR),indx(MAXSTR),ndiag(MAXSTR)
694 cwei DOUBLE PRECISION PATT
698 c obtain particle mass here without broadening by Breit-Wigner width:
706 c determine hadron flavor except (pi0,rho0,eta,omega):
708 if(NJSGS(ISG).ne.0) then
720 c 5/02/01 try lowest spin states as first choices,
721 c i.e. octet baryons and pseudoscalar mesons (ibs=2*baryonspin+1):
724 xmpair=dsqrt((e1+e2)**2-(px1+px2)**2-(py1+py2)**2
728 if(k1.eq.-k2.and.iabs(k1).le.2.
729 1 and.NJSGS(ISG).eq.2) then
735 if((isoft.eq.4.or.isoft.eq.5).and.NJSGS(ISG).eq.3) then
742 xmpair=dsqrt((e1+e2+e3)**2-(px1+px2+px3)**2
743 1 -(py1+py2+py3)**2-(pz1+pz2+pz3)**2)
745 c***** isoft=3 baryon decomposition is different:
747 1 (k1abs.gt.1000.or.k2abs.gt.1000)) then
748 if(k1abs.gt.1000) then
757 if(MOD(kdq,10).eq.1) then
768 elseif(kk.gt.kj) then
774 if(ki.ne.kj.and.ki.ne.kk.and.kj.ne.kk) then
776 kf=1000*ki+100*kk+10*kj+ibs
778 kf=1000*ki+100*kj+10*kk+ibs
780 elseif(ki.eq.kj.and.ki.eq.kk) then
781 c can only be decuplet baryons:
782 kf=1000*ki+100*kj+10*kk+4
784 kf=1000*ki+100*kj+10*kk+ibs
786 c form a decuplet baryon if the q+diquark mass is closer to its mass
787 c (and if the diquark has spin 1):
788 cc for now only include Delta, which is present in ART:
789 cc if(idqspn.eq.1.and.MOD(kf,10).eq.2) then
790 if(kf.eq.2112.or.kf.eq.2212) then
791 if(abs(sngl(xmpair)-ULMASS(kf)).gt.
792 1 abs(sngl(xmpair)-ULMASS(kf+2))) kf=kf+2
795 clin-6/22/01 isoft=4or5 baryons:
796 elseif((isoft.eq.4.or.isoft.eq.5).and.NJSGS(ISG).eq.3)
798 if(k1abs.gt.k2abs) then
808 elseif(k3abs.lt.kk) then
815 if(ki.eq.kj.and.ki.eq.kk) then
816 c can only be decuplet baryons (Delta-,++, Omega):
818 kf=1000*ki+100*kj+10*kk+ibs
819 elseif(ki.ne.kj.and.ki.ne.kk.and.kj.ne.kk) then
820 c form Lambda or Sigma according to 3-quark mass,
821 c for now neglect decuplet (Sigma*0 etc) which is absent in ART:
823 kf1=1000*ki+100*kj+10*kk+ibs
824 kf2=1000*ki+100*kk+10*kj+ibs
826 if(abs(sngl(xmpair)-ULMASS(kf1)).gt.
827 1 abs(sngl(xmpair)-ULMASS(kf2))) kf=kf2
830 kf=1000*ki+100*kj+10*kk+ibs
831 cc for now only include Delta0,+ as decuplets, which are present in ART:
832 if(kf.eq.2112.or.kf.eq.2212) then
833 if(abs(sngl(xmpair)-ULMASS(kf)).gt.
834 1 abs(sngl(xmpair)-ULMASS(kf+2))) kf=kf+2
840 if(k1abs.eq.k2abs) then
842 c treat diagonal mesons later in the subroutine:
844 elseif(k1abs.le.3) then
845 c do not form eta', only form phi from s-sbar, since no eta' in ART:
848 kf=100*k1abs+10*k1abs+2*imspin+1
851 if(k1abs.gt.k2abs) then
854 elseif(k1abs.lt.k2abs) then
858 kf=(100*kmax+10*kmin+2*imspin+1)
859 1 *isign(1,k1+k2)*(-1)**kmax
860 c form a vector meson if the q+qbar mass is closer to its mass:
861 if(MOD(iabs(kf),10).eq.1) then
862 if(abs(sngl(xmpair)-ULMASS(iabs(kf))).gt.
863 1 abs(sngl(xmpair)-ULMASS(iabs(kf)+2)))
864 2 kf=(iabs(kf)+2)*isign(1,kf)
870 if(iabs(kf).eq.211) then
872 elseif(iabs(kf).eq.213) then
877 c assume Npi0=(Npi+ + Npi-)/2, Nrho0=(Nrho+ + Nrho-)/2 on the average:
879 ppi0=float(npich/2)/float(nuudd)
880 prho0=float(nrhoch/2)/float(nuudd)
882 c determine diagonal mesons (pi0,rho0,eta and omega) from uubar/ddbar:
885 if(K2SGS(ISG,1).eq.-K2SGS(ISG,2)
886 1 .and.iabs(K2SGS(ISG,1)).le.2.and.NJSGS(ISG).eq.2) then
887 if(RANART(NSEED).le.ppi0) npi0=npi0+1
892 call index1(MAXSTR,nuudd,xmdiag,indx)
902 elseif(RANART(NSEED).le.(prho0/(1-ppi0+0.00001))) then
905 c at T=150MeV, thermal weights for eta and omega(spin1) are about the same:
906 if(RANART(NSEED).le.0.5) then
915 c determine hadron formation time, position and momentum:
917 clin-6/2009 write out parton info after coalescence:
919 WRITE (85, 395) IAEVT, 3*nsmbbbar+2*nsmmeson,nsmbbbar,nsmmeson,
920 1 bimp, NELP,NINP,NELT,NINTHJ,MISS
922 395 format(4I8,f10.4,5I5)
925 if(NJSGS(ISG).ne.0) then
940 if(NJSGS(ISG).eq.2) then
941 PXAR(inatt)=sngl(px1+px2)
942 PYAR(inatt)=sngl(py1+py2)
943 PZAR(inatt)=sngl(pz1+pz2)
944 PATT(inatt,1)=PXAR(inatt)
945 PATT(inatt,2)=PYAR(inatt)
946 PATT(inatt,3)=PZAR(inatt)
948 elseif((isoft.eq.4.or.isoft.eq.5).and.NJSGS(ISG).eq.3)
954 PXAR(inatt)=sngl(px1+px2+px3)
955 PYAR(inatt)=sngl(py1+py2+py3)
956 PZAR(inatt)=sngl(pz1+pz2+pz3)
957 PATT(inatt,1)=PXAR(inatt)
958 PATT(inatt,2)=PYAR(inatt)
959 PATT(inatt,3)=PZAR(inatt)
962 XMAR(inatt)=ULMASS(ITYPAR(inatt))
963 PEAR(inatt)=sqrt(PXAR(inatt)**2+PYAR(inatt)**2
964 1 +PZAR(inatt)**2+XMAR(inatt)**2)
965 PATT(inatt,4)=PEAR(inatt)
966 EATT=EATT+PEAR(inatt)
979 call locldr(ipartn,drlocl)
982 ftavg0=ft0fom+dble(tau0)
987 gxavg0=gxavg0+gxp0(i)/ipartn
988 gyavg0=gyavg0+gyp0(i)/ipartn
989 gzavg0=gzavg0+gzp0(i)/ipartn
991 bex=dble(PXAR(inatt))/etot
992 bey=dble(PYAR(inatt))/etot
993 bez=dble(PZAR(inatt))/etot
994 beta2 = bex ** 2 + bey ** 2 + bez ** 2
995 gam = 1.d0 / dsqrt(1.d0 - beta2)
996 if(beta2.ge.0.9999999999999d0) then
997 write(6,*) '2',bex,bey,bez,beta2,gam
1000 call lorenza(ftavg0,gxavg0,gyavg0,gzavg0,-bex,-bey,-bez)
1001 GXAR(inatt)=sngl(pxnew)
1002 GYAR(inatt)=sngl(pynew)
1003 GZAR(inatt)=sngl(pznew)
1004 FTAR(inatt)=sngl(enenew)
1005 clin 4/19/2006 write out parton info after coalescence:
1006 if(ioscar.eq.3) then
1007 WRITE (85, 312) K2SGS(ISG,1),px1,py1,pz1,PMSGS(ISG,1),
1008 1 inatt,katt(inatt,1)
1009 WRITE (85, 312) K2SGS(ISG,2),px2,py2,pz2,PMSGS(ISG,2),
1010 1 inatt,katt(inatt,1)
1011 if(NJSGS(ISG).eq.3) WRITE (85, 312) K2SGS(ISG,3),
1012 1 px3,py3,pz3,PMSGS(ISG,3),inatt,katt(inatt,1)
1014 312 FORMAT(I6,4(1X,F10.3),1X,I6,1X,I6)
1018 c number of hadrons formed from partons inside ZPC:
1025 c=======================================================================
1028 PARAMETER (MAXSTR=150001)
1029 IMPLICIT DOUBLE PRECISION(D)
1030 DOUBLE PRECISION gxp,gyp,gzp,ftp,pxp,pyp,pzp,pep,pmp
1031 DIMENSION IOVER(MAXSTR),dp1(2:3),dr1(2:3)
1032 DOUBLE PRECISION PXSGS,PYSGS,PZSGS,PESGS,PMSGS,
1033 1 GXSGS,GYSGS,GZSGS,FTSGS
1034 double precision dpcoal,drcoal,ecritl
1035 COMMON/SOFT/PXSGS(MAXSTR,3),PYSGS(MAXSTR,3),PZSGS(MAXSTR,3),
1036 & PESGS(MAXSTR,3),PMSGS(MAXSTR,3),GXSGS(MAXSTR,3),
1037 & GYSGS(MAXSTR,3),GZSGS(MAXSTR,3),FTSGS(MAXSTR,3),
1038 & K1SGS(MAXSTR,3),K2SGS(MAXSTR,3),NJSGS(MAXSTR)
1040 common /coal/dpcoal,drcoal,ecritl
1042 common /loclco/gxp(3),gyp(3),gzp(3),ftp(3),
1043 1 pxp(3),pyp(3),pzp(3),pep(3),pmp(3)
1045 COMMON/HJJET2/NSG,NJSG(MAXSTR),IASG(MAXSTR,3),K1SG(MAXSTR,100),
1046 & K2SG(MAXSTR,100),PXSG(MAXSTR,100),PYSG(MAXSTR,100),
1047 & PZSG(MAXSTR,100),PESG(MAXSTR,100),PMSG(MAXSTR,100)
1054 C1 meson q coalesce with all available qbar:
1056 if(NJSGS(ISG).ne.2.or.IOVER(ISG).eq.1) goto 150
1057 C DETERMINE CURRENT RELATIVE DISTANCE AND MOMENTUM:
1058 if(K2SGS(ISG,1).lt.0) then
1059 write(6,*) 'Antiquark appears in quark loop; stop'
1074 call locldr(2,drlocl)
1076 c dp0^2 defined as (p1+p2)^2-(m1+m2)^2:
1077 dp0=dsqrt(2*(pep(1)*pep(2)-pxp(1)*pxp(2)
1078 & -pyp(1)*pyp(2)-pzp(1)*pzp(2)-pmp(1)*pmp(2)))
1081 c skip default or unavailable antiquarks:
1082 if(JSG.eq.ISG.or.IOVER(JSG).eq.1) goto 120
1083 if(NJSGS(JSG).eq.2) then
1086 elseif(NJSGS(JSG).eq.3.and.K2SGS(JSG,1).lt.0) then
1092 do 100 ip=ipmin,ipmax
1093 dplocl=dsqrt(2*(pep(1)*pesgs(jsg,ip)
1094 1 -pxp(1)*pxsgs(jsg,ip)
1095 2 -pyp(1)*pysgs(jsg,ip)
1096 3 -pzp(1)*pzsgs(jsg,ip)
1097 4 -pmp(1)*pmsgs(jsg,ip)))
1098 c skip if outside of momentum radius:
1099 if(dplocl.gt.dpcoal) goto 120
1100 ftp(2)=ftsgs(jsg,ip)
1101 gxp(2)=gxsgs(jsg,ip)
1102 gyp(2)=gysgs(jsg,ip)
1103 gzp(2)=gzsgs(jsg,ip)
1104 pxp(2)=pxsgs(jsg,ip)
1105 pyp(2)=pysgs(jsg,ip)
1106 pzp(2)=pzsgs(jsg,ip)
1107 pmp(2)=pmsgs(jsg,ip)
1108 pep(2)=pesgs(jsg,ip)
1109 call locldr(2,drlocl)
1110 c skip if outside of spatial radius:
1111 if(drlocl.gt.drcoal) goto 120
1112 c q_isg coalesces with qbar_jsg:
1113 if((dp0.gt.dpcoal.or.dr0.gt.drcoal)
1114 1 .or.(drlocl.lt.dr0)) then
1117 call exchge(isg,2,jsg,ip)
1121 if(dp0.le.dpcoal.and.dr0.le.drcoal) IOVER(ISG)=1
1124 C2 meson qbar coalesce with all available q:
1126 if(NJSGS(ISG).ne.2.or.IOVER(ISG).eq.1) goto 250
1127 C DETERMINE CURRENT RELATIVE DISTANCE AND MOMENTUM:
1139 call locldr(2,drlocl)
1141 dp0=dsqrt(2*(pep(1)*pep(2)-pxp(1)*pxp(2)
1142 & -pyp(1)*pyp(2)-pzp(1)*pzp(2)-pmp(1)*pmp(2)))
1145 if(JSG.eq.ISG.or.IOVER(JSG).eq.1) goto 220
1146 if(NJSGS(JSG).eq.2) then
1149 elseif(NJSGS(JSG).eq.3.and.K2SGS(JSG,1).gt.0) then
1155 do 200 ip=ipmin,ipmax
1156 dplocl=dsqrt(2*(pep(2)*pesgs(jsg,ip)
1157 1 -pxp(2)*pxsgs(jsg,ip)
1158 2 -pyp(2)*pysgs(jsg,ip)
1159 3 -pzp(2)*pzsgs(jsg,ip)
1160 4 -pmp(2)*pmsgs(jsg,ip)))
1161 c skip if outside of momentum radius:
1162 if(dplocl.gt.dpcoal) goto 220
1163 ftp(1)=ftsgs(jsg,ip)
1164 gxp(1)=gxsgs(jsg,ip)
1165 gyp(1)=gysgs(jsg,ip)
1166 gzp(1)=gzsgs(jsg,ip)
1167 pxp(1)=pxsgs(jsg,ip)
1168 pyp(1)=pysgs(jsg,ip)
1169 pzp(1)=pzsgs(jsg,ip)
1170 pmp(1)=pmsgs(jsg,ip)
1171 pep(1)=pesgs(jsg,ip)
1172 call locldr(2,drlocl)
1173 c skip if outside of spatial radius:
1174 if(drlocl.gt.drcoal) goto 220
1175 c qbar_isg coalesces with q_jsg:
1176 if((dp0.gt.dpcoal.or.dr0.gt.drcoal)
1177 1 .or.(drlocl.lt.dr0)) then
1180 call exchge(isg,1,jsg,ip)
1184 if(dp0.le.dpcoal.and.dr0.le.drcoal) IOVER(ISG)=1
1187 C3 baryon q (antibaryon qbar) coalesce with all available q (qbar):
1189 if(NJSGS(ISG).ne.3.or.IOVER(ISG).eq.1) goto 350
1191 C DETERMINE CURRENT RELATIVE DISTANCE AND MOMENTUM:
1203 call locldr(2,drlocl)
1205 dp1(2)=dsqrt(2*(pep(1)*pep(2)-pxp(1)*pxp(2)
1206 & -pyp(1)*pyp(2)-pzp(1)*pzp(2)-pmp(1)*pmp(2)))
1217 call locldr(2,drlocl)
1219 dp1(3)=dsqrt(2*(pep(1)*pep(2)-pxp(1)*pxp(2)
1220 & -pyp(1)*pyp(2)-pzp(1)*pzp(2)-pmp(1)*pmp(2)))
1223 if(JSG.eq.ISG.or.IOVER(JSG).eq.1) goto 320
1224 if(NJSGS(JSG).eq.2) then
1225 if(ibaryn.gt.0) then
1231 elseif(NJSGS(JSG).eq.3.and.
1232 1 (ibaryn*K2SGS(JSG,1)).gt.0) then
1238 do 300 ip=ipmin,ipmax
1239 dplocl=dsqrt(2*(pep(1)*pesgs(jsg,ip)
1240 1 -pxp(1)*pxsgs(jsg,ip)
1241 2 -pyp(1)*pysgs(jsg,ip)
1242 3 -pzp(1)*pzsgs(jsg,ip)
1243 4 -pmp(1)*pmsgs(jsg,ip)))
1244 c skip if outside of momentum radius:
1245 if(dplocl.gt.dpcoal) goto 320
1246 ftp(2)=ftsgs(jsg,ip)
1247 gxp(2)=gxsgs(jsg,ip)
1248 gyp(2)=gysgs(jsg,ip)
1249 gzp(2)=gzsgs(jsg,ip)
1250 pxp(2)=pxsgs(jsg,ip)
1251 pyp(2)=pysgs(jsg,ip)
1252 pzp(2)=pzsgs(jsg,ip)
1253 pmp(2)=pmsgs(jsg,ip)
1254 pep(2)=pesgs(jsg,ip)
1255 call locldr(2,drlocl)
1256 c skip if outside of spatial radius:
1257 if(drlocl.gt.drcoal) goto 320
1258 c q_isg may coalesce with q_jsg for a baryon:
1260 if(dp1(2).gt.dpcoal.or.dr1(2).gt.drcoal) then
1262 if((dp1(3).gt.dpcoal.or.dr1(3).gt.drcoal)
1263 1 .and.dr1(3).gt.dr1(2)) ipi=3
1264 elseif(dp1(3).gt.dpcoal.or.dr1(3).gt.drcoal) then
1266 elseif(dr1(2).lt.dr1(3)) then
1267 if(drlocl.lt.dr1(3)) ipi=3
1268 elseif(dr1(3).le.dr1(2)) then
1269 if(drlocl.lt.dr1(2)) ipi=2
1274 call exchge(isg,ipi,jsg,ip)
1278 if(dp1(2).le.dpcoal.and.dr1(2).le.drcoal
1279 1 .and.dp1(3).le.dpcoal.and.dr1(3).le.drcoal)
1286 c=======================================================================
1287 SUBROUTINE exchge(isg,ipi,jsg,ipj)
1289 implicit double precision (a-h, o-z)
1290 PARAMETER (MAXSTR=150001)
1291 COMMON/SOFT/PXSGS(MAXSTR,3),PYSGS(MAXSTR,3),PZSGS(MAXSTR,3),
1292 & PESGS(MAXSTR,3),PMSGS(MAXSTR,3),GXSGS(MAXSTR,3),
1293 & GYSGS(MAXSTR,3),GZSGS(MAXSTR,3),FTSGS(MAXSTR,3),
1294 & K1SGS(MAXSTR,3),K2SGS(MAXSTR,3),NJSGS(MAXSTR)
1309 K1SGS(isg,ipi)=K1SGS(jsg,ipj)
1310 K2SGS(isg,ipi)=K2SGS(jsg,ipj)
1311 PXSGS(isg,ipi)=PXSGS(jsg,ipj)
1312 PYSGS(isg,ipi)=PYSGS(jsg,ipj)
1313 PZSGS(isg,ipi)=PZSGS(jsg,ipj)
1314 PESGS(isg,ipi)=PESGS(jsg,ipj)
1315 PMSGS(isg,ipi)=PMSGS(jsg,ipj)
1316 GXSGS(isg,ipi)=GXSGS(jsg,ipj)
1317 GYSGS(isg,ipi)=GYSGS(jsg,ipj)
1318 GZSGS(isg,ipi)=GZSGS(jsg,ipj)
1319 FTSGS(isg,ipi)=FTSGS(jsg,ipj)
1335 c=======================================================================
1336 SUBROUTINE locldr(icall,drlocl)
1338 implicit double precision (a-h, o-z)
1339 dimension ftp0(3),pxp0(3),pyp0(3),pzp0(3),pep0(3)
1340 common /loclco/gxp(3),gyp(3),gzp(3),ftp(3),
1341 1 pxp(3),pyp(3),pzp(3),pep(3),pmp(3)
1343 common /prtn23/ gxp0(3),gyp0(3),gzp0(3),ft0fom
1345 common /lora/ enenew, pxnew, pynew, pznew
1348 c for 2-body kinematics:
1351 bex=(pxp(1)+pxp(2))/etot
1352 bey=(pyp(1)+pyp(2))/etot
1353 bez=(pzp(1)+pzp(2))/etot
1354 c boost the reference frame down by beta to get to the pair rest frame:
1356 beta2 = bex ** 2 + bey ** 2 + bez ** 2
1357 gam = 1.d0 / dsqrt(1.d0 - beta2)
1358 if(beta2.ge.0.9999999999999d0) then
1359 write(6,*) '4',pxp(1),pxp(2),pyp(1),pyp(2),
1360 1 pzp(1),pzp(2),pep(1),pep(2),pmp(1),pmp(2),
1361 2 dsqrt(pxp(1)**2+pyp(1)**2+pzp(1)**2+pmp(1)**2)/pep(1),
1362 3 dsqrt(pxp(1)**2+pyp(1)**2+pzp(1)**2)/pep(1)
1363 write(6,*) '4a',pxp(1)+pxp(2),pyp(1)+pyp(2),
1364 1 pzp(1)+pzp(2),etot
1365 write(6,*) '4b',bex,bey,bez,beta2,gam
1368 call lorenza(ftp(j),gxp(j),gyp(j),gzp(j),bex,bey,bez)
1373 call lorenza(pep(j),pxp(j),pyp(j),pzp(j),bex,bey,bez)
1380 if(ftp0(1).ge.ftp0(2)) then
1389 dt0=ftp0(ilate)-ftp0(iearly)
1390 gxp0(iearly)=gxp0(iearly)+pxp0(iearly)/pep0(iearly)*dt0
1391 gyp0(iearly)=gyp0(iearly)+pyp0(iearly)/pep0(iearly)*dt0
1392 gzp0(iearly)=gzp0(iearly)+pzp0(iearly)/pep0(iearly)*dt0
1393 drlocl=dsqrt((gxp0(ilate)-gxp0(iearly))**2
1394 1 +(gyp0(ilate)-gyp0(iearly))**2
1395 2 +(gzp0(ilate)-gzp0(iearly))**2)
1396 c for 3-body kinematics, used for baryons formation:
1397 elseif(icall.eq.3) then
1398 etot=pep(1)+pep(2)+pep(3)
1399 bex=(pxp(1)+pxp(2)+pxp(3))/etot
1400 bey=(pyp(1)+pyp(2)+pyp(3))/etot
1401 bez=(pzp(1)+pzp(2)+pzp(3))/etot
1402 beta2 = bex ** 2 + bey ** 2 + bez ** 2
1403 gam = 1.d0 / dsqrt(1.d0 - beta2)
1404 if(beta2.ge.0.9999999999999d0) then
1405 write(6,*) '5',bex,bey,bez,beta2,gam
1407 c boost the reference frame down by beta to get to the 3-parton rest frame:
1409 call lorenza(ftp(j),gxp(j),gyp(j),gzp(j),bex,bey,bez)
1414 call lorenza(pep(j),pxp(j),pyp(j),pzp(j),bex,bey,bez)
1421 if(ftp0(1).gt.ftp0(2)) then
1423 if(ftp0(3).gt.ftp0(1)) ilate=3
1426 if(ftp0(3).ge.ftp0(2)) ilate=3
1434 elseif(ilate.eq.2) then
1438 elseif(ilate.eq.3) then
1444 do 1003 iearly=imin,imax,istep
1445 dt0=ftp0(ilate)-ftp0(iearly)
1446 gxp0(iearly)=gxp0(iearly)+pxp0(iearly)/pep0(iearly)*dt0
1447 gyp0(iearly)=gyp0(iearly)+pyp0(iearly)/pep0(iearly)*dt0
1448 gzp0(iearly)=gzp0(iearly)+pzp0(iearly)/pep0(iearly)*dt0
1455 c=======================================================================
1458 parameter (MAXSTR=150001,AMN=0.939457,AMP=0.93828)
1459 character*8 code, reffra, FRAME
1461 common/snn/efrm,npart1,npart2
1463 common /lastt/itimeh,bimp
1465 COMMON/hbt/lblast(MAXSTR),xlast(4,MAXSTR),plast(4,MAXSTR),nlast
1467 common/oscar1/iap,izp,iat,izt
1469 common/oscar2/FRAME,amptvn
1476 write (19, 101) 'OSCAR1997A'
1477 write (19, 111) 'final_id_p_x'
1479 if(FRAME.eq.'CMS') then
1481 xmp=(amp*izp+amn*(iap-izp))/iap
1482 xmt=(amp*izt+amn*(iat-izt))/iat
1483 ebeam=(efrm**2-xmp**2-xmt**2)/2./xmt
1484 elseif(FRAME.eq.'LAB') then
1492 write (19, 102) code, amptvn, iap, izp, iat, izt,
1493 & reffra, ebeam, ntestp
1497 if(FRAME.eq.'CMS') write(19,112) efrm
1501 write (19, 103) ievent, nlast, bimp, phi
1504 ene=sqrt(plast(1,i)**2+plast(2,i)**2+plast(3,i)**2
1506 write (19, 104) i, INVFLV(lblast(i)), plast(1,i),
1507 1 plast(2,i),plast(3,i),ene,plast(4,i),
1508 2 xlast(1,i),xlast(2,i),xlast(3,i),xlast(4,i)
1513 102 format (a4,1x,a20,1x,'(', i3, ',', i3, ')+(', i3, ',',
1514 & i3, ')', 2x, a4, 2x, e10.4, 2x, i8)
1515 103 format (i10, 2x, i10, 2x, f8.3, 2x, f8.3)
1516 104 format (i10, 2x, i10, 2x, 9(e12.6, 2x))
1517 112 format ('# Center-of-mass energy/nucleon-pair is',
1523 c=======================================================================
1526 PARAMETER (MAXSTR=150001)
1527 COMMON/HMAIN1/EATT,JATT,NATT,NT,NP,N0,N01,N10,N11
1529 COMMON/HMAIN2/KATT(MAXSTR,4),PATT(MAXSTR,4)
1531 COMMON /HPARNT/HIPR1(100), IHPR2(50), HINT1(100), IHNT2(50)
1533 common/snn/efrm,npart1,npart2
1535 cwei DOUBLE PRECISION PATT
1546 PZPROJ=SQRT(HINT1(6)**2-HINT1(8)**2)
1547 PZTARG=SQRT(HINT1(7)**2-HINT1(9)**2)
1553 if((KATT(I,1).eq.2112.or.KATT(I,1).eq.2212)
1554 1 .and.PATT(I, 1).eq.0.and.PATT(I, 2).eq.0) then
1555 if(PATT(I, 3).gt.amax1(0.,PZPROJ-epsiln)) then
1557 elseif(PATT(I, 3).lt.(-PZTARG+epsiln)) then
1562 npart1=IHNT2(1)-nspec1
1563 npart2=IHNT2(3)-nspec2
1568 c=======================================================================
1569 c 2/18/03 use PYTHIA to decay eta,rho,omega,k*,phi and Delta
1570 subroutine resdec(i1,nt,nnn,wid,idecay)
1572 PARAMETER (hbarc=0.19733)
1573 PARAMETER (AK0=0.498,APICH=0.140,API0=0.135,AN=0.940,ADDM=0.02)
1574 PARAMETER (MAXSTR=150001, MAXR=1)
1575 COMMON /INPUT2/ ILAB, MANYB, NTMAX, ICOLL, INSYS, IPOT, MODE,
1576 & IMOMEN, NFREQ, ICFLOW, ICRHO, ICOU, KPOTEN, KMUL
1578 COMMON/LUJETSA/N,K(9000,5),P(9000,5),V(9000,5)
1580 COMMON/LUDAT1A/MSTU(200),PARU(200),MSTJ(200),PARJ(200)
1582 COMMON/LUDAT2A/KCHG(500,3),PMAS(500,4),PARF(2000),VCKM(4,4)
1584 COMMON/LUDAT3A/MDCY(500,3),MDME(2000,2),BRAT(2000),KFDP(2000,5)
1586 COMMON /CC/ E(MAXSTR)
1588 COMMON /EE/ ID(MAXSTR),LB(MAXSTR)
1590 COMMON /PA/RPION(3,MAXSTR,MAXR)
1592 COMMON /PB/PPION(3,MAXSTR,MAXR)
1594 COMMON /PC/EPION(MAXSTR,MAXR)
1596 COMMON /PD/LPION(MAXSTR,MAXR)
1598 common/input1/ MASSPR,MASSTA,ISEED,IAVOID,DT
1600 common/resdcy/NSAV,iksdcy
1602 common/leadng/lb1,px1,py1,pz1,em1,e1,xfnl,yfnl,zfnl,tfnl,
1603 1 px1n,py1n,pz1n,dp1n
1605 EXTERNAL IARFLV, INVFLV
1606 COMMON/tdecay/tfdcy(MAXSTR),tfdpi(MAXSTR,MAXR),tft(MAXSTR)
1609 COMMON /dpert/dpertt(MAXSTR,MAXR),dpertp(MAXSTR),dplast(MAXSTR),
1610 1 dpdcy(MAXSTR),dpdpi(MAXSTR,MAXR),dpt(MAXSTR, MAXR),
1611 2 dpp1(MAXSTR,MAXR),dppion(MAXSTR,MAXR)
1615 if(lb1.eq.0.or.lb1.eq.25.or.lb1.eq.26.or.lb1.eq.27
1616 & .or.lb1.eq.28.or.lb1.eq.29.or.iabs(lb1).eq.30
1617 c & .or.lb1.eq.28.or.lb1.eq.29
1618 & .or.lb1.eq.24.or.(iabs(lb1).ge.6.and.iabs(lb1).le.9)
1619 & .or.iabs(lb1).eq.16) then
1626 c label as undecayed and the only particle in the record:
1638 c eta or omega in ART may be below or too close to (pi+pi-pi0) mass,
1639 c causing LUDECY error,thus increase their mass ADDM above this thresh,
1640 c noting that rho (m=0.281) too close to 2pi thrshold fails to decay:
1641 if((lb1.eq.0.or.lb1.eq.28).and.em1.lt.(2*APICH+API0+ADDM)) then
1642 em1=2*APICH+API0+ADDM
1644 elseif(lb1.ge.25.and.lb1.le.27.and.em1.lt.(2*APICH+ADDM)) then
1647 elseif(iabs(lb1).eq.30.and.em1.lt.(APICH+AK0+ADDM)) then
1649 c Delta created in ART may be below (n+pich) mass, causing LUDECY error:
1650 elseif(iabs(lb1).ge.6.and.iabs(lb1).le.9
1651 1 .and.em1.lt.(APICH+AN+ADDM)) then
1654 c if(em1.ge.(em1a+0.01)) write (6,*)
1655 c 1 'Mass increase in resdec():',nt,em1-em1a,lb1
1656 e1=SQRT(EM1**2+PX1**2+PY1**2+PZ1**2)
1662 c add decay time to daughter's formation time at the last timestep:
1663 if(nt.eq.ntmax) then
1665 taudcy=tau0*(-1.)*alog(1.-RANART(NSEED))
1668 write(10,*) 'note: ndaut(<1)=',ndaut
1669 write(89,*) 'note: ndaut(<1)=',ndaut
1674 taudcy=taudcy*e1/em1
1676 xfnl=xfnl+px1/e1*taudcy
1677 yfnl=yfnl+py1/e1*taudcy
1678 zfnl=zfnl+pz1/e1*taudcy
1679 c at the last timestep, assign rho, K0S or eta (decay daughter)
1680 c to lb(i1) only (not to lpion) in order to decay them again:
1681 if(n.ge.(nsav+2)) then
1682 do 1001 idau=nsav+2,n
1684 if(kdaut.eq.221.or.kdaut.eq.113
1685 1 .or.kdaut.eq.213.or.kdaut.eq.-213
1686 2 .or.kdaut.eq.310) then
1687 c switch idau and i1(nsav+1):
1694 K(idau,2)=K(nsav+1,2)
1695 p(idau,1)=p(nsav+1,1)
1696 p(idau,2)=p(nsav+1,2)
1697 p(idau,3)=p(nsav+1,3)
1698 p(idau,4)=p(nsav+1,4)
1699 p(idau,5)=p(nsav+1,5)
1706 c note: phi decay may produce rho, K0s or eta, N*(1535) decay may produce
1707 c eta, but only one daughter may be rho, K0s or eta:
1715 do 1002 idau=nsav+1,n
1718 c if(abs(enet-e1).gt.0.02)
1719 c 1 write(93,*) 'resdec(): nt=',nt,enet-e1,lb1
1722 cyy 200 format(a20,3(1x,i6))
1723 cyy 210 format(i6,5(1x,f8.3))
1724 cyy 220 format(a2,i5,5(1x,f8.3))
1726 do 1003 idau=nsav+1,n
1728 lbdaut=IARFLV(kdaut)
1729 c K0S and K0L are named K+/K- during hadron cascade, and only
1730 c at the last timestep they keep their real LB # before output;
1731 c K0/K0bar (from K* decay) converted to K0S and K0L at the last timestep:
1732 if(nt.eq.ntmax.and.(kdaut.eq.130.or.kdaut.eq.310
1733 1 .or.iabs(kdaut).eq.311)) then
1734 if(kdaut.eq.130) then
1736 elseif(kdaut.eq.310) then
1738 elseif(iabs(kdaut).eq.311) then
1739 if(RANART(NSEED).lt.0.5) then
1747 if(idau.eq.(nsav+1)) then
1757 LPION(NNN,IRUN)=lbdaut
1758 EPION(NNN,IRUN)=p(idau,5)
1759 PPION(1,NNN,IRUN)=p(idau,1)
1760 PPION(2,NNN,IRUN)=p(idau,2)
1761 PPION(3,NNN,IRUN)=p(idau,3)
1762 RPION(1,NNN,IRUN)=xfnl
1763 RPION(2,NNN,IRUN)=yfnl
1764 RPION(3,NNN,IRUN)=zfnl
1765 tfdpi(NNN,IRUN)=tfnl
1767 dppion(NNN,IRUN)=dpdecp
1770 cyy 230 format(a2,i5,5(1x,e8.2))
1774 c=======================================================================
1777 COMMON/LUJETSA/N,K(9000,5),P(9000,5),V(9000,5)
1779 common/resdcy/NSAV,iksdcy
1787 c=======================================================================
1788 clin-6/06/02 local parton freezeout motivated from critical density:
1791 implicit double precision (a-h, o-z)
1792 PARAMETER (MAXPTN=400001)
1796 COMMON /prec2/GX5(MAXPTN),GY5(MAXPTN),GZ5(MAXPTN),FT5(MAXPTN),
1797 & PX5(MAXPTN), PY5(MAXPTN), PZ5(MAXPTN), E5(MAXPTN),
1798 & XMASS5(MAXPTN), ITYP5(MAXPTN)
1801 & gxfrz(MAXPTN), gyfrz(MAXPTN), gzfrz(MAXPTN), ftfrz(MAXPTN),
1802 & pxfrz(MAXPTN), pyfrz(MAXPTN), pzfrz(MAXPTN), efrz(MAXPTN),
1804 & tfrz(302), ifrz(MAXPTN), idfrz(MAXPTN), itlast
1806 common /prec4/ vx(MAXPTN), vy(MAXPTN), vz(MAXPTN)
1808 common /prec5/ eta(MAXPTN), rap(MAXPTN), tau(MAXPTN)
1810 common /coal/dpcoal,drcoal,ecritl
1815 if(t.ge.tfrz(it).and.t.lt.tfrz(it+1)) then
1816 if(it.eq.itlast) then
1824 write(1,*) 'local time out of range in LOCAL, stop',t,it
1829 c skip partons which have frozen out:
1830 if(ifrz(ip).eq.1) goto 200
1832 c freezeout all the left partons beyond the time of 3000 fm:
1836 c freezeout when transverse energy density < etcrit:
1837 etcrit=(ecritl*2d0/3d0)
1839 c skip partons which have not yet formed:
1840 if(t.lt.FT5(ip)) goto 200
1843 x0=GX5(ip)+vx(ip)*(t-FT5(ip))
1844 y0=GY5(ip)+vy(ip)*(t-FT5(ip))
1847 c skip self and partons which have not yet formed:
1848 if(itest.eq.ip.or.t.lt.FT5(itest)) goto 100
1850 xtest=GX5(itest)+vx(itest)*(t-FT5(itest))
1851 ytest=GY5(itest)+vy(itest)*(t-FT5(itest))
1852 drt=sqrt((xtest-x0)**2+(ytest-y0)**2)
1853 c count partons within drt<1 and -1<(eta-eta0)<1:
1854 if(dabs(ettest-eta0).le.1d0.and.drt.le.r0)
1855 1 detdy=detdy+dsqrt(PX5(itest)**2+PY5(itest)**2
1856 2 +XMASS5(itest)**2)*0.5d0
1858 detdy=detdy*(dcosh(eta0)**2)/(t*3.1416d0*r0**2*dcosh(rap0))
1859 c when density is below critical density for phase transition, freeze out:
1860 150 if(detdy.le.etcrit) then
1867 xmfrz(ip)=XMASS5(ip)
1868 if(t.gt.FT5(ip)) then
1871 gzfrz(ip)=GZ5(ip)+vz(ip)*(t-FT5(ip))
1874 c if this freezeout time < formation time, use formation time & positions.
1875 c This ensures the recovery of default hadron when e_crit=infty:
1887 c=======================================================================
1888 clin-6/06/02 initialization for local parton freezeout
1891 implicit double precision (a-h, o-z)
1892 PARAMETER (MAXPTN=400001)
1893 common /ilist5/ ct(MAXPTN), ot(MAXPTN), tlarge
1896 & gxfrz(MAXPTN), gyfrz(MAXPTN), gzfrz(MAXPTN), ftfrz(MAXPTN),
1897 & pxfrz(MAXPTN), pyfrz(MAXPTN), pzfrz(MAXPTN), efrz(MAXPTN),
1899 & tfrz(302), ifrz(MAXPTN), idfrz(MAXPTN), itlast
1903 c for freezeout time 0-10fm, use interval of 0.1fm;
1904 c for 10-100fm, use interval of 1fm;
1905 c for 100-1000fm, use interval of 10fm;
1906 c for 1000-3000fm, use interval of 100fm:
1913 tfrz(it)=0d0+dble(it-1)*step1
1916 tfrz(it)=10d0+dble(it-101)*step2
1919 tfrz(it)=100d0+dble(it-191)*step3
1922 tfrz(it)=1000d0+dble(it-281)*step4
1929 clin-5/2009 ctest on v2 analysis
1930 c=======================================================================
1931 c idd=0,1,2,3 specifies different subroutines for partonic flow analysis.
1932 subroutine flowp(idd)
1934 implicit double precision (a-h, o-z)
1936 parameter (MAXPTN=400001)
1938 parameter (bmt=0.05d0)
1939 dimension nlfile(3),nsfile(3),nmfile(3)
1941 dimension v2pp(3),xnpp(3),v2psum(3),v2p2sm(3),nfile(3)
1942 dimension tsp(31),v2pevt(3),v2pavg(3),varv2p(3)
1944 & iscat, jscat, next(MAXPTN), last(MAXPTN),
1945 & ictype, icsta(MAXPTN),
1946 & nic(MAXPTN), icels(MAXPTN)
1950 COMMON /prec2/GX5(MAXPTN),GY5(MAXPTN),GZ5(MAXPTN),FT5(MAXPTN),
1951 & PX5(MAXPTN), PY5(MAXPTN), PZ5(MAXPTN), E5(MAXPTN),
1952 & XMASS5(MAXPTN), ITYP5(MAXPTN)
1954 COMMON /pflow/ v2p(30,3),xnpart(30,3),etp(30,3),
1955 1 s2p(30,3),v2p2(30,3),nevt(30)
1957 COMMON /pflowf/ v2pf(30,3),xnpf(30,3),etpf(30,3),
1958 1 xncoll(30),s2pf(30,3),v2pf2(30,3)
1960 COMMON /pfrz/ v2pfrz(30,3),xnpfrz(30,3),etpfrz(30,3),
1961 1 s2pfrz(30,3),v2p2fz(30,3),tscatt(31),
1962 2 nevtfz(30),iscatt(30)
1964 COMMON /hflow/ v2h(30,3),xnhadr(30,3),eth(30,3),
1965 1 v2h2(30,3),s2h(30,3)
1967 COMMON /AREVT/ IAEVT, IARUN, MISS
1969 common/anim/nevent,isoft,isflag,izpc
1971 common/input1/ MASSPR,MASSTA,ISEED,IAVOID,DT
1973 COMMON /INPUT2/ ILAB, MANYB, NTMAX, ICOLL, INSYS, IPOT, MODE,
1974 & IMOMEN, NFREQ, ICFLOW, ICRHO, ICOU, KPOTEN, KMUL
1976 cc SAVE itimep,iaevtp,v2pp,xnpp,v2psum,v2p2sm
1977 cc SAVE nfile,itanim,nlfile,nsfile,nmfile
1980 dimension etpl(30,3),etps(30,3),etplf(30,3),etpsf(30,3),
1981 & etlfrz(30,3),etsfrz(30,3),
1982 & xnpl(30,3),xnps(30,3),xnplf(30,3),xnpsf(30,3),
1983 & xnlfrz(30,3),xnsfrz(30,3),
1984 & v2pl(30,3),v2ps(30,3),v2plf(30,3),v2psf(30,3),
1985 & s2pl(30,3),s2ps(30,3),s2plf(30,3),s2psf(30,3),
1986 & DMYil(50,3),DMYfl(50,3),
1987 & DMYis(50,3),DMYfs(50,3)
1988 data tsp/0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9,
1989 & 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9,
1990 & 2 , 3, 4, 5, 6, 7, 8, 9, 10, 20, 30/
1991 c idd=0: initialization for flow analysis, called by artdri.f:
1996 cms OPEN (nfile(1),FILE='ana1/v2p.dat', STATUS = 'UNKNOWN')
1997 cms OPEN (nfile(1)+1,
1998 cms 1 FILE = 'ana1/v2p-formed.dat', STATUS = 'UNKNOWN')
1999 cms OPEN (nfile(1)+2,
2000 cms 1 FILE = 'ana1/v2p-active.dat', STATUS = 'UNKNOWN')
2001 cms OPEN (nfile(1)+3,
2002 cms 1 FILE = 'ana1/v2ph.dat', STATUS = 'UNKNOWN')
2003 cms OPEN (nfile(2),FILE='ana1/v2p-y2.dat', STATUS = 'UNKNOWN')
2004 cms OPEN (nfile(2)+1,
2005 cms 1 FILE = 'ana1/v2p-formed2.dat', STATUS = 'UNKNOWN')
2006 cms OPEN (nfile(2)+2,
2007 cms 1 FILE = 'ana1/v2p-active2.dat', STATUS = 'UNKNOWN')
2008 cms OPEN (nfile(2)+3,
2009 cms 1 FILE = 'ana1/v2ph-y2.dat', STATUS = 'UNKNOWN')
2010 cms OPEN (nfile(3),FILE='ana1/v2p-y1.dat', STATUS = 'UNKNOWN')
2011 cms OPEN (nfile(3)+1,
2012 cms 1 FILE = 'ana1/v2p-formed1.dat', STATUS = 'UNKNOWN')
2013 cms OPEN (nfile(3)+2,
2014 cms 1 FILE = 'ana1/v2p-active1.dat', STATUS = 'UNKNOWN')
2015 cms OPEN (nfile(3)+3,
2016 cms 1 FILE = 'ana1/v2ph-y1.dat', STATUS = 'UNKNOWN')
2017 cms OPEN (49, FILE = 'ana1/v2p-ebe.dat', STATUS = 'UNKNOWN')
2018 cms write(49, *) ' ievt, v2p, v2p_y2, v2p_y1'
2020 cms OPEN (59, FILE = 'ana1/v2h.dat', STATUS = 'UNKNOWN')
2021 cms OPEN (68, FILE = 'ana1/v2h-y2.dat', STATUS = 'UNKNOWN')
2022 cms OPEN (69, FILE = 'ana1/v2h-y1.dat', STATUS = 'UNKNOWN')
2023 cms OPEN (88, FILE = 'ana1/v2h-ebe.dat', STATUS = 'UNKNOWN')
2024 cms write(88, *) ' ievt, v2h, v2h_y2, v2h_y1'
2029 cms OPEN (nlfile(1),FILE='ana1/mtl.dat', STATUS = 'UNKNOWN')
2030 cms OPEN (nlfile(1)+1,
2031 cms 1 FILE = 'ana1/mtl-formed.dat', STATUS = 'UNKNOWN')
2032 cms OPEN (nlfile(2),FILE='ana1/mtl-y2.dat', STATUS = 'UNKNOWN')
2033 cms OPEN (nlfile(2)+1,
2034 cms 1 FILE = 'ana1/mtl-formed2.dat', STATUS = 'UNKNOWN')
2035 cms OPEN (nlfile(3),FILE='ana1/mtl-y1.dat', STATUS = 'UNKNOWN')
2036 cms OPEN (nlfile(3)+1,
2037 cms 1 FILE = 'ana1/mtl-formed1.dat', STATUS = 'UNKNOWN')
2041 cms OPEN (nsfile(1),FILE='ana1/mts.dat', STATUS = 'UNKNOWN')
2042 cms OPEN (nsfile(1)+1,
2043 cms 1 FILE = 'ana1/mts-formed.dat', STATUS = 'UNKNOWN')
2044 cms OPEN (nsfile(2),FILE='ana1/mts-y2.dat', STATUS = 'UNKNOWN')
2045 cms OPEN (nsfile(2)+1,
2046 cms 1 FILE = 'ana1/mts-formed2.dat', STATUS = 'UNKNOWN')
2047 cms OPEN (nsfile(3),FILE='ana1/mts-y1.dat', STATUS = 'UNKNOWN')
2048 cms OPEN (nsfile(3)+1,
2049 cms 1 FILE = 'ana1/mts-formed1.dat', STATUS = 'UNKNOWN')
2053 cms OPEN (nmfile(1),FILE='ana1/Nmt.dat', STATUS = 'UNKNOWN')
2054 cms OPEN (nmfile(2),FILE='ana1/Nmt-y2.dat', STATUS = 'UNKNOWN')
2055 cms OPEN (nmfile(3),FILE='ana1/Nmt-y1.dat', STATUS = 'UNKNOWN')
2056 clin-11/27/00 for animation:
2057 if(nevent.eq.1) then
2058 cms OPEN (91, FILE = 'ana1/h-animate.dat', STATUS = 'UNKNOWN')
2059 cms write(91,*) ntmax, dt
2060 cms OPEN (92, FILE = 'ana1/p-animate.dat', STATUS = 'UNKNOWN')
2061 cms OPEN (93, FILE = 'ana1/p-finalft.dat', STATUS = 'UNKNOWN')
2133 c idd=1: calculate parton elliptic flow, called by zpc.f:
2134 else if(idd.eq.1) then
2136 do 1008 ianp = 1, 30
2137 if (t2time.lt.tsp(ianp+1).and.t2time.ge.tsp(ianp)) then
2138 c write flow info only once at each fixed time:
2139 xncoll(ianp)=xncoll(ianp)+1d0
2140 c to prevent an earlier t2time comes later in the same event
2142 if(ianp.le.itimep.and.iaevt.eq.iaevtp) goto 101
2143 nevt(ianp)=nevt(ianp)+1
2144 tscatt(ianp+1)=t2time
2146 nevtfz(ianp)=nevtfz(ianp)+1
2148 ypartn=0.5d0*dlog((E5(i)+PZ5(i))/(E5(i)-PZ5(i)+1.d-8))
2149 pt2=PX5(I)**2+PY5(I)**2
2150 ctest off: initial (pt,y) and (x,y) distribution:
2152 c if(ianp.eq.idtime) then
2153 c iityp=iabs(ITYP5(I))
2154 c if(iityp.eq.1.or.iityp.eq.2) then
2155 c write(651,*) dsqrt(pt2),ypartn
2156 c write(654,*) GX5(I),GY5(I)
2157 c elseif(iityp.eq.1103.or.iityp.eq.2101
2158 c 1 .or.iityp.eq.2103.or.iityp.eq.2203.
2159 c 2 .or.iityp.eq.3101.or.iityp.eq.3103.
2160 c 3 .or.iityp.eq.3201.or.iityp.eq.3203.or.iityp.eq.3303)
2162 c write(652,*) dsqrt(pt2),ypartn
2163 c write(655,*) GX5(I),GY5(I)
2164 c elseif(iityp.eq.21) then
2165 c write(653,*) dsqrt(pt2),ypartn
2166 c write(656,*) GX5(I),GY5(I)
2170 ctest off density with 2fm radius and z:(-0.1*t,0.1*t):
2171 c gx_now=GX5(i)+(t2time-FT5(i))*PX5(i)/E5(i)
2172 c gy_now=GY5(i)+(t2time-FT5(i))*PY5(i)/E5(i)
2173 c gz_now=GZ5(i)+(t2time-FT5(i))*PZ5(i)/E5(i)
2174 c rt_now=dsqrt(gx_now**2+gy_now**2)
2176 c volume=3.1416d0*(2d0**2)*(2*zmax)
2177 c if(rt_now.gt.2d0.or.dabs(gz_now).gt.zmax)
2181 if(dabs(ypartn).le.1d0) then
2183 if(dabs(ypartn).le.0.5d0) then
2189 v2prtn=(PX5(I)**2-PY5(I)**2)/pt2
2190 if(abs(v2prtn).gt.1.)
2191 1 write(nfile(iy),*) 'v2prtn>1',v2prtn
2192 v2p(ianp,iy)=v2p(ianp,iy)+v2prtn
2193 v2p2(ianp,iy)=v2p2(ianp,iy)+v2prtn**2
2195 xperp2=GX5(I)**2+GY5(I)**2
2197 1 s2p(ianp,iy)=s2p(ianp,iy)+(GX5(I)**2-GY5(I)**2)/xperp2
2198 xnpart(ianp,iy)=xnpart(ianp,iy)+1d0
2199 etp(ianp,iy)=etp(ianp,iy)+dsqrt(pt2+XMASS5(I)**2)
2201 c etp(ianp,iy)=etp(ianp,iy)
2202 c 1 +dsqrt(pt2+XMASS5(I)**2+PZ5(i)**2)/volume
2203 clin-2/22/00 to write out parton info only for formed ones:
2204 if(FT5(I).le.t2time) then
2205 v2pf(ianp,iy)=v2pf(ianp,iy)+v2prtn
2206 v2pf2(ianp,iy)=v2pf2(ianp,iy)+v2prtn**2
2208 1 s2pf(ianp,iy)=s2pf(ianp,iy)+(GX5(I)**2-GY5(I)**2)/xperp2
2209 xnpf(ianp,iy)=xnpf(ianp,iy)+1d0
2210 etpf(ianp,iy)=etpf(ianp,iy)+dsqrt(pt2+XMASS5(I)**2)
2212 c etpf(ianp,iy)=etpf(ianp,iy)
2213 c 1 +dsqrt(pt2+XMASS5(I)**2+PZ5(i)**2)/volume
2219 clin-3/30/00 ebe v2 variables:
2222 npartn=IDINT(xnpart(ianp,iy)-xnpp(iy))
2223 if(npartn.ne.0) then
2224 v2pevt(iy)=(v2p(ianp,iy)-v2pp(iy))/npartn
2225 v2psum(iy)=v2psum(iy)+v2pevt(iy)
2226 v2p2sm(iy)=v2p2sm(iy)+v2pevt(iy)**2
2227 v2pp(iy)=v2p(ianp,iy)
2228 xnpp(iy)=xnpart(ianp,iy)
2231 write(49, 160) iaevt,v2pevt
2236 clin-11/28/00 for animation:
2237 101 if(nevent.eq.1) then
2238 do 110 nt = 1, ntmax
2240 time2=dble((nt+1)*dt)
2241 if (t2time.lt.time2.and.t2time.ge.time1) then
2242 if(nt.le.itanim) return
2243 c write(92,*) t2time
2246 c write out parton info only for formed ones:
2247 if(FT5(I).le.t2time) then
2253 if(FT5(I).le.t2time) then
2254 clin-11/29/00-ctest off calculate parton coordinates after propagation:
2255 c gx_now=GX5(i)+(t2time-FT5(i))*PX5(i)/E5(i)
2256 c gy_now=GY5(i)+(t2time-FT5(i))*PY5(i)/E5(i)
2257 c gz_now=GZ5(i)+(t2time-FT5(i))*PZ5(i)/E5(i)
2258 c write(92,140) ITYP5(i),GX5(i),GY5(i),GZ5(i),FT5(i)
2259 c write(92,180) ITYP5(i),GX5(i),GY5(i),GZ5(i),FT5(i),
2260 c 1 PX5(i),PY5(i),PZ5(i),E5(i)
2269 140 format(i10,4(2x,f7.2))
2270 160 format(i10,3(2x,f9.5))
2271 c 180 format(i6,8(1x,f7.2))
2272 clin-5/17/01 calculate v2 for active partons (which have not frozen out):
2273 c idd=3, called at end of zpc.f:
2274 else if(idd.eq.3) then
2276 if(iscatt(ianp).eq.0) tscatt(ianp+1)=tscatt(ianp)
2279 ypartn=0.5d0*dlog((E5(i)+PZ5(i)+1.d-8)
2280 1 /(E5(i)-PZ5(i)+1.d-8))
2281 pt2=PX5(I)**2+PY5(I)**2
2283 if(dabs(ypartn).le.1d0) then
2285 if(dabs(ypartn).le.0.5d0) then
2291 if(iscatt(ianp).ne.0) then
2292 if(FT5(I).lt.tscatt(ianp+1)
2293 1 .and.FT5(I).ge.tscatt(ianp)) then
2296 v2prtn=(PX5(I)**2-PY5(I)**2)/pt2
2297 v2pfrz(ianp,iy)=v2pfrz(ianp,iy)+v2prtn
2298 v2p2fz(ianp,iy)=v2p2fz(ianp,iy)+v2prtn**2
2300 xperp2=GX5(I)**2+GY5(I)**2
2301 if(xperp2.gt.0.) s2pfrz(ianp,iy)=
2302 1 s2pfrz(ianp,iy)+(GX5(I)**2-GY5(I)**2)/xperp2
2303 etpfrz(ianp,iy)=etpfrz(ianp,iy)+dsqrt(pt2+XMASS5(I)**2)
2304 xnpfrz(ianp,iy)=xnpfrz(ianp,iy)+1d0
2306 c etpfrz(ianp,iy)=etpfrz(ianp,iy)
2307 c 1 +dsqrt(pt2+XMASS5(I)**2+PZ5(i)**2)/volume
2309 if(ITYP5(I).eq.1.or.ITYP5(I).eq.2)then
2310 etlfrz(ianp,iy)=etlfrz(ianp,iy)+dsqrt(pt2+XMASS5(I)**2)
2311 xnlfrz(ianp,iy)=xnlfrz(ianp,iy)+1d0
2312 elseif(ITYP5(I).eq.3)then
2313 etsfrz(ianp,iy)=etsfrz(ianp,iy)+dsqrt(pt2+XMASS5(I)**2)
2314 xnsfrz(ianp,iy)=xnsfrz(ianp,iy)+1d0
2318 c parton freezeout info taken, proceed to next parton:
2324 c idd=2: calculate average partonic elliptic flow, called from artdri.f,
2325 else if(idd.eq.2) then
2327 cms write(nfile(i),*) ' tsp, v2p, v2p2, '//
2328 cms 1 ' s2p, etp, xmult, nevt, xnctot'
2329 cms write ((nfile(i)+1),*) ' tsp, v2pf, v2pf2, '//
2330 cms 1 ' s2pf, etpf, xnform, xcrate'
2331 cms write ((nfile(i)+2),*) ' tsp, v2pa, v2pa2, '//
2332 cms 1 ' s2pa, etpa, xmult_ap, xnform, nevt'
2333 cms write ((nfile(i)+3),*) ' tsph, v2ph, v2ph2, '//
2334 cms 1 ' s2ph, etph, xmult_(ap/2+h),xmult_ap/2,nevt'
2336 cms write(nlfile(i),*) ' tsp, v2, s2, etp, xmul'
2337 cms write(nsfile(i),*) ' tsp, v2, s2, etp, xmul'
2338 cms write(nlfile(i)+1,*) ' tsp, v2, s2, etp, xmul'
2339 cms write(nsfile(i)+1,*) ' tsp, v2, s2, etp, xmul'
2342 clin-3/30/00 ensemble average & variance of v2 (over particles in all events):
2344 if(nevt(ii).eq.0) goto 150
2346 if(xnpart(ii,iy).gt.1) then
2347 v2p(ii,iy)=v2p(ii,iy)/xnpart(ii,iy)
2348 v2p2(ii,iy)=dsqrt((v2p2(ii,iy)/xnpart(ii,iy)
2349 1 -v2p(ii,iy)**2)/(xnpart(ii,iy)-1))
2350 s2p(ii,iy)=s2p(ii,iy)/xnpart(ii,iy)
2351 c xmult and etp are multiplicity and et for an averaged event:
2352 xmult=dble(xnpart(ii,iy)/dble(nevt(ii)))
2353 etp(ii,iy)=etp(ii,iy)/dble(nevt(ii))
2355 etpl(ii,iy)=etpl(ii,iy)/dble(nevt(ii))
2356 etps(ii,iy)=etps(ii,iy)/dble(nevt(ii))
2360 xnctot=xnctot+xncoll(inum)
2362 if(nevt(1).ne.0) xnctot=xnctot/nevt(1)
2363 cms write (nfile(iy),200) tsp(ii),v2p(ii,iy),
2364 cms 1 v2p2(ii,iy),s2p(ii,iy),etp(ii,iy),xmult,nevt(ii),xnctot
2367 1 xcrate=xncoll(ii)/(tsp(ii+1)-tsp(ii))/nevt(ii)
2369 if(xnpf(ii,iy).gt.1) then
2370 v2pf(ii,iy)=v2pf(ii,iy)/xnpf(ii,iy)
2371 v2pf2(ii,iy)=dsqrt((v2pf2(ii,iy)/xnpf(ii,iy)
2372 1 -v2pf(ii,iy)**2)/(xnpf(ii,iy)-1))
2373 s2pf(ii,iy)=s2pf(ii,iy)/xnpf(ii,iy)
2374 xnform=dble(xnpf(ii,iy)/dble(nevt(ii)))
2375 etpf(ii,iy)=etpf(ii,iy)/dble(nevt(ii))
2377 etplf(ii,iy)=etplf(ii,iy)/dble(nevt(ii))
2378 etpsf(ii,iy)=etpsf(ii,iy)/dble(nevt(ii))
2380 cms write (nfile(iy)+1, 210) tsp(ii),v2pf(ii,iy),
2381 cms 1 v2pf2(ii,iy),s2pf(ii,iy),etpf(ii,iy),xnform,xcrate
2384 if(xnpl(ii,iy).gt.1) then
2385 v2pl(ii,iy)=v2pl(ii,iy)/xnpl(ii,iy)
2386 s2pl(ii,iy)=s2pl(ii,iy)/xnpl(ii,iy)
2387 xmult=dble(xnpl(ii,iy)/dble(nevt(ii)))
2388 etpl(ii,iy)=etpl(ii,iy)/dble(nevt(ii))
2389 cms write (nlfile(iy),201) tsp(ii),v2pl(ii,iy),
2390 cms 1 s2pl(ii,iy),etpl(ii,iy),xmult
2392 if(xnps(ii,iy).gt.1) then
2393 v2ps(ii,iy)=v2ps(ii,iy)/xnps(ii,iy)
2394 s2ps(ii,iy)=s2ps(ii,iy)/xnps(ii,iy)
2395 xmult=dble(xnps(ii,iy)/dble(nevt(ii)))
2396 etps(ii,iy)=etps(ii,iy)/dble(nevt(ii))
2397 cms write (nsfile(iy),201) tsp(ii),v2ps(ii,iy),
2398 cms 1 s2ps(ii,iy),etps(ii,iy),xmult
2400 if(xnplf(ii,iy).gt.1) then
2401 v2plf(ii,iy)=v2plf(ii,iy)/xnplf(ii,iy)
2402 s2plf(ii,iy)=s2plf(ii,iy)/xnplf(ii,iy)
2403 xmult=dble(xnplf(ii,iy)/dble(nevt(ii)))
2404 etplf(ii,iy)=etplf(ii,iy)/dble(nevt(ii))
2405 cms write (nlfile(iy)+1,201) tsp(ii),v2plf(ii,iy),
2406 cms 1 s2plf(ii,iy),etplf(ii,iy),xmult
2408 if(xnpsf(ii,iy).gt.1) then
2409 v2psf(ii,iy)=v2psf(ii,iy)/xnpsf(ii,iy)
2410 s2psf(ii,iy)=s2psf(ii,iy)/xnpsf(ii,iy)
2411 xmult=dble(xnpsf(ii,iy)/dble(nevt(ii)))
2412 etpsf(ii,iy)=etpsf(ii,iy)/dble(nevt(ii))
2413 cms write (nsfile(iy)+1,201) tsp(ii),v2psf(ii,iy),
2414 cms 1 s2psf(ii,iy),etpsf(ii,iy),xmult
2419 csp07/05 initial & final mt distrb
2422 if(nevt(1).ne.0) SCALEi = 1d0 / dble(nevt(1)) / BMT
2423 if(nevt(30).ne.0) SCALEf = 1d0 / dble(nevt(30)) / BMT
2426 if(iy .eq. 2)yra = 2d0
2428 cms WRITE(nmfile(iy),251) BMT*dble(I - 0.5),
2429 cms & SCALEi*DMYil(I,iy)/yra, SCALEf*DMYfl(I,iy)/yra,
2430 cms & SCALEi*DMYis(I,iy)/yra, SCALEf*DMYfs(I,iy)/yra
2434 clin-3/30/00 event-by-event average & variance of v2:
2435 if(nevt(30).ge.1) then
2437 v2pavg(iy)=v2psum(iy)/nevt(30)
2438 v2var0=v2p2sm(iy)/nevt(30)-v2pavg(iy)**2
2439 if(v2var0.gt.0) varv2p(iy)=dsqrt(v2var0)
2441 write(49, 240) 'EBE v2p,v2p(y2),v2p(y1): avg=', v2pavg
2442 write(49, 240) 'EBE v2p,v2p(y2),v2p(y1): var=', varv2p
2444 clin-11/28/00 for animation:
2445 if(nevent.eq.1) then
2447 if(FT5(I).le.t2time) then
2448 write(93,140) ITYP5(i),GX5(i),GY5(i),GZ5(i),FT5(i)
2451 clin-11/29/00 signal the end of animation file:
2460 clin-5/18/01 calculate v2 for active partons:
2468 if(xnpf(ianp,iy).gt.1) then
2469 c reconstruct the sum of v2p, v2p2, s2p, etp, and xnp for formed partons:
2470 v2pact=v2pf(ianp,iy)*xnpf(ianp,iy)
2471 v2p2ac=(v2pf2(ianp,iy)**2*(xnpf(ianp,iy)-1)
2472 1 +v2pf(ianp,iy)**2)*xnpf(ianp,iy)
2473 s2pact=s2pf(ianp,iy)*xnpf(ianp,iy)
2474 etpact=etpf(ianp,iy)*dble(nevt(ianp))
2475 xnpact=xnpf(ianp,iy)
2478 v2pact=v2pact-v2pfrz(kanp,iy)
2479 v2p2ac=v2p2ac-v2p2fz(kanp,iy)
2480 s2pact=s2pact-s2pfrz(kanp,iy)
2481 etpact=etpact-etpfrz(kanp,iy)
2482 xnpact=xnpact-xnpfrz(kanp,iy)
2484 c save the sum of v2p, v2p2, s2p, etp, and xnp for formed partons:
2491 if(xnpact.gt.1.and.nevt(ianp).ne.0) then
2492 v2pact=v2pact/xnpact
2493 v2p2ac=dsqrt((v2p2ac/xnpact
2494 1 -v2pact**2)/(xnpact-1))
2495 s2pact=s2pact/xnpact
2496 xnacti=dble(xnpact/dble(nevt(ianp)))
2497 etpact=etpact/dble(nevt(ianp))
2498 cms write (nfile(iy)+2, 250) tsp(ianp),v2pact,
2499 cms 1 v2p2ac,s2pact,etpact,xnacti,
2500 cms 2 xnpf(ianp,iy)/dble(nevt(ianp)),nevt(ianp)
2503 c To calculate combined v2 for active partons plus formed hadrons,
2504 c add the sum of v2h, v2h2, s2h, eth, and xnh for formed hadrons:
2505 c scale the hadron part in case nevt(ianp) != nevent:
2506 shadr=dble(nevt(ianp))/dble(nevent)
2508 v2ph=v2ph+v2h(ianh,iy)*xnhadr(ianh,iy)*shadr
2509 v2ph2=v2ph2+(v2h2(ianh,iy)**2*(xnhadr(ianh,iy)-1)
2510 1 +v2h(ianh,iy)**2)*xnhadr(ianh,iy)*shadr
2511 s2ph=s2ph+s2h(ianh,iy)*xnhadr(ianh,iy)*shadr
2512 etph=etph+eth(ianh,iy)*dble(nevent)*shadr
2513 xnph=xnpact+xnhadr(ianh,iy)*shadr
2514 xnp2h=xnp2+xnhadr(ianh,iy)*shadr
2517 v2ph2=dsqrt((v2ph2/xnph-v2ph**2)/(xnph-1))
2519 etph=etph/dble(nevt(ianp))
2520 xnp2=xnp2/dble(nevt(ianp))
2521 xnp2h=xnp2h/dble(nevent)
2522 cms if(tsp(ianp).le.(ntmax*dt))
2523 cms 1 write (nfile(iy)+3, 250) tsp(ianp),v2ph,
2524 cms 2 v2ph2,s2ph,etph,xnp2h,xnp2,nevt(ianp)
2536 c reconstruct the sum of v2p, v2p2, s2p, etp, and xnp for formed partons:
2537 v2pact=v2pf(ianp,iy)*xnpf(ianp,iy)
2538 v2p2ac=(v2pf2(ianp,iy)**2*(xnpf(ianp,iy)-1)
2539 1 +v2pf(ianp,iy)**2)*xnpf(ianp,iy)
2540 s2pact=s2pf(ianp,iy)*xnpf(ianp,iy)
2541 etpact=etpf(ianp,iy)*dble(nevt(ianp))
2542 xnpact=xnpf(ianp,iy)
2549 cms close(nfile(nf)+ifile)
2556 cyy 200 format(2x,f5.2,3(2x,f7.4),2(2x,f9.2),i6,2x,f9.2)
2557 cyy 210 format(2x,f5.2,3(2x,f7.4),3(2x,f9.2))
2558 240 format(a30,3(2x,f9.5))
2559 cyy 250 format(2x,f5.2,3(2x,f7.4),3(2x,f9.2),i6)
2561 cyy 201 format(2x,f5.2,4(2x,f9.2))
2562 cyy 251 format(5e15.5)
2567 c=======================================================================
2568 c Calculate flow from formed hadrons, called by art1e.f:
2569 c Note: numbers in art not in double precision!
2570 subroutine flowh(ct)
2571 PARAMETER (MAXSTR=150001, MAXR=1)
2573 DOUBLE PRECISION v2h,xnhadr,eth,v2h2,s2h
2574 DOUBLE PRECISION v2hp,xnhadp,v2hsum,v2h2sm,v2hevt(3)
2575 DOUBLE PRECISION pt2, v2hadr
2576 COMMON /hflow/ v2h(30,3),xnhadr(30,3),eth(30,3),
2577 1 v2h2(30,3),s2h(30,3)
2579 common/ebe/v2hp(3),xnhadp(3),v2hsum(3),v2h2sm(3)
2581 common /lastt/itimeh,bimp
2585 COMMON /AA/ R(3,MAXSTR)
2587 COMMON /BB/ P(3,MAXSTR)
2589 COMMON /CC/ E(MAXSTR)
2591 COMMON /EE/ ID(MAXSTR),LB(MAXSTR)
2593 COMMON /RR/ MASSR(0:MAXR)
2595 common/anim/nevent,isoft,isflag,izpc
2597 COMMON /AREVT/ IAEVT, IARUN, MISS
2605 do 1004 ianh = 1, 30
2606 if ((ct+0.0001).lt.tsh(ianh+1)
2607 1 .and.(ct+0.0001).ge.tsh(ianh)) then
2608 if(ianh.eq.itimeh) goto 101
2612 IA = IA + MASSR(J - 1)
2615 c 5/04/01 exclude leptons and photons:
2616 if(iabs(LB(I)-10000).lt.100) goto 100
2619 pt2=dble(px)**2+dble(py)**2
2620 c 2/18/00 Note: e(i) gives the mass in ART:
2621 ene=sqrt(e(i)**2+sngl(pt2)+p(3,i)**2)
2622 RAP=0.5*alog((ene+p(3,i))/(ene-p(3,i)))
2623 ctest off density with 2fm radius and z:(-0.1*t,0.1*t):
2624 c rt_now=sqrt(r(1,i)**2+r(2,i)**2)
2627 c volume=3.1416*(2.**2)*2*zmax
2628 c if(rt_now.gt.2.or.abs(gz_now).gt.zmax)
2631 if(abs(rap).le.1) then
2633 if(abs(rap).le.0.5) then
2639 v2hadr=(dble(px)**2-dble(py)**2)/pt2
2640 v2h(ianh,iy)=v2h(ianh,iy)+v2hadr
2641 v2h2(ianh,iy)=v2h2(ianh,iy)+v2hadr**2
2642 if(dabs(v2hadr).gt.1d0)
2643 1 write(1,*) 'v2hadr>1',v2hadr,px,py
2645 xperp2=r(1,I)**2+r(2,I)**2
2647 1 s2h(ianh,iy)=s2h(ianh,iy)+dble((r(1,I)**2-r(2,I)**2)/xperp2)
2648 eth(ianh,iy)=eth(ianh,iy)+dble(SQRT(e(i)**2+sngl(pt2)))
2650 c eth(ianh,iy)=eth(ianh,iy)
2651 c 1 +dble(SQRT(e(i)**2+sngl(pt2)+p(3,i)**2))/volume
2652 xnhadr(ianh,iy)=xnhadr(ianh,iy)+1d0
2657 clin-5/04/01 ebe v2 variables:
2660 nhadrn=IDINT(xnhadr(ianh,iy)-xnhadp(iy))
2661 if(nhadrn.ne.0) then
2662 v2hevt(iy)=(v2h(ianh,iy)-v2hp(iy))/dble(nhadrn)
2663 v2hsum(iy)=v2hsum(iy)+v2hevt(iy)
2664 v2h2sm(iy)=v2h2sm(iy)+v2hevt(iy)**2
2665 v2hp(iy)=v2h(ianh,iy)
2666 xnhadp(iy)=xnhadr(ianh,iy)
2669 write(88, 160) iaevt,v2hevt
2674 160 format(i10,3(2x,f9.5))
2675 clin-11/27/00 for animation:
2676 101 if(nevent.eq.1) then
2680 IA = IA + MASSR(J - 1)
2685 c write(91,210) LB(i),r(1,i),r(2,i),r(3,i),
2686 c 1 p(1,i),p(2,i),p(3,i),e(i)
2691 c 210 format(i6,7(1x,f8.3))
2695 c=======================================================================
2696 subroutine flowh0(NEVNT,idd)
2699 DOUBLE PRECISION v2h,xnhadr,eth,v2h2,s2h
2700 DOUBLE PRECISION v2hp,xnhadp,v2hsum,v2h2sm,
2701 1 v2havg(3),varv2h(3)
2702 COMMON /hflow/ v2h(30,3),xnhadr(30,3),eth(30,3),
2703 1 v2h2(30,3),s2h(30,3)
2705 common/ebe/v2hp(3),xnhadp(3),v2hsum(3),v2h2sm(3)
2707 common/input1/ MASSPR,MASSTA,ISEED,IAVOID,DT
2709 COMMON /INPUT2/ ILAB, MANYB, NTMAX, ICOLL, INSYS, IPOT, MODE,
2710 & IMOMEN, NFREQ, ICFLOW, ICRHO, ICOU, KPOTEN, KMUL
2712 common /lastt/itimeh,bimp
2716 c idd=0: initialization for flow analysis, called by artdri.f::
2740 elseif(iy.eq.2) then
2745 write(nunit,*) ' tsh, v2h, v2h2, s2h, '//
2748 c idd=2: calculate average hadronic elliptic flow, called by artdri.f:
2749 else if(idd.eq.2) then
2752 if(xnhadr(ii,iy).eq.0) then
2754 elseif(xnhadr(ii,iy).gt.1) then
2755 v2h(ii,iy)=v2h(ii,iy)/xnhadr(ii,iy)
2756 eth(ii,iy)=eth(ii,iy)/dble(NEVNT)
2757 v2h2(ii,iy)=dsqrt((v2h2(ii,iy)/xnhadr(ii,iy)
2758 1 -v2h(ii,iy)**2)/(xnhadr(ii,iy)-1))
2759 s2h(ii,iy)=s2h(ii,iy)/xnhadr(ii,iy)
2760 xmulth=sngl(xnhadr(ii,iy)/NEVNT)
2764 elseif(iy.eq.2) then
2769 if(tsh(ii).le.(ntmax*dt))
2770 1 write (nunit,200) tsh(ii),v2h(ii,iy),
2771 2 v2h2(ii,iy),s2h(ii,iy),eth(ii,iy),xmulth
2774 c event-by-event average & variance of v2h:
2776 v2havg(iy)=v2hsum(iy)/dble(NEVNT)
2777 varv2h(iy)=dsqrt(v2h2sm(iy)/dble(NEVNT)-v2havg(iy)**2)
2779 write(88, 240) 'EBE v2h,v2h(y2),v2h(y1): avg=', v2havg
2780 write(88, 240) 'EBE v2h,v2h(y2),v2h(y1): var=', varv2h
2782 200 format(2x,f5.2,3(2x,f7.4),2(2x,f9.2))
2783 240 format(a30,3(2x,f9.5))
2787 c=======================================================================
2788 c 2/23/00 flow from all initial hadrons just before entering ARTMN:
2789 subroutine iniflw(NEVNT,idd)
2790 PARAMETER (MAXSTR=150001, MAXR=1)
2791 DOUBLE PRECISION v2i,eti,xmulti,v2mi,s2mi,xmmult,
2795 COMMON /ARERC1/MULTI1(MAXR)
2797 COMMON /ARPRC1/ITYP1(MAXSTR, MAXR),
2798 & GX1(MAXSTR, MAXR), GY1(MAXSTR, MAXR), GZ1(MAXSTR, MAXR),
2799 & FT1(MAXSTR, MAXR),
2800 & PX1(MAXSTR, MAXR), PY1(MAXSTR, MAXR), PZ1(MAXSTR, MAXR),
2801 & EE1(MAXSTR, MAXR), XM1(MAXSTR, MAXR)
2803 COMMON/iflow/v2i,eti,xmulti,v2mi,s2mi,xmmult,v2bi,s2bi,xbmult
2817 else if(idd.eq.1) then
2819 do 1001 I = 1, MULTI1(J)
2822 IF (ITYP .GT. -100 .AND. ITYP .LT. 100) GOTO 100
2831 if(pt2.gt.0) v2i=v2i+dble((px**2-py**2)/pt2)
2832 eti=eti+dble(SQRT(PX ** 2 + PY ** 2 + XM ** 2))
2834 IF (ITYP .LT. -1000 .or. ITYP .GT. 1000) then
2836 if(pt2.gt.0) v2bi=v2bi+dble((px**2-py**2)/pt2)
2837 if(xt2.gt.0) s2bi=s2bi+dble((xh**2-yh**2)/xt2)
2841 if(pt2.gt.0) v2mi=v2mi+dble((px**2-py**2)/pt2)
2842 if(xt2.gt.0) s2mi=s2mi+dble((xh**2-yh**2)/xt2)
2847 else if(idd.eq.2) then
2848 if(xmulti.ne.0) v2i=v2i/xmulti
2850 xmulti=xmulti/dble(NEVNT)
2851 if(xmmult.ne.0) then
2855 xmmult=xmmult/dble(NEVNT)
2856 if(xbmult.ne.0) then
2860 xbmult=xbmult/dble(NEVNT)
2866 c=======================================================================
2867 c 2/25/00 dN/dt analysis for production (before ZPCMN)
2868 c and freezeout (right after ZPCMN) for all partons.
2869 subroutine frztm(NEVNT,idd)
2871 implicit double precision (a-h, o-z)
2872 PARAMETER (MAXPTN=400001)
2876 COMMON /prec1/GX0(MAXPTN),GY0(MAXPTN),GZ0(MAXPTN),FT0(MAXPTN),
2877 & PX0(MAXPTN), PY0(MAXPTN), PZ0(MAXPTN), E0(MAXPTN),
2878 & XMASS0(MAXPTN), ITYP0(MAXPTN)
2880 COMMON /prec2/GX5(MAXPTN),GY5(MAXPTN),GZ5(MAXPTN),FT5(MAXPTN),
2881 & PX5(MAXPTN), PY5(MAXPTN), PZ5(MAXPTN), E5(MAXPTN),
2882 & XMASS5(MAXPTN), ITYP5(MAXPTN)
2884 COMMON /frzout/ xnprod(30),etprod(30),xnfrz(30),etfrz(30),
2885 & dnprod(30),detpro(30),dnfrz(30),detfrz(30)
2888 data tsf/0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9,
2889 & 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9,
2890 & 2 , 3, 4, 5, 6, 7, 8, 9, 10, 20, 30/
2903 cms OPEN (86, FILE = 'ana1/production.dat', STATUS = 'UNKNOWN')
2904 cms OPEN (87, FILE = 'ana1/freezeout.dat', STATUS = 'UNKNOWN')
2905 else if(idd.eq.1) then
2908 eth0=dSQRT(PX0(ip)**2+PY0(ip)**2+XMASS0(ip)**2)
2909 eth2=dSQRT(PX5(ip)**2+PY5(ip)**2+XMASS5(ip)**2)
2910 c total number and Et produced by time tsf(ii):
2911 if (ft0(ip).lt.tsf(ii+1)) then
2912 xnprod(ii)=xnprod(ii)+1d0
2913 etprod(ii)=etprod(ii)+eth0
2914 c number and Et produced from time tsf(ii) to tsf(ii+1):
2915 if (ft0(ip).ge.tsf(ii)) then
2916 dnprod(ii)=dnprod(ii)+1d0
2917 detpro(ii)=detpro(ii)+eth0
2920 c total number and Et freezed out by time tsf(ii):
2921 if (FT5(ip).lt.tsf(ii+1)) then
2922 xnfrz(ii)=xnfrz(ii)+1d0
2923 etfrz(ii)=etfrz(ii)+eth2
2924 c number and Et freezed out from time tsf(ii) to tsf(ii+1):
2925 if (FT5(ip).ge.tsf(ii)) then
2926 dnfrz(ii)=dnfrz(ii)+1d0
2927 detfrz(ii)=detfrz(ii)+eth2
2932 else if(idd.eq.2) then
2933 cms write (86,*) ' t, np, dnp/dt, etp '//
2935 cms write (87,*) ' t, nf, dnf/dt, etf '//
2938 xnp=xnprod(ii)/dble(NEVNT)
2939 xnf=xnfrz(ii)/dble(NEVNT)
2940 etp=etprod(ii)/dble(NEVNT)
2941 etf=etfrz(ii)/dble(NEVNT)
2942 dxnp=dnprod(ii)/dble(NEVNT)/(tsf(ii+1)-tsf(ii))
2943 dxnf=dnfrz(ii)/dble(NEVNT)/(tsf(ii+1)-tsf(ii))
2944 detp=detpro(ii)/dble(NEVNT)/(tsf(ii+1)-tsf(ii))
2945 detf=detfrz(ii)/dble(NEVNT)/(tsf(ii+1)-tsf(ii))
2947 cms 1 tsf(ii+1),xnp,dxnp,etp,detp
2949 cms 1 tsf(ii+1),xnf,dxnf,etf,detf
2952 cyy 200 format(2x,f9.2,4(2x,f10.2))
2957 c=======================================================================
2958 clin-6/2009 write out initial minijet information
2959 c before propagating to its formation time:
2960 subroutine minijet_out(BB)
2961 PARAMETER (MAXSTR=150001)
2962 COMMON/HPARNT/HIPR1(100),IHPR2(50),HINT1(100),IHNT2(50)
2963 COMMON/hjcrdn/YP(3,300),YT(3,300)
2964 COMMON/HJJET1/NPJ(300),KFPJ(300,500),PJPX(300,500),
2965 & PJPY(300,500),PJPZ(300,500),PJPE(300,500),
2966 & PJPM(300,500),NTJ(300),KFTJ(300,500),
2967 & PJTX(300,500),PJTY(300,500),PJTZ(300,500),
2968 & PJTE(300,500),PJTM(300,500)
2969 COMMON/HJJET2/NSG,NJSG(MAXSTR),IASG(MAXSTR,3),K1SG(MAXSTR,100),
2970 & K2SG(MAXSTR,100),PXSG(MAXSTR,100),PYSG(MAXSTR,100),
2971 & PZSG(MAXSTR,100),PESG(MAXSTR,100),PMSG(MAXSTR,100)
2972 COMMON /AREVT/ IAEVT, IARUN, MISS
2973 common /para7/ ioscar,nsmbbbar,nsmmeson
2974 common/phidcy/iphidcy,pttrig,ntrig,maxmiss
2979 pt=sqrt(PJPX(I,J)**2+PJPY(I,J)**2)
2980 if(pt.ge.pttrig) ntrig=ntrig+1
2985 pt=sqrt(PJTX(I,J)**2+PJTY(I,J)**2)
2986 if(pt.ge.pttrig) ntrig=ntrig+1
2991 pt=sqrt(PXSG(I,J)**2+PYSG(I,J)**2)
2992 if(pt.ge.pttrig) ntrig=ntrig+1
2995 c Require at least 1 initial minijet parton above the trigger Pt value:
2996 if(ntrig.eq.0) return
2998 c.....transfer data from HIJING to ZPC
2999 if(ioscar.eq.3) write(96,*) IAEVT,MISS,IHNT2(1),IHNT2(3)
3000 DO 1008 I = 1, IHNT2(1)
3001 DO 1007 J = 1, NPJ(I)
3003 c write out not only gluons:
3004 c if(ityp.ne.21) goto 1007
3013 if(ioscar.eq.3) then
3014 if(amax1(abs(gx),abs(gy),
3015 1 abs(gz),abs(ft)).lt.9999) then
3016 write(96,200) ityp,px,py,pz,xmass,gx,gy,gz,ft,1
3018 write(96,201) ityp,px,py,pz,xmass,gx,gy,gz,ft,1
3023 DO 1010 I = 1, IHNT2(3)
3024 DO 1009 J = 1, NTJ(I)
3026 c if(ityp.ne.21) goto 1009
3035 if(ioscar.eq.3) then
3036 if(amax1(abs(gx),abs(gy),
3037 1 abs(gz),abs(ft)).lt.9999) then
3038 write(96,200) ityp,px,py,pz,xmass,gx,gy,gz,ft,2
3040 write(96,201) ityp,px,py,pz,xmass,gx,gy,gz,ft,2
3046 DO 1011 J = 1, NJSG(I)
3048 c if(ityp.ne.21) goto 1011
3049 gx=0.5*(YP(1,IASG(I,1))+YT(1,IASG(I,2)))
3050 gy=0.5*(YP(2,IASG(I,1))+YT(2,IASG(I,2)))
3057 if(ioscar.eq.3) then
3058 if(amax1(abs(gx),abs(gy),
3059 1 abs(gz),abs(ft)).lt.9999) then
3060 write(96,200) ityp,px,py,pz,xmass,gx,gy,gz,ft,3
3062 write(96,201) ityp,px,py,pz,xmass,gx,gy,gz,ft,3
3067 200 format(I6,2(1x,f8.3),1x,f10.3,1x,f6.3,2(1x,f8.2),2(2x,f2.0),2x,I2)
3068 201 format(I6,2(1x,f8.3),1x,f10.3,1x,f6.3,2(1x,e8.2),2(2x,f2.0),2x,I2)
3073 c=======================================================================
3074 clin-6/2009 embed back-to-back high-Pt quark/antiquark pair
3075 c via embedding back-to-back high-Pt pion pair then melting the pion pair
3076 c by generating the internal quark and antiquark momentum parallel to
3077 c the pion momentum (in order to produce a high-Pt and a low Pt parton):
3078 subroutine embedHighPt
3079 PARAMETER (MAXSTR=150001,MAXR=1,pichmass=0.140)
3080 common/embed/iembed,pxqembd,pyqembd,xembd,yembd
3082 COMMON/HMAIN1/EATT,JATT,NATT,NT,NP,N0,N01,N10,N11
3083 COMMON/HMAIN2/KATT(MAXSTR,4),PATT(MAXSTR,4)
3084 COMMON /ARPRC/ ITYPAR(MAXSTR),
3085 & GXAR(MAXSTR), GYAR(MAXSTR), GZAR(MAXSTR), FTAR(MAXSTR),
3086 & PXAR(MAXSTR), PYAR(MAXSTR), PZAR(MAXSTR), PEAR(MAXSTR),
3088 cwei DOUBLE PRECISION PATT
3091 if(iembed.ne.1) return
3092 ptq=sqrt(pxqembd**2+pyqembd**2)
3093 if(ptq.lt.(pichmass/2.)) then
3094 print *, 'Embedded quark transverse momentum is too small'
3097 c Randomly embed u/ubar or d/dbar at high Pt:
3098 idqembd=1+int(2*RANART(NSEED))
3099 c Flavor content for the charged pion that contains the leading quark:
3100 if(idqembd.eq.1) then
3103 elseif(idqembd.eq.2) then
3107 print *, 'Wrong quark flavor embedded'
3110 c Caculate transverse momentum of the parent charged pion:
3112 xmqsoft=ulmass(idqsoft)
3113 ptpi=((pichmass**2+xmq**2-xmqsoft**2)*ptq
3114 1 -sqrt((xmq**2+ptq**2)*(pichmass**4
3115 2 -2.*pichmass**2*(xmq**2+xmqsoft**2)+(xmq**2-xmqsoft**2)**2)))
3117 pxpi=ptpi*pxqembd/ptq
3118 pypi=ptpi*pyqembd/ptq
3119 c Embedded quark/antiquark are assumed to have pz=0:
3121 c Insert the two parent charged pions,
3122 c ipion=1 for the pion containing the leading quark,
3123 c ipion=2 for the pion containing the leading antiquark of the same flavor:
3138 PATT(NATT,4)=sqrt(pxpi**2+pypi**2+pzpi**2+pichmass**2)
3139 EATT=EATT+PATT(NATT,4)
3144 ITYPAR(NATT)=KATT(NATT,1)
3145 PXAR(NATT)=PATT(NATT,1)
3146 PYAR(NATT)=PATT(NATT,2)
3147 PZAR(NATT)=PATT(NATT,3)
3148 PEAR(NATT)=PATT(NATT,4)