1 *----------------------------------------------------------------------
3 * Filename : HYDJET1_1.F
5 * Author : Igor Lokhtin
6 * Version : HYDJET1_1.f
7 * Last revision : 27-MAR-2006
9 *======================================================================
11 * Description : Fast event generator for AA collisons at the LHC
13 * Method I.P. Lokhtin and A.M. Snigirev, Eur. Phys. J C 45 (2006) 211
15 *======================================================================
17 SUBROUTINE HYDRO(A,ifb,bmin,bmax,bfix,nh)
18 real hsin,hgauss,hftaa
23 external hsin,hgauss,hftaa,numjet,numpar,hyhard,hipsear
25 common /lujets/ n,k(150000,5),p(150000,5),v(150000,5)
26 common /hyjets/ nl,kl(150000,5),pl(150000,5),vl(150000,5)
27 common /hyipar/ bminh,bmaxh,AW,RA,sigin,np
28 common /hyfpar/ bgen,nbcol,npart,npyt,nhyd
29 common /hyflow/ ytfl,ylfl,fpart
30 common /hyjpar/ nhsel,ptmin,njet
31 save/lujets/,/hyjets/,/hyipar/,/hyfpar/,/hyflow/,/hyjpar/
35 common /hyd/ nnhyd, khyd(150000,5),phyd(150000,5),vhyd(150000,5)
38 * reset lujets and hyd arrays before event generation
53 * set initial beam paramters: atomic weigth and radius in fm
59 * generate impact parameter of A-A collision
63 write(6,*) 'Impact parameter less than zero!'
67 write(6,*) 'Impact parameter larger than two nuclear radius!'
74 write(6,*) 'Impact parameter less than zero!'
78 write(6,*) 'Impact parameter larger than two nuclear radius!'
83 call hipsear(fmax1,xmin1)
86 3 bb1=xmin*rlu(0)+bminh
95 Tf=0.14 ! freeze-out temperature
96 if (ylfl.lt.0.01.or.ylfl.gt.7.) ylfl=5.
97 etmax=ylfl ! longitudinal flow rapidity
98 if (ytfl.lt.0.01.or.ytfl.gt.3.) ytfl=1.
99 ytmax=ytfl ! transverse flow rapidity
101 * set inelastic NN cross section, mb
104 * calculate number of nucelons-participants
105 bb=bgen*RA ! impact parameter
106 npart=numpar(bb) ! Npart(b)
107 npar0=411 ! Npart(Pb,b=0)
109 * calculate number of binary NN sub-collisions
110 br=max(1.e-10,0.25*bgen*bgen)
111 factor=9.*sigin*AW*AW/(80.*pi*RA*RA)
112 nbcol=int(factor*hftaa(br)) ! Nsub(b)
113 nbco0=1923 ! Nsub(Pb,b=0)
115 * generate total multiplicity in event, np,
116 * fpart - fraction of soft multiplicity proportional to # of participants,
117 * fbcol=1-fpart - fraction of multiplicity proprtional to # of NN subcollisions
118 if(fpart.le.0.or.fpart.gt.1.) fpart=1.
120 rnp=nh*(fpart*npart+fbcol*nbcol)/(fpart*npar0+fbcol*nbco0)
123 1 if(nhsel.lt.4.and.np.gt.0) np=max(0,int(hgauss(rnp,sign)))
124 if(np.gt.150000) then
125 write(6,*) 'Warning, soft multiplicity too large!'
129 * generate hard parton-parton scattering (Q>ptmin) 'njet' times with PYTHIA
130 if(nhsel.ne.1.and.nhsel.ne.2.and.nhsel.ne.3.and.nhsel.ne.4)
134 if(ptmin.lt.5.or.ptmin.gt.500.) ptmin=10.
142 c if(nhsel.lt.3) then
143 c nhyd=max(0,np-npyt)
150 * generate sort of hadrons (pions, kaons, nucleons) in jetset7* format
151 do ip=npyt+1,npyt+np !cycle on particles
153 if(yy.lt.11.83333333) then
155 elseif(yy.lt.23.66666667) then
157 elseif(yy.lt.35.5) then
159 elseif(yy.lt.38.375) then
161 elseif(yy.lt.41.25) then
163 elseif(yy.lt.44.125) then
165 elseif(yy.lt.47.) then
167 elseif(yy.lt.47.5) then
169 elseif(yy.lt.48.) then
171 elseif(yy.lt.48.5) then
189 * generate uniform distribution in system of a fluid element
190 2 ep0=-1.*Tf*(log(max(1.e-10,rlu(0)))+log(max(1.e-10,rlu(0)))
191 > +log(max(1.e-10,rlu(0))))
192 if(ep0.le.p(n,5)) go to 2
193 pp0=sqrt(abs(ep0**2-abs(p(n,5)**2)))
195 if(rlu(0).gt.probt) go to 2
197 stp0=sqrt(abs(1.-ctp0**2))
200 * generate coordinates of a fluid element
201 c etaf=etmax*(2.*rlu(0)-1.) ! flat initial eta-spectrum
202 etaf=hgauss(0.,etmax) ! gaussian initial eta-spectrum
204 rm1=sqrt(abs(RA*RA-b1*b1/4.*(sin(phif)**2)))+b1*cos(phif)/2.
205 rm2=sqrt(abs(RA*RA-b1*b1/4.*(sin(phif)**2)))-b1*cos(phif)/2.
209 * generate four-velocity of a fluid element
211 sb=RA*RA*(pi-2.*asin(b1/RA/2.))-b1*sqrt(abs(RA*RA-b1*b1/4.))
212 reff=sqrt(sqrt(sb/pi)*RA)
213 urf=vradf*sqrt(abs(rrf))/reff ! linear transverse profile
214 c urf=vradf*rrf/reff**2 !square transverse profile
215 utf=cosh(etaf)*sqrt(abs(1.+urf*urf))
216 uzf=sinh(etaf)*sqrt(abs(1.+urf*urf))
218 * boost in the laboratory system
219 uipi=pp0*(urf*stp0*cos(phif-php0)+uzf*ctp0)
220 bfac=uipi/(utf+1.)+ep0
221 p(n,1)=pp0*stp0*sin(php0)+urf*sin(phif)*bfac
222 p(n,2)=pp0*stp0*cos(php0)+urf*cos(phif)*bfac
223 p(n,3)=pp0*ctp0+uzf*bfac
224 p(n,4)=sqrt(p(n,1)**2+p(n,2)**2+p(n,3)**2+p(n,5)**2)
230 * write(*,*) 'NHYD, NPYT, NTOT',nhyd,npyt,nhyd+npyt
247 ********************************* HYHARD ***************************
249 * generate 'njet' number of hard parton-parton scatterings with PYTHIA
250 IMPLICIT DOUBLE PRECISION(A-H, O-Z)
251 IMPLICIT INTEGER(I-N)
252 REAL ptmin,pj,vj,pl,vl,bminh,bmaxh,AW,RA,sigin,bgen
253 INTEGER PYK,PYCHGE,PYCOMP
255 external pyp,pyr,pyk,pyquen
256 common /pyjets/ n,npad,k(4000,5),p(4000,5),v(4000,5)
257 common /lujets/ nj,kj(150000,5),pj(150000,5),vj(150000,5)
258 common /hyjets/ nl,kl(150000,5),pl(150000,5),vl(150000,5)
259 COMMON /PYDAT1/MSTU(200),PARU(200),MSTJ(200),PARJ(200)
260 COMMON /PYDAT2/KCHG(500,4),PMAS(500,4),PARF(2000),VCKM(4,4)
261 COMMON /PYDAT3/MDCY(500,3),MDME(8000,2),BRAT(8000),KFDP(8000,5)
262 COMMON /PYSUBS/MSEL,MSELPD,MSUB(500),KFIN(2,-40:40),CKIN(200)
263 common /pypars/ mstp(200),parp(200),msti(200),pari(200)
264 common /hyjpar/ nhsel,ptmin,njet
265 common /hyipar/ bminh,bmaxh,AW,RA,sigin,np
266 common /hyfpar/ bgen,nbcol,npart,npyt,nhyd
267 save /pyjets/,/lujets/,/hyjets/,/pydat1/,/pydat2/,/pydat3/,
268 + /pysubs/,/hyjpar/,/hyipar/,/hyfpar/
270 * reset array of partons in 'hyjets'
284 * generate 'njet' PYTHIA events and fill arrays for partons and hadrons
286 mdcy(pycomp(111),1)=0 ! no pi0 decay
287 mdcy(pycomp(310),1)=0 ! no K_S0 decay
290 c mstj(41)=0 ! vacuum showering off
291 call pyevnt ! generate hard scattering
293 * generate quenched jets with PYQUEN if nhcel=2
294 if(nhsel.eq.2.or.nhsel.eq.4) then
298 call pyquen(Ap,ifbp,bfixp)
301 * fill array of partons
303 if(nl.gt.150000-np) goto 51
317 if(kk.gt.0) kl(i,j)=kk+nl-n
322 call pyexec ! hadronization done
323 c call pyedit(2) ! remove partons & leave hadrons
325 * fill array of final particles
327 if(nu.gt.150000-np) then
328 write(6,*) 'Warning, multiplicity too large! Cut hard part.'
358 ****************************** END HYHARD **************************
360 ********************************* HIPSEAR ***************************
361 SUBROUTINE HIPSEAR (fmax,xmin)
362 * find maximum and 'sufficient minimum' of differential inelasic AA cross
363 * section as a function of impact paramater (xm, fm are outputs)
366 common /hyipar/ bminh,bmaxh,AW,RA,sigin,np
372 x=bminh+xmin*(j-1)/999.
381 ****************************** END HIPSEAR **************************
383 ************************* HARINV **********************************
384 SUBROUTINE HARINV(X,A,F,N,R)
385 * gives interpolation of function F(X) with arrays A(N) and F(N)
387 IF(X.LT.A(1))GO TO 11
407 R=B4*((X-B2)*(X-B3))/((B1-B2)*(B1-B3))+B5*((X-B1)*(X-B3))/
408 1 ((B2-B1)*(B2-B3))+B6*((X-B1)*(X-B2))/((B3-B1)*(B3-B2))
418 C41 FORMAT(25H X IS OUT OF THE INTERVAL,3H X=,F15.9)
423 IF(C.LT.0.1) GO TO 12
429 C************************** END HARINV *************************************
431 **************************** HSIMPA **********************************
432 SUBROUTINE HSIMPA (A1,B1,H1,REPS1,AEPS1,FUNCT,X,
434 * calculate intergal of function FUNCT(X) on the interval from A1 to B1
435 IMPLICIT REAL * 4 ( A-H,O-Z )
436 IMPLICIT INTEGER(I-N)
458 IF( (X0+4.*H-B)*S)5,5,6
470 23 IF(F(K)-10.E16)10,11,10
473 9 DI3=DI3+P(K)*ABS(F(K))
474 DI1=(F(1)+4.*F(3)+F(5))*2.*H
478 13 IF (AEPS) 12,14,12
479 12 EPS=ABS((AIABS+DI3)*REPS)
482 16 DELTA=ABS(DI2-DI1)
483 IF(DELTA-EPS)20,21,21
484 20 IF(DELTA-EPS/8.)17,14,14
499 18 DI1=DI2+(DI2-DI1)/15.
517 ************************* END HSIMPA *******************************
519 **************************** HSIMPB **********************************
520 SUBROUTINE HSIMPB (A1,B1,H1,REPS1,AEPS1,FUNCT,X,
522 * calculate intergal of function FUNCT(X) on the interval from A1 to B1
523 IMPLICIT REAL * 4 ( A-H,O-Z )
524 IMPLICIT INTEGER(I-N)
546 IF( (X0+4.*H-B)*S)5,5,6
558 23 IF(F(K)-10.E16)10,11,10
561 9 DI3=DI3+P(K)*ABS(F(K))
562 DI1=(F(1)+4.*F(3)+F(5))*2.*H
566 13 IF (AEPS) 12,14,12
567 12 EPS=ABS((AIABS+DI3)*REPS)
570 16 DELTA=ABS(DI2-DI1)
571 IF(DELTA-EPS)20,21,21
572 20 IF(DELTA-EPS/8.)17,14,14
587 18 DI1=DI2+(DI2-DI1)/15.
605 ************************* END HSIMPB *******************************
607 * function to calculate differential inelastic AA cross section
608 real function hsin(x)
611 common /hyipar/ bminh,bmaxh,AW,RA,sigin,np
615 br=max(1.e-10,0.25*x*x)
616 hsin=x*(1.-exp(-1.*hftaa(br)*sigp*taapb0))
620 * set of functions to calculate number of nucleons-participants at im.par.b
621 integer function numpar(c)
622 IMPLICIT REAL * 4 (A-H,O-Z)
631 CALL HSIMPA(A,B,H,EPS,1.E-8,HFUNC1,X,RES,AIH,AIABS)
636 real function HFUNC1(x)
637 IMPLICIT REAL * 4 (A-H,O-Z)
640 common /hyipar/ bminh,bmaxh,AW,RA,sigin,np
641 common /hynup1/ bp,xx
645 r1=abs(sqrt(abs(RA*RA-(b2*sin(xx))**2))+b2*cos(xx))
646 r2=abs(sqrt(abs(RA*RA-(b2*sin(xx))**2))-b2*cos(xx))
651 CALL HSIMPB(A,B,H,EPS,1.E-8,HFUNC2,Y,RES,AIH,AIABS)
656 real function HFUNC2(y)
657 IMPLICIT REAL * 4 (A-H,O-Z)
660 common /hyipar/ bminh,bmaxh,AW,RA,sigin,np
663 r1=sqrt(abs(y*y+bp*bp/4.+y*bp*cos(x)))
664 r2=sqrt(abs(y*y+bp*bp/4.-y*bp*cos(x)))
665 s=1.-exp(-0.1*sigin*hythik(r2))
666 HFUNC2=y*hythik(r2)*s
670 * to calculate nuclear thikness function
671 real function hythik(r)
672 IMPLICIT REAL * 4 (A-H,O-Z)
673 common /hyipar/ bminh,bmaxh,AW,RA,sigin,np
675 hythik=0.477465*AW*sqrt(abs(RA*RA-r*r))/(RA**3)
679 * to calculate nuclear overlap function
680 real function hftaa(br)
681 common /hyipar/ bminh,bmaxh,AW,RA,sigin,np
684 taa=1.-br*(1.+(1.-0.25*br)*log(1./br)+2.*(1.-0.25*br)*
685 + (log(1.+sbr)-sbr/(1.+sbr))-0.5*br*(1.-br)/((1.+sbr)**2))
686 hftaa=taa*((AW/207)**1.33333333)
690 * function to calculate number of hard parton-parton scatterings with
691 * Q>x at sqrt{s}=5.5 TeV
692 integer function numjet(x)
693 common /hyipar/ bminh,bmaxh,AW,RA,sigin,np
694 common /hyfpar/ bgen,nbcol,npart,npyt,nhyd
695 save /hyipar/,/hyfpar/
696 dimension ptj(30),sgj(30)
697 data ptj/5.,6.,7.,8.,9.,10.,12.,14.,16.,18.,20.,23.,26.,
698 + 30.,35.,40.,50.,60.,70.,80.,90.,100.,120.,150.,200.,
699 + 250.,300.,400.,450.,500./
700 data sgj/31.,16.8,9.5,6.1,4.1,2.7,1.4,0.8,0.46,0.3,0.2,
701 + 0.11,6.8e-2,3.9e-2,2.06e-2,1.16e-2,4.46e-3,2.e-3,1.e-3,
702 + 5.3e-4,3.1e-4,1.9e-4,7.7e-5,2.6e-5,5.9e-6,1.6e-6,5.9e-7,
703 + 1.e-7,4.8e-8,2.3e-8/
716 call harinv(pt,ptj,sgj,30,sjet)
721 if(rlu(0).lt.pjet) ijet=ijet+1
727 * function to generate gauss distribution
728 real function hgauss(x0,sig)
735 hgauss=v1*sqrt(-2.*log(s)/s)*sig+x0
740 **************************************************************************