3 implicit double precision(a-y)
5 double precision pt1(2),pt2(2),ptx(2),q(4,20)
6 double precision pboo(4),pcm(4),plb(4)
7 double precision tvec(4),uvec(4),svec(4),vv1(4),vv2(4)
8 integer d,h,i,j,k,l,m,n,o,p,r,iset,af,nhist,ntotal,eflag,ichi,
9 &icut,ncut,id(20),id0,id1,id2,pdf,num,ptgen,mode,iord,ii,ip,ll,nev
11 character prefix*50,fsp*10,order*10,pflag*10,fsi*10,formf*10
12 &,ppbar*10,output*10,mregge*10,cuts*10,unw*10
14 double precision cc0(5),bm(5),bb0(5),pp0(5),bex(5),gaa(5)
15 common/pars/cc0,bm,bb0,pp0,bex,asp,sigo,gaa,ep,norm
19 common/mompt/pt1,pt2,ptx
20 common/vars/s,rts,mmes,yx
22 common/vars0/ mf127, mf1525, m0, mmes0, mmes1, mmes2, mp,
23 & mwidth, pi, rt2, ebeam, sum, sum1, weightm,
25 common /ivars/ ncut, ll, icut, nev, num
27 common/cuts/etaelmax,etaelmin,ptelmin,ptphmin,ecut,rmax,rmin,mcut
28 common/flags/iin, pflag, fsi, ppbar, output, cuts, unw
29 common/gluons/g1,g2,kt1,kt2
30 common/levicivita/epsilon
31 common/ang/cost,costa,costb
34 common/wvars/sig0,bb,t1,t2
35 common/alphas/alphap,alpha0,alphapr,alpha0r,alphapm,alpha0m
36 common/sec/cpom,cf,crho,aff,ar
40 common/ffpars/bexp,ao,bo,aoo,boo
44 parameter (nmxhep=4000)
45 integer nevhep,nhep,isthep,idhep,jmohep,jdahep
46 double precision phep,vhep
47 common /hepevt/ nevhep,nhep,isthep(nmxhep),idhep(nmxhep),
48 &jmohep(2,nmxhep),jdahep(2,nmxhep),phep(5,nmxhep),vhep(4,nmxhep)
49 ccccc Les Houches Event Common Block
51 PARAMETER (MAXNUP=500)
52 INTEGER NUP,IDPRUP,IDUP,ISTUP,MOTHUP,ICOLUP
53 DOUBLE PRECISION XWGTUP,SCALUP,AQEDUP,AQCDUP,PUP,VTIMUP,SPINUP
54 COMMON/HEPEUP/NUP,IDPRUP,XWGTUP,SCALUP,AQEDUP,AQCDUP,
55 & IDUP(MAXNUP),ISTUP(MAXNUP),MOTHUP(2,MAXNUP),
56 & ICOLUP(2,MAXNUP),PUP(5,MAXNUP),VTIMUP(MAXNUP),
60 double precision pin(4),am(100),pout(4,100),wt,ein
61 common/ramboc/ pin, am, pout, wt, ein,
63 ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
65 c Dime MC for the central exclusive production of c
66 c meson pairs by double Pomeron exchange: c
68 c p(1) p(2) --> p(3) + M_1(5) M_2(6) + p(4) c
70 c Momenta for each event in array q(i,j), where j is c
71 c the particle label and i is the 4-momentum c
74 c 1,2 = transverse components c
75 c 3 = beam component c
78 c PDG number for ith particle in arrary ID(i) c
80 c Also gives event record in HEPEVT or LHE format c
81 c (others are available upon request) c
83 ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
85 c Particles generated: c
87 c pflag='pipm' : M_1=pi^+ M_2=pi^- c
88 c pflag='pi0' : M_1=M_2=pi^0 c
89 c pflag='kpkm' : M_1=K^+ M_2=K^- c
90 c pflag='ks' : M_1=M_2=K_0 c
91 c pflag='rho' : M_1=M_2=rho_0 c
93 c with decay: rho(5) --> pi^+(7)pi^-(8) c
94 c rho(6) --> pi^+(9)pi^-(10) c
95 c according to phase space, with finite rho c
98 ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
100 c User defined cuts can readily be implemented c
101 c in subroutine 'icut' c
103 ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
105 c This is version 1.05 : 17 Sep 2014 c
107 c Comments etc to: lucian.harland-lang@durham.ac.uk c
109 c If you use the code please reference (and see for c
110 c details of model used): c
112 c L.A. Harland-Lang, V.A. Khoze, M.G. Ryskin c
113 c and W.J. Stirling arXiv:1105.1626 c
115 c L.A. Harland-Lang, V.A. Khoze, M.G. Ryskin c
116 c and W.J. Stirling arXiv:1204.4803 c
118 c L.A. Harland-Lang, V.A. Khoze and M.G. Ryskin c
121 ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
123 ccAM open(35,file='exerec1.dat') ! event record
125 ccAM rts=1.96d3 ! centre of mass energy
126 write(6,*) "energy", rts
127 cccc Some basic cuts, imposed in subtroutine 'icut'. Other user defined cuts can readily be implemented in subroutine
128 cccc note: in rhorho case these cuts are imposed on rho's, and not their decay productions. Cuts on the decay products
129 cccc can be imposed by editing 'icut'
131 ccAM rmax=1.8d1 ! max meson rapidity
132 ccAM rmin=-1.8d1 ! min meson rapidity
133 ccAM ecut=2d0 ! min meson p_t
135 c -- physics parameters
137 ccAM pflag='rho' ! Process generated - see preamble for options
138 ccAM fsi='true' ! phenomenological model for exclusive suppression in Pom Pom --> meson pair. To turn on/off --> 'true/false'
139 ccAM formf='orexp' ! meson - pomeron form factor.
140 ccAM ppbar='false' ! set true if ppbar collisions
141 output='lhe' ! Event record style, HEPEVT or LHE
142 ccAM cuts='true' ! Impose cuts or not
143 ccAM unw='true' ! Set = 'true' for unweighted events
144 ccAM iin=1 ! Model for soft survival factor, as described in arXiv:1306.2149. Default = 1
148 ccAM ntotal=1000000 ! no. of runs for weighted events
149 ccAM nev=100 ! no. of unweighted events generated to event record
153 if(formf.eq.'exp')then ! Set parameters for Pomeron-Meson form factor in function 'fpi(x)'
155 elseif(formf.eq.'orexp')then
158 elseif(formf.eq.'power')then
162 ccccccccccccccccccccccccccccccccccccccc
164 ccccccccc Start of main body of code
166 cccccccccccccccccccccccccccccccccccccc
168 call initpars(iin) ! Initialise soft survival parameters
169 call calcop ! proton opacity
170 call calcscreen ! screening amplitude
172 if(pflag.eq.'pipm')then
173 mmes=0.13957018d0 ! pi+/- mass, PDG 2011 value
176 alpha0m=-0.7d0*mmes**2
199 elseif(pflag.eq.'pi0')then
200 mmes=0.1349766d0 ! pi0 mass, PDG 2011 value
203 alpha0m=-0.7d0*mmes**2
226 elseif(pflag.eq.'kpkm')then
227 mmes=0.493677d0 ! K+/- mass, PDG 2011 value
251 elseif(pflag.eq.'ks')then
252 mmes=0.497614d0 ! K_0 mass, PDG 2011 value
276 elseif(pflag.eq.'rho')then
277 mmes0=0.77549d0 ! rho mass, PDG 2013 value
278 mwidth=0.1491d0 ! rho width PDG 2013 value
322 c -- other parameters
331 beta=dsqrt(1d0-4d0*mp**2/s)
340 alphap=0.25d0 ! D-L '92 fit
355 ccccc Initialise rambo (rho0 decay)
357 if(pflag.eq.'rho')then
368 c initialise counters etc
379 c initialise histograms
387 cccccccccccccccccccccccccccccccccccccccccccccccccccccc
389 c Incoming protons to event record array
391 cccccccccccccccccccccccccccccccccccccccccccccccccccccc
408 pup(5,1)=dsqrt(q(4,1)**2-q(3,1)**2-q(2,1)**2-q(1,1)**2)
418 if(ppbar.eq.'true')then
430 pup(5,2)=dsqrt(q(4,2)**2-q(3,2)**2-q(2,2)**2-q(1,2)**2)
434 cccc outgoing initial info
437 if(ppbar.eq.'true')then
460 if(output.eq.'hepevt')then
463 write(6,*) "hepevt", nhep, nup
472 jmohep(1,k)=mothup(1,k)
473 jmohep(2,k)=jmohep(1,k)
482 if(pflag.eq.'rho')then
494 if(unw.eq.'true')then
509 ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
511 c Start of event loop c
513 ccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
516 write(6,*)'Generating weighted events...'
518 write(6,*)'Generating unweighted events...'
523 subroutine dimegenerate
528 parameter (nmxhep=4000)
529 integer nevhep,nhep,isthep,idhep,jmohep,jdahep
530 double precision phep,vhep
531 common /hepevt/ nevhep,nhep,isthep(nmxhep),idhep(nmxhep),
532 &jmohep(2,nmxhep),jdahep(2,nmxhep),phep(5,nmxhep),vhep(4,nmxhep)
533 ccccc Les Houches Event Common Block
535 PARAMETER (MAXNUP=500)
536 INTEGER NUP,IDPRUP,IDUP,ISTUP,MOTHUP,ICOLUP
537 DOUBLE PRECISION XWGTUP,SCALUP,AQEDUP,AQCDUP,PUP,VTIMUP,SPINUP
538 COMMON/HEPEUP/NUP,IDPRUP,XWGTUP,SCALUP,AQEDUP,AQCDUP,
539 & IDUP(MAXNUP),ISTUP(MAXNUP),MOTHUP(2,MAXNUP),
540 & ICOLUP(2,MAXNUP),PUP(5,MAXNUP),VTIMUP(MAXNUP),
542 ccccc rambo variables
544 double precision pin(4), am(100), pout(4,100), wt, ein
545 common/ramboc/ pin, am, pout, wt, ein,
549 double precision etaelmax,etaelmin,ptelmin,ptphmin,ecut,rmax,
551 common/cuts/etaelmax,etaelmin,ptelmin,ptphmin,ecut,rmax,rmin,mcut
553 double precision q(4,20)
556 double precision pt1(2), pt2(2), ptx(2)
557 common/mompt/pt1,pt2,ptx
559 double precision s, rts, mmes, yx
560 double precision bjac, bp
561 double precision mf127, mf1525
563 double precision m0, mmes0, mmes1, mmes2, mp, mwidth, pi, rt2,
564 &ebeam, sh, th, uh, sum, sum1, weightm
566 integer id(20), ncut, ll, icut, nev, num, iin
568 common/vars/s,rts,mmes,yx
569 common/hvars/sh,th,uh
570 common/vars0/ mf127, mf1525, m0, mmes0, mmes1, mmes2, mp,
571 & mwidth, pi, rt2, ebeam, sum, sum1, weightm,
573 common /ivars/ ncut, ll, icut, nev, num
575 character prefix*50,fsp*10,order*10,pflag*10,fsi*10,formf*10
576 &,ppbar*10,output*10,mregge*10,cuts*10,unw*10
577 common/flags/ iin, pflag, fsi, ppbar, output, cuts, unw
580 ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
581 cccccc local variables ...
582 double precision aa1, aa2, al1, al2, almax, almin, c, cc1, cc2,
583 & msmax, msmin, cont, exn, mmesp, mwidth1, mwidth2, norm,
584 & p1m, p1p, p2m, p2p, phi1, phi2, phix1, pt1sq, pt1x, pt1y,
585 & pt2sq, pt2x, pt2y, ptxsq1, ptxsq2, ptxsqmax, ptxsqmin,
586 & ran0, ran1, ran2, ran3, ran4, ran5, ran6, ranhist, ranx1,
587 & ranx2, ranx3, ranx4, rm1, rm2, rmx1, rmx2,
588 & root1sq, root2sq, snp, t1, t2, weight, weight0, weight1,
589 & weight2, wthist, x1, x2, ymax1, ymax2, ymin1, ymin2, yx1,
591 double precision pboo(4), pcm(4), plb(4)
592 double precision svec(4)
594 integer h, i, j, k, ntotal
604 ccccccccccccccccccccccccccccccccccccccccccccccccccc
623 pt1sq=-dlog(ran2)/(bjac)
624 pt2sq=-dlog(ran3)/(bjac)
626 weight=(dexp(bjac*pt1sq)*dexp(bjac*pt2sq))/bjac**2
628 pt1(1)=dsqrt(pt1sq)*dsin(phi1)
629 pt1(2)=dsqrt(pt1sq)*dcos(phi1)
630 pt2(1)=dsqrt(pt2sq)*dsin(phi2)
631 pt2(2)=dsqrt(pt2sq)*dcos(phi2)
638 cccccccccccccccccccccccccccccccc
640 ccc non-zero rho width
642 cccccccccccccccccccccccccccccccc
644 if(pflag.eq.'rho')then ! new part here
649 msmax=mmes0+4d0*mwidth
650 msmin=2d0*0.13957018d0
654 almin=datan(-(mmes0**2-msmin**2)/mwidth/mmes0)
655 almax=datan(-(mmes0**2-msmax**2)/mwidth/mmes0)
657 al1=almin+(almax-almin)*rm1
658 al2=almin+(almax-almin)*rm2
660 mmes1=dsqrt(dtan(al1)*mmes0*mwidth+mmes0**2)
661 mmes2=dsqrt(dtan(al2)*mmes0*mwidth+mmes0**2)
663 weight=weight*(almax-almin)**2
664 weight=weight*mwidth**2*mmes0**2
665 weight=weight*(1d0+dtan(al1)**2)*(1d0+dtan(al2)**2)
666 weight=weight/4d0/mmes1/mmes2
670 mwidth1=mwidth*((1d0-4d0*0.13957018d0**2/mmes1**2)/
671 & (1d0-4d0*0.13957018d0**2/mmes0**2))**1.5d0
672 mwidth2=mwidth*((1d0-4d0*0.13957018d0**2/mmes2**2)/
673 & (1d0-4d0*0.13957018d0**2/mmes0**2))**1.5d0
675 if(mmes1.lt.2d0*0.13957018d0) goto 677
676 if(mmes2.lt.2d0*0.13957018d0) goto 677
678 weight=weight*2d0*mmes0*mmes1*mwidth1/pi
679 weight=weight*2d0*mmes0*mmes2*mwidth2/pi
680 weight=weight*mmes1**2*mmes2**2/mmes0**4
681 weight=weight/((mmes0**2-mmes1**2)**2+mmes1**4*
682 & mwidth1**2/mmes0**2)
683 weight=weight/((mmes0**2-mmes2**2)**2+mmes2**4*
684 & mwidth2**2/mmes0**2)
689 cccccccccccccccccccccccccccccccccccccccccccccccccccc
702 c ptxsq1=-dlog(r2)/bjac1 ! generate exp p_t^2 (can be more efficient)
705 ptxsqmax=10d0 ! generate linear p_t^2
707 ptxsq1=ptxsqmin+(ptxsqmax-ptxsqmin)*ranx2
709 q(1,5)=dsqrt(ptxsq1)*dcos(phix1)
710 q(2,5)=dsqrt(ptxsq1)*dsin(phix1)
711 q(1,6)=-pt1(1)-pt2(1)-q(1,5)
712 q(2,6)=-pt1(2)-pt2(2)-q(2,5)
713 ptxsq2=q(1,6)**2+q(2,6)**2
715 rmx1=dsqrt(mmes1**2+ptxsq1)
716 rmx2=dsqrt(mmes2**2+ptxsq2)
720 if(cuts.eq.'true')then
721 if(rmax.lt.ymax1)then
728 yx1=ymin1+(ymax1-ymin1)*ranx3
730 ymax2=(dlog((rts-rmx1*dexp(yx1))/rmx2))
731 ymin2=-(dlog((rts-rmx1*dexp(-yx1))/rmx2))
733 if(cuts.eq.'true')then
734 if(ymax2.gt.rmax)then
737 if(ymin2.lt.-rmax)then
742 if(ymax2.lt.ymin2)then
747 yx2=ymin2+(ymax2-ymin2)*ranx4
748 x1=(rmx2*dexp(yx2)+rmx1*dexp(yx1))/rts
749 x2=(rmx2*dexp(-yx2)+rmx1*dexp(-yx1))/rts
751 weight=weight*(ptxsqmax-ptxsqmin)
752 c weight=weight*dexp(bjac1*ptxsq1)*r2max/bjac1
753 weight=weight*(ymax1-ymin1)*(ymax2-ymin2)
756 q(3,5)=rmx1*(dexp(yx1)-dexp(-yx1))/2d0
757 q(4,5)=rmx1*(dexp(yx1)+dexp(-yx1))/2d0
759 q(3,6)=rmx2*(dexp(yx2)-dexp(-yx2))/2d0
760 q(4,6)=rmx2*(dexp(yx2)+dexp(-yx2))/2d0
762 ccccccccccccccccccccccccccccccccccccccccccccccccccccc
764 c impose massive on-shell condition by solving
765 c p1+ + cc1/p2- = aa1
766 c p2- + cc2/p1+ = aa2
770 cc1=0.5d0*(pt2sq+mp**2)
771 cc2=0.5d0*(pt1sq+mp**2)
773 root1sq=(cc1-cc2-aa1*aa2)**2-4d0*cc2*aa1*aa2
774 root2sq=(cc2-cc1-aa1*aa2)**2-4d0*cc1*aa1*aa2
775 if(root1sq.le.0d0.or.root2sq.le.0d0)then
779 p1p=(cc2-cc1+aa1*aa2+dsqrt(root1sq))/(2d0*aa2)
780 p2m=(cc1-cc2+aa1*aa2+dsqrt(root2sq))/(2d0*aa1)
781 p1m=(pt1sq+mp**2)/(2d0*p1p)
782 p2p=(pt2sq+mp**2)/(2d0*p2m)
784 if(p1p.lt.0d0.or.p1m.lt.0d0.or.p2p.lt.0d0.or.p2m.lt.0d0)then
802 ccccccccccccccccccccccccccccccccccccccccccccccccc
805 svec(k)=q(k,5)+q(k,6)
808 call dot(svec,svec,sh)
810 ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
814 ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
816 if(pflag.eq.'rho')then
827 call rambo(npart,mmesp,am,pout,wt) ! call RAMBO
837 call boost(mmesp,pboo,pcm,plb)
849 ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
853 if(cuts.eq.'true')then
870 cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
872 c Write 4-momenta to event record array
874 ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
876 if(output.eq.'lhe')then
882 pup(5,k)=dsqrt(q(4,k)**2-q(3,k)**2-q(2,k)**2-q(1,k)**2)
885 if(pflag.eq.'rho')then
891 pup(5,k)=dsqrt(q(4,k)**2-q(3,k)**2-q(2,k)**2-q(1,k)**2)
900 pup(5,k)=dsqrt(q(4,k)**2-q(3,k)**2-q(2,k)**2-q(1,k)**2)
911 phep(5,k)=dsqrt(q(4,k)**2-q(3,k)**2-q(2,k)**2-q(1,k)**2)
914 if(pflag.eq.'rho')then
920 phep(5,k)=dsqrt(q(4,k)**2-q(3,k)**2-q(2,k)**2-q(1,k)**2)
929 phep(5,k)=dsqrt(q(4,k)**2-q(3,k)**2-q(2,k)**2-q(1,k)**2)
936 ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
940 ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
942 c pp-->pp(M_1 M_2) matrix element
944 ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
947 call schimc(pt1x,pt1y,pt2x,pt2y,zmat)
949 weight=weight*cdabs(zmat)**2
950 weight=weight/norm**2
952 ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
954 weight=weight/(s**2*(16d0)**3*pi**5)*389d3
956 ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
958 ccc Probability of no additional particles produced in production subprocess
960 cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
962 if(fsi.eq.'true')then
964 if(pflag.eq.'pipm'.or.pflag.eq.'pi0')then
966 if(dsqrt(sh).gt.mf127)then
969 cont=1d0-(m0-2d0*mmes)**2/m0**2
970 exn=c*dlog(((dsqrt(sh)-2d0*mmes)**2)/m0**2+cont)
976 elseif(pflag.eq.'kpkm'.or.pflag.eq.'ks')then
978 if(dsqrt(sh).gt.mf1525)then
981 cont=1d0-(m0-2d0*mmes)**2/m0**2
982 exn=c*dlog(((dsqrt(sh)-2d0*mmes)**2)/m0**2+cont)
1008 if(pflag.eq.'pi0'.or.pflag.eq.'ks'.or.pflag.eq.'rho')then
1009 weight=weight/2d0 ! symmetry factor
1012 cccccccccccccccccccccccccccccccccccccccccccccccccccccc
1016 if(weightm.lt.weight)then
1025 wthist=weight/dfloat(ntotal)
1033 if(ranhist.lt.weight/weightm)then
1040 c call binit(sumt/nev)
1042 write(35,302)num,nup
1044 if(output.eq.'lhe')then
1047 write(35,300)j,istup(j),idup(j),mothup(1,j),mothup(2,j),
1048 & icolup(1,j),icolup(2,j),pup(1,j),pup(2,j),
1049 & pup(3,j),pup(4,j),pup(5,j),vtimup(j),spinup(j)
1055 write(35,301)j,idhep(j),isthep(j),jmohep(1,j),
1056 & jmohep(2,j),jdahep(1,j),jdahep(2,j),
1057 & phep(1,j),phep(2,j),phep(3,j),phep(4,j),phep(5,j)
1058 & ,vhep(1,j),vhep(2,j),vhep(3,j),vhep(4,j)
1070 if(num.gt.nev-1)then ! exit loop once required no. of unweighted events generated
1082 cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
1084 c End of event loop c
1086 cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
1088 300 format(i4,1x,i4,1x,i8,1x,i4,1x,i4,1x,i4,1x,i4,1x,E13.6,1x,
1089 &E13.6,1x,E13.6,1x,E13.6,1x,E13.6,1x,E13.6,1x,E13.6)
1090 301 format(i4,1x,i8,1x,i4,1x,i4,1x,i4,1x,i4,1x,i4,1x,E13.6,1x,E13.6
1091 &,1x,E13.6,1x,E13.6,1x,E13.6,1x,E13.6,1x,E13.6,1x,E13.6,1x
1093 302 format(1x,i8,1x,i5,1x,E13.6)
1098 subroutine terminate
1099 character prefix*50,fsp*10,order*10,pflag*10,fsi*10,formf*10
1100 &,ppbar*10,output*10,mregge*10,cuts*10,unw*10
1103 sum=sum/dfloat(ntotal)
1104 sum1=sum1/dfloat(ntotal)
1105 var=dsqrt((sum1-sum**2)/dfloat(ntotal))
1106 EFF=1d0*(ntotal-ncut)/ntotal
1119 ccccc create histograms
1130 if(pflag.eq.'pipm')then
1132 write(6,*)'pi+pi- production'
1133 elseif(pflag.eq.'pi0')then
1135 write(6,*)'pi0pi0 production'
1136 elseif(pflag.eq.'kpkm')then
1138 write(6,*)'K+K- production'
1139 elseif(pflag.eq.'ks')then
1141 write(6,*)'K0K0 production'
1142 elseif(pflag.eq.'rho')then
1144 write(6,*)'rho0rho0 production'
1149 if(pflag.eq.'rho')then
1150 write(6,221)rts,ntotal,sum,var
1152 write(6,222)rts,mmes,ntotal,sum,var
1155 if(output.eq.'lhe')then
1158 print*,'HEPEVT output'
1160 write(6,223)nev,sum,var
1168 . 3x,'collider energy (GeV) : ',f10.3,/,
1169 . 3x,'number of events : ',i9,/,
1170 . 3x,'sigma (nb) : ',f15.5,' +- ',f15.5,
1174 . 3x,'collider energy (GeV) : ',f10.3,/,
1175 . 3x,'meson mass (GeV) : ',f10.5,/,
1176 . 3x,'number of events : ',i9,/,
1177 . 3x,'sigma (nb) : ',f15.5,' +- ',f15.5,
1180 223 format(3x,'number of events : ',i9,/,
1181 . 3x,'sigma (nb) : ',f15.5,' +- ',f15.5,
1185 print*,'time elapsed = ', t2, ' s'
1190 ccccc Pomeron -- (off-shell) meson form factor
1193 implicit double precision(a-y)
1195 common/vars/s,rts,mmes,yx
1197 common/ffpars/bexp,ao,bo,aoo,boo
1199 if(formf.eq.'exp')then
1200 fpi=exp((x-mmes**2)*bexp)
1201 elseif(formf.eq.'orexp')then
1202 fpi=exp(-(dsqrt(-x+mmes**2+ao**2)-ao)*bo)
1203 elseif(formf.eq.'power')then
1204 fpi=1d0/(1d0-(x-mmes**2)/aoo)
1210 ccccccc Pom Pom --> meson pair amplitude
1212 subroutine wev(matt,v1,v2)
1213 implicit double precision(a-y)
1214 implicit complex*16(z)
1215 double precision q(4,20),svec(4),tvec(4),uvec(4),v1(4),v2(4)
1217 character*10 mregge,pflag
1220 common/vars/s,rts,mmes,yx
1221 common/wvars/sig0,bb,t1,t2
1222 common/alphas/alphap,alpha0,alphapr,alpha0r,alphapm,alpha0m
1223 common/sec/cpom,cf,crho,aff,ar
1224 common/hvars/sh,th,uh
1226 common/flags/ iin, pflag, fsi, ppbar, output, cuts, unw
1238 tvec(k)=q(k,10)-q(k,5)
1239 uvec(k)=q(k,10)-q(k,6)
1242 call dot(tvec,tvec,th)
1243 call dot(uvec,uvec,uh)
1245 sht1=2d0*(q(4,5)*q(4,3)-q(3,5)*q(3,3)-q(2,5)*q(2,3)-
1246 &q(1,5)*q(1,3))+mmes**2
1248 sht2=2d0*(q(4,6)*q(4,4)-q(3,6)*q(3,4)-q(2,6)*q(2,4)-
1249 &q(1,6)*q(1,4))+mmes**2
1251 shu1=2d0*(q(4,6)*q(4,3)-q(3,6)*q(3,3)-q(2,6)*q(2,3)-
1252 &q(1,6)*q(1,3))+mmes**2
1254 shu2=2d0*(q(4,5)*q(4,4)-q(3,5)*q(3,4)-q(2,5)*q(2,4)-
1255 &q(1,5)*q(1,4))+mmes**2
1257 bt1=(2d0*alphap*dlog(sht1))
1258 bt2=(2d0*alphap*dlog(sht2))
1259 bu1=(2d0*alphap*dlog(shu1))
1260 bu2=(2d0*alphap*dlog(shu2))
1262 bt1r=(2d0*alphapr*dlog(sht1))
1263 bt2r=(2d0*alphapr*dlog(sht2))
1264 bu1r=(2d0*alphapr*dlog(shu1))
1265 bu2r=(2d0*alphapr*dlog(shu2))
1267 sig0t1=sig0*sht1**0.0808d0/0.389d0
1268 sig0t2=sig0*sht2**0.0808d0/0.389d0
1269 sig0u1=sig0*shu1**0.0808d0/0.389d0
1270 sig0u2=sig0*shu2**0.0808d0/0.389d0
1272 t11=v1(1)**2+v1(2)**2
1273 t22=v2(1)**2+v2(2)**2
1275 zmt=(zi*dexp(-bt1*t11/2d0)*cpom*sht1**alpha0
1276 & +((aff+zi)*cf*sht1**alpha0r+(ar-zi)*crho*sht1**alpha0r)
1277 & *dexp(-bt1r*t11/2d0))
1278 zmt=zmt*(zi*dexp(-bt2*t22/2d0)*cpom*sht2**alpha0
1279 & +((aff+zi)*cf*sht2**alpha0r-(ar-zi)*crho*sht2**alpha0r)
1280 & *dexp(-bt2r*t11/2d0))
1281 zmt=zmt*fpi(th)**2/(mmes**2-th)
1283 zmu=(zi*dexp(-bu1*t11/2d0)*cpom*shu1**alpha0
1284 & +((aff+zi)*cf*shu1**alpha0r-(ar-zi)*crho*shu1**alpha0r)
1285 & *dexp(-bu1r*t11/2d0))
1286 zmu=zmu*(zi*dexp(-bu2*t22/2d0)*cpom*shu2**alpha0
1287 & +((aff+zi)*cf*shu2**alpha0r+(ar-zi)*crho*shu2**alpha0r)
1288 & *dexp(-bu2r*t22/2d0))
1289 zmu=zmu*fpi(uh)**2/(mmes**2-uh)
1296 c binning subroutine
1298 subroutine binit(wt)
1299 implicit double precision(a-y)
1300 double precision q(4,20),pt1(2),pt2(2),ptx(2)
1302 common/mompt/pt1,pt2,ptx
1303 common/vars/s,rts,mmes,yx
1304 common/vars1/ptgam,etagam,ptel2,ptel1,etael1,etael2
1305 common/vars2/ptpi1,etapi1,ptpi2,etapi2
1306 common/ang/cost,costa,costb
1307 common/hvars/sh,th,uh
1309 ypisum=0.5d0*dlog((q(4,5)+q(4,6)+q(3,5)+q(3,6))
1310 & /(q(4,5)+q(4,6)-q(3,5)-q(3,6)))
1312 ypi1=0.5d0*dlog((q(4,5)+q(3,5))
1314 ypi2=0.5d0*dlog((q(4,6)+q(3,6))
1317 call histo1(1,30,0d0,4.5d0,dsqrt(sh),wt)
1322 ccccc Cutting subroutine
1324 ccccc User can define their own cuts on any particle momenta, stored in array q(i,j)
1327 subroutine cut(icut)
1328 implicit double precision(a-y)
1329 double precision q(4,20)
1332 common/vars/s,rts,mmes,yx
1333 common/vars1/ptgam,etagam,ptel2,ptel1,etael1,etael2
1334 common/vars2/ptpi1,etapi1,ptpi2,etapi2
1335 common/cuts/etaelmax,etaelmin,ptelmin,ptphmin,ecut,rmax,rmin,mcut
1336 common/hvars/sh,th,uh
1342 c -- meson 1 variables
1343 ptpi1=dsqrt(q(1,5)**2+q(2,5)**2)
1344 pmodpi1=dsqrt(q(1,5)**2+q(2,5)**2+q(3,5)**2)
1345 etapi1=.5d0*dlog((pmodpi1+q(3,5))
1346 . /(pmodpi1-q(3,5)))
1348 ypi1=.5d0*dlog((q(4,5)+q(3,5))
1351 etpi1=q(4,5)*dsqrt(pmodpi1**2-q(3,5)**2)/pmodpi1
1353 c -- meson 2 variables
1354 ptpi2=dsqrt(q(1,6)**2+q(2,6)**2)
1355 pmodpi2=dsqrt(q(1,6)**2+q(2,6)**2+q(3,6)**2)
1356 etapi2=.5d0*dlog((pmodpi2+q(3,6))
1357 . /(pmodpi2-q(3,6)))
1359 ypi2=.5d0*dlog((q(4,6)+q(3,6))
1362 etpi2=q(4,6)*dsqrt(pmodpi2**2-q(3,6)**2)/pmodpi2
1364 c print*,ptpi1,ptpi2
1366 ccccc example cuts....
1368 c if(dsqrt(sh).lt.0.8d0)return
1373 c if(dabs(xf1).lt.0.9d0)return
1374 c if(dabs(xf2).lt.0.9d0)return
1376 ccccccccc Basic cuts described at start of code
1378 if(ptpi1.lt.ecut)return
1379 if(ptpi2.lt.ecut)return
1380 if(ypi1.gt.rmax)return
1381 if(ypi2.gt.rmax)return
1382 if(ypi1.lt.rmin)return
1383 if(ypi2.lt.rmin)return
1392 subroutine histo1(ih,ib,x0,x1,x,w)
1393 implicit real*8(a-h,o-z)
1394 character*1 regel(30),blank,star
1395 dimension h(20,100),hx(20),io(20),iu(20),ii(20)
1396 dimension y0(20),y1(20),ic(20)
1397 data regel / 30*' ' /,blank /' ' /,star /'*'/
1399 open(10,file="output.dat")
1405 ix=idint((x-x0)/(x1-x0)*dble(ib))+1
1407 if(h(ih,ix).gt.hx(ih)) hx(ih)=h(ih,ix)
1418 bsize=(x11-x01)/dble(ib1)
1419 hx(ih)=hx(ih)*(1.d0+1.d-06)
1420 if(il.eq.0) write(6,21) ih,ii(ih),iu(ih),io(ih)
1421 if(il.eq.1) write(6,22) ih,ii(ih),iu(ih),io(ih)
1422 21 format(' no.',i3,' lin : inside,under,over ',3i6)
1423 22 format(' no.',i3,' log : inside,under,over ',3i6)
1424 if(ii(ih).eq.0) goto 28
1426 23 format(35(1h ),3(10h----+----i))
1428 z=(dble(iv)-0.5d0)/dble(ib1)*(x11-x01)+x01
1430 iz=idint(h(ih,iv)/hx(ih)*30.)+1
1433 if(h(ih,iv).gt.0.d0)
1434 .iz=idint(dlog(h(ih,iv))/dlog(hx(ih))*30.)+1
1435 25 if(iz.gt.0.and.iz.le.30) regel(iz)=star
1436 write(6,26) z,h(ih,iv)/bsize,(regel(i),i=1,30)
1437 c write(10,*)z-0.125d0/2d0,h(ih,iv)/bsize ! Print histogram to file
1438 write(10,*)z,h(ih,iv)/bsize ! Print histogram to file
1439 c write(10,*)z,h(ih,iv)/bsize ! Print histogram to file
1440 26 format(1h ,2g15.6,4h i,30a1,1hi)
1441 36 format(1h ,2g15.6)
1442 if(iz.gt.0.and.iz.le.30) regel(iz)=blank
1447 29 format(' no entries inside histogram')
1461 cccc Initializes soft model parameters
1463 subroutine initpars(in)
1464 implicit double precision(a-y)
1467 double precision cc0(5),bm(5),bb0(5),pp0(5),bex(5),gaa(5)
1468 common/pars/cc0,bm,bb0,pp0,bex,asp,sigo,gaa,ep,norm
1470 common/vars/s,rts,mmes,yx
1558 ep=0.11d0 !!! Capital delta
1559 asp=0.06d0 !!! alpha'
1560 ep1=0d0 !!! Zero in all models, matters (?)
1561 sigo=50d0/0.39d0 !!! sigma_0 (GeV^-2)
1562 gaa3=6d0 !!! k2/k(1.8 TeV)
1563 gd2=1.3d0 !!! k1/k(1.8 TeV)
1565 nga=1 !!! A flag (?)
1567 bm(1)=3d0 !!! Doesn't matter
1568 bb0(1)=0.45d0 !!! c1-0.08 (added back later)
1569 pp0(1)=0.5d0 !!! 2*|a_1|^2
1572 cc0(2)=0.48d0 !!! d2
1573 bm(2)=1.5d0 !!! Doesn't matter
1574 bb0(2)=0.16d0 !!! c2-0.08 (added back later)
1575 pp0(2)=1d0 !!! |a_2|^2 is set later
1578 cc0(3)=0.12d0 !!! Beta : k^2_min ~ s^Beta
1582 if(nch.eq.3) pp0(3)=3d0-pp0(2)-pp0(1)
1583 if(nch.eq.2) pp0(2)=2d0-pp0(1) !!! Set |a_2|^2
1584 if(nch.eq.1) pp0(1)=1d0
1586 if(in.eq.3.or.in.eq.4)then
1588 gamm=(1800d0/rts)**cc0(3)
1589 ga1=1d0/(1d0+gamm*gd2)
1590 ga2=1d0/(1d0+gamm*gaa3)
1591 gaa(1)=2d0*ga1/(ga1+ga2) !!! gamma_1 (+) Eq (15)
1592 gaa(2)=2d0*ga2/(ga1+ga2) !!! gamma_2 (-) Eq (15)
1594 elseif(in.eq.1.or.in.eq.2)then
1597 gaa(1)=1d0+dsqrt(gd2)
1598 gaa(2)=1d0-dsqrt(gd2)
1600 elseif(nch.eq.1)then
1612 sum=sum+gaa(i1)*gaa(i2)*pp0(i1)*pp0(i2)/dble(nch)**2
1621 ccccc Calculates proton opacity
1624 implicit double precision(a-y)
1625 integer nb,i1,i2,nch,ib
1627 double precision op(5,5,10000,2),oph(5,5,10000,2)
1633 print*,'Calculating opacity'
1642 call opacity(i1,i2,bt,fr,fr1)
1650 write(40,*)bt,fr,fr1
1659 cccc Calculates screening amplitude (in k_t space)
1661 subroutine calcscreen
1662 implicit double precision(a-y)
1663 integer ns,i1,i2,nch,ib
1665 double precision sca(5,5,0:40000,2),sca1(5,5,0:40000,2)
1666 common/spac/sca,sca1
1672 lginck=(dlog(ksqma/ksqmin))/dble(ns)
1674 print*,'Calculating screening amplitude'
1685 lgksq=dble(ib-1)*lginck+dlog(ksqmin)
1692 call screening(i1,i2,ksq,sc,sc1)
1694 sca(i1,i2,ib,1)=lgksq
1696 sca1(i1,i2,ib,1)=lgksq
1697 sca1(i1,i2,ib,2)=sc1
1707 ccccc Interpolation....
1709 subroutine opacityint(i,j,bt,out,out1)
1710 implicit double precision(a-y)
1711 double precision op(5,5,10000,2),oph(5,5,10000,2)
1715 incbt=op(1,1,2,1)-op(1,1,1,1)
1717 if(dble(it).gt.(bt/incbt))then
1721 m=(op(i,j,it+2,2)-op(i,j,it+1,2))
1722 &/(op(i,j,it+2,1)-op(i,j,it+1,1))
1723 del=bt-op(1,1,it+1,1)
1724 mh=(oph(i,j,it+2,2)-oph(i,j,it+1,2))
1725 &/(oph(i,j,it+2,1)-oph(i,j,it+1,1))
1726 delh=bt-oph(1,1,it+1,1)
1728 out=m*del+op(i,j,it+1,2)
1729 out1=mh*delh+oph(i,j,it+1,2)
1734 subroutine screeningint(i,j,ktsq,out,out1)
1735 implicit double precision(a-y)
1736 double precision sca(5,5,0:40000,2),sca1(5,5,0:40000,2)
1738 common/spac/sca,sca1
1740 if(ktsq.lt.0.001d0)then
1744 m=(sca(i,j,it+1,2)-sca(i,j,it,2))
1745 & /(dexp(sca(i,j,it+1,1))-sca(i,j,it,1))
1746 del=ktsq-sca(1,1,it,1)
1747 m1=sca1(i,j,it+1,2)-sca1(i,j,it,2)
1748 & /(dexp(sca1(i,j,it+1,1))-sca1(i,j,it,1))
1749 del1=ktsq-sca1(1,1,it,1)
1751 out=m*del+sca(i,j,it,2)
1752 out1=m1*del1+sca1(i,j,it,2)
1754 elseif(ktsq.lt.8d0)then
1757 inckt=sca(1,1,2,1)-sca(1,1,1,1)
1758 it=nint((dlog(ktsq)-ktmin)/inckt)
1759 if(dble(it).gt.((dlog(ktsq)-ktmin)/inckt))then
1763 m=(sca(i,j,it+2,2)-sca(i,j,it+1,2))
1764 & /(sca(i,j,it+2,1)-sca(i,j,it+1,1))
1765 del=dlog(ktsq)-sca(1,1,it+1,1)
1766 m1=sca1(i,j,it+2,2)-sca1(i,j,it+1,2)
1767 & /(sca1(i,j,it+2,1)-sca1(i,j,it+1,1))
1768 del1=dlog(ktsq)-sca1(1,1,it+1,1)
1770 out=m*del+sca(i,j,it+1,2)
1771 out1=m1*del1+sca1(i,j,it+1,2)
1783 cccc Integrates round Pomeron loop (to calculate screened amplitude)
1785 subroutine schimc(p1x,p1y,p2x,p2y,out)
1786 implicit double precision(a-y)
1787 integer nx,jx,jy,nch,i1,i2,it,k
1788 double precision cc0(5),bm(5),bb0(5),pp0(5),bex(5),gaa(5)
1789 double precision sca(5,5,0:40000,2),sca1(5,5,0:40000,2)
1790 double precision a1(4),a2(4),q(4,20)
1791 complex*16 out,x0,x00
1792 common/pars/cc0,bm,bb0,pp0,bex,asp,sigo,gaa,ep,norm
1794 common/spac/sca,sca1
1796 common/wvars/sig0,bb,t1,t2
1797 common/alphas/alphap,alpha0,alphapr,alpha0r,alphapm,alpha0m
1832 call screeningint(i1,i2,tp2,sc,sc1)
1835 x0=x0*pp0(i1)*pp0(i2)/dble(nch)**2
1836 x0=x0*dexp(-((t12+0.08d0+bb0(i1))*bex(i1))**cc0(i1)+
1837 & (bex(i1)*(bb0(i1)+0.08d0))**cc0(i1))
1838 x0=x0*dexp(-((t22+0.08d0+bb0(i2))*bex(i2))**cc0(i2)+
1839 & (bex(i2)*(bb0(i2)+0.08d0))**cc0(i2))
1858 call formfac(t11,t22,x00p)
1869 ccccc Pomeron -- diffrative eignstate i form factor
1871 subroutine formfac(t1,t2,out)
1872 implicit double precision(a-y)
1873 double precision cc0(5),bm(5),bb0(5),pp0(5),bex(5),gaa(5)
1874 common/pars/cc0,bm,bb0,pp0,bex,asp,sigo,gaa,ep,norm
1880 delta1=dexp(-t1/2d0)
1881 delta2=dexp(-t2/2d0)
1886 wt=gaa(i1)*gaa(i2)*pp0(i1)*pp0(i2)/dble(nch)**2
1887 wt=wt*dexp(-((t1+0.08d0+bb0(i1))*bex(i1))**cc0(i1)+
1888 & (bex(i1)*(bb0(i1)+0.08d0))**cc0(i1))
1889 wt=wt*dexp(-((t2+0.08d0+bb0(i2))*bex(i2))**cc0(i2)+
1890 & (bex(i2)*(bb0(i2)+0.08d0))**cc0(i2))
1900 subroutine screening(i,j,ktsq,out,out1)
1901 implicit double precision(a-y)
1902 integer i,j,ib,nb,it,nt,nch
1903 double precision cc0(5),bm(5),bb0(5),pp0(5),bex(5),gaa(5)
1904 common/pars/cc0,bm,bb0,pp0,bex,asp,sigo,gaa,ep,norm
1906 common/vars/s,rts,mmes,yx
1920 call opacityint(i,j,bt,fr,fr1)
1922 sige=sigo*dexp(dlog(rts)*2d0*ep)
1923 fr=fr*gaa(i)*gaa(j)*sige
1924 fr1=fr1*gaa(i)*gaa(j)*sige
1926 out=out+wt*(1d0-dexp(-fr/2d0))*besj0(bt*dsqrt(ktsq))
1928 out1=out1+wt*(1d0-dexp(-fr1/2d0))*besj0(bt*dsqrt(ktsq))
1937 subroutine opacity(i,j,bt,out,out1)
1938 implicit double precision(a-y)
1939 integer i,j,ib,nb,it,nt,nch
1940 double precision cc0(5),bm(5),bb0(5),pp0(5),bex(5),gaa(5)
1941 common/pars/cc0,bm,bb0,pp0,bex,asp,sigo,gaa,ep,norm
1943 common/vars/s,rts,mmes,yx
1962 wt=htt*2d0*dble(it)/4d0/pi
1963 if(it.eq.0) wt=wt/2d0
1964 bes0=besj0(bt*dsqrt(t))
1966 ffi=dexp(-((t+0.08d0+bb0(i))*bex(i))**cc0(i)+
1967 & (bex(i)*(bb0(i)+0.08d0))**cc0(i))
1968 ffj=dexp(-((t+0.08d0+bb0(j))*bex(j))**cc0(j)+
1969 & (bex(j)*(bb0(j)+0.08d0))**cc0(j))
1972 form1=dlog(ffi*ffj)-2d0*t*asp1*dlog(rts)
1975 h1pi=2d0*a4+t*(alo-ah*ah*ah*dlog((1d0+ah)/(ah-1d0))) !!! Pion loop insertion
1976 h1pi=h1pi*sigo/(72d0*pi**3*(1d0+t/bpol)**2)
1978 ww=bes0*dexp(form1-2d0*h1pi*dlog(rts))
1982 out1=out1+bes0*wt*ffi*ffj
1990 function rgauss(r1,r2)
1991 implicit double precision (a-y)
1994 rgauss=dsqrt(-2d0*dlog(r1))*dsin(2d0*pi*r2)
1999 c boosting subroutine
2001 subroutine boost(p,pboo,pcm,plb)
2002 real*8 pboo(4),pcm(4),plb(4),p,fact
2003 plb(4)=(pboo(4)*pcm(4)+pboo(3)*pcm(3)
2004 & +pboo(2)*pcm(2)+pboo(1)*pcm(1))/p
2005 fact=(plb(4)+pcm(4))/(p+pboo(4))
2007 10 plb(j)=pcm(j)+fact*pboo(j)
2011 c calculates lorentzian dot product for real 4-vectors
2013 subroutine dot(v1,v2,dt)
2014 double precision v1(4),v2(4),dt
2016 dt=-(v1(1)*v2(1)+v1(2)*v2(2)+v1(3)*v2(3)
2024 * subtractive mitchell-moore generator
2025 * ronald kleiss - october 2, 1987
2027 * the algorithm is N(i)=[ N(i-24) - N(i-55) ]mod M,
2028 * implemented in a cirucular array with identifcation
2029 * of NR(i+55) and nr(i), such that effectively:
2030 * N(1) <--- N(32) - N(1)
2031 * N(2) <--- N(33) - N(2) ....
2032 * .... N(24) <--- N(55) - N(24)
2033 * N(25) <--- N(1) - N(25) ....
2034 * .... N(54) <--- N(30) - N(54)
2035 * N(55) <--- N(31) - N(55)
2037 * in this version M =2**30 and RM=1/M=2.D0**(-30.D0)
2039 * the array NR has been initialized by putting NR(i)=i
2040 * and subsequently running the algorithm 100,000 times.
2043 subroutine R2455(Ran)
2044 IMPLICIT REAL*8(A-H,O-Z)
2047 . 980629335, 889272121, 422278310,1042669295, 531256381,
2048 . 335028099, 47160432, 788808135, 660624592, 793263632,
2049 . 998900570, 470796980, 327436767, 287473989, 119515078,
2050 . 575143087, 922274831, 21914605, 923291707, 753782759,
2051 . 254480986, 816423843, 931542684, 993691006, 343157264,
2052 . 272972469, 733687879, 468941742, 444207473, 896089285,
2053 . 629371118, 892845902, 163581912, 861580190, 85601059,
2054 . 899226806, 438711780, 921057966, 794646776, 417139730,
2055 . 343610085, 737162282,1024718389, 65196680, 954338580,
2056 . 642649958, 240238978, 722544540, 281483031,1024570269,
2057 . 602730138, 915220349, 651571385, 405259519, 145115737/
2059 DATA RM/0.9313225746154785D-09/
2079 SUBROUTINE RAMBO(N,ET,XM,P,WT)
2080 C------------------------------------------------------
2084 C RA(NDOM) M(OMENTA) B(EAUTIFULLY) O(RGANIZED)
2086 C A DEMOCRATIC MULTI-PARTICLE PHASE SPACE GENERATOR
2087 C AUTHORS: S.D. ELLIS, R. KLEISS, W.J. STIRLING
2088 C THIS IS VERSION 1.0 - WRITTEN BY R. KLEISS
2090 C N = NUMBER OF PARTICLES (>1, IN THIS VERSION <101)
2091 C ET = TOTAL CENTRE-OF-MASS ENERGY
2092 C XM = PARTICLE MASSES ( DIM=100 )
2093 C P = PARTICLE MOMENTA ( DIM=(4,100) )
2094 C WT = WEIGHT OF THE EVENT
2096 C------------------------------------------------------
2100 double precision et,xm(100),p(4,100),wt
2103 ! internal variables
2104 double precision q(4,100),z(100),r(4),
2105 & b(3),p2(100),xm2(100),e(100),v(100)
2107 double precision acc
2108 integer itmax,ibegin
2109 data acc/1.0d-14/,itmax/6/,ibegin/0/,iwarn/5*0/
2112 double precision twopi,po2log,xmt,c,s,f,rmas,g,a,x,bq,
2113 & accu,f0,g0,wt2,wt3,wtm,x2,xmax
2119 C INITIALIZATION STEP: FACTORIALS FOR THE PHASE SPACE WEIGHT
2120 IF(IBEGIN.NE.0) GOTO 103
2122 TWOPI=8.*DATAN(1.D0)
2123 PO2LOG=DLOG(TWOPI/4.)
2126 101 Z(K)=Z(K-1)+PO2LOG-2.*DLOG(DFLOAT(K-2))
2128 102 Z(K)=(Z(K)-DLOG(DFLOAT(K-1)))
2130 C CHECK ON THE NUMBER OF PARTICLES
2131 103 IF(N.GT.1.AND.N.LT.101) GOTO 104
2135 C CHECK WHETHER TOTAL ENERGY IS SUFFICIENT; COUNT NONZERO MASSES
2139 IF(XM(I).NE.0.D0) NM=NM+1
2140 105 XMT=XMT+DABS(XM(I))
2141 IF(XMT.LE.ET) GOTO 201
2145 C THE PARAMETER VALUES ARE NOW ACCEPTED
2147 C GENERATE N MASSLESS MOMENTA IN INFINITE PHASE SPACE
2152 Q(4,I)=-DLOG(RN(3)*RN(4))
2154 Q(2,I)=Q(4,I)*S*DCOS(F)
2155 202 Q(1,I)=Q(4,I)*S*DSIN(F)
2158 C CALCULATE THE PARAMETERS OF THE CONFORMAL TRANSFORMATION
2163 204 R(K)=R(K)+Q(K,I)
2164 RMAS=DSQRT(R(4)**2-R(3)**2-R(2)**2-R(1)**2)
2171 C TRANSFORM THE Q'S CONFORMALLY INTO THE P'S
2173 BQ=B(1)*Q(1,I)+B(2)*Q(2,I)+B(3)*Q(3,I)
2175 206 P(K,I)=X*(Q(K,I)+B(K)*(Q(4,I)+A*BQ))
2176 207 P(4,I)=X*(G*Q(4,I)+BQ)
2178 C CALCULATE WEIGHT AND POSSIBLE WARNINGS
2180 IF(N.NE.2) WT=(2.*N-4.)*DLOG(ET)+Z(N)
2181 IF(WT.GE.-180.D0) GOTO 208
2182 IF(IWARN(1).LE.5) PRINT 1004,WT
2184 208 IF(WT.LE. 174.D0) GOTO 209
2185 IF(IWARN(2).LE.5) PRINT 1005,WT
2188 C RETURN FOR WEIGHTED MASSLESS MOMENTA
2189 209 IF(NM.NE.0) GOTO 210
2193 C MASSIVE PARTICLES: RESCALE THE MOMENTA BY A FACTOR X
2194 210 XMAX=DSQRT(1.-(XMT/ET)**2)
2205 E(I)=DSQRT(XM2(I)+X2*P2(I))
2207 303 G0=G0+P2(I)/E(I)
2208 IF(DABS(F0).LE.ACCU) GOTO 305
2210 IF(ITER.LE.ITMAX) GOTO 304
2211 C PRINT 1006,ITMAX,ACCU,DABS(F0)
2212 WRITE(99,1006)ITMAX,ACCU,DABS(F0)
2213 IF (DABS(F0).GT.1.0E-6) THEN
2214 WRITE(*,1007)DABS(F0)
2225 C CALCULATE THE MASS-EFFECT WEIGHT FACTOR
2230 308 WT3=WT3+V(I)**2/E(I)
2231 WTM=(2.*N-3.)*DLOG(X)+DLOG(WT2/WT3*ET)
2233 C RETURN FOR WEIGHTED MASSIVE MOMENTA
2235 IF(WT.GE.-180.D0) GOTO 309
2236 IF(IWARN(3).LE.5) PRINT 1004,WT
2238 309 IF(WT.LE. 174.D0) GOTO 310
2239 IF(IWARN(4).LE.5) PRINT 1005,WT
2244 1001 FORMAT(' RAMBO FAILS: # OF PARTICLES =',I5,' IS NOT ALLOWED')
2245 1002 FORMAT(' RAMBO FAILS: TOTAL MASS =',D15.6,' IS NOT',
2246 . ' SMALLER THAN TOTAL ENERGY =',D15.6)
2247 1004 FORMAT(' RAMBO WARNS: WEIGHT = EXP(',F20.9,') MAY UNDERFLOW')
2248 1005 FORMAT(' RAMBO WARNS: WEIGHT = EXP(',F20.9,') MAY OVERFLOW')
2249 1006 FORMAT(' RAMBO WARNS:',I3,' ITERATIONS DID NOT GIVE THE',
2250 . ' DESIRED ACCURACY =',D10.3,' (STOPS AT',D10.3,')')
2251 1007 FORMAT(' RAMBO WARNS: END OF ITERATION ACCURACY TOO LOW =',D10.3)
2257 * SUBTRACTIVE MITCHELL-MOORE GENERATOR
2258 * RONALD KLEISS - OCTOBER 2, 1987
2260 * THE ALGORITHM IS N(I)=[ N(I-24) - N(I-55) ]MOD M,
2261 * IMPLEMENTED IN A CIRUCULAR ARRAY WITH IDENTIFCATION
2262 * OF NR(I+55) AND NR(I), SUCH THAT EFFECTIVELY:
2263 * N(1) <--- N(32) - N(1)
2264 * N(2) <--- N(33) - N(2) ....
2265 * .... N(24) <--- N(55) - N(24)
2266 * N(25) <--- N(1) - N(25) ....
2267 * .... N(54) <--- N(30) - N(54)
2268 * N(55) <--- N(31) - N(55)
2270 * IN THIS VERSION M =2**30 AND RM=1/M=2.D0**(-30D0)
2272 * THE ARRAY NR HAS BEEN INITIALIZED BY PUTTING NR(I)=I
2273 * AND SUBSEQUENTLY RUNNING THE ALGORITHM 100,000 TIMES.
2281 . 980629335, 889272121, 422278310,1042669295, 531256381,
2282 . 335028099, 47160432, 788808135, 660624592, 793263632,
2283 . 998900570, 470796980, 327436767, 287473989, 119515078,
2284 . 575143087, 922274831, 21914605, 923291707, 753782759,
2285 . 254480986, 816423843, 931542684, 993691006, 343157264,
2286 . 272972469, 733687879, 468941742, 444207473, 896089285,
2287 . 629371118, 892845902, 163581912, 861580190, 85601059,
2288 . 899226806, 438711780, 921057966, 794646776, 417139730,
2289 . 343610085, 737162282,1024718389, 65196680, 954338580,
2290 . 642649958, 240238978, 722544540, 281483031,1024570269,
2291 . 602730138, 915220349, 651571385, 405259519, 145115737/
2292 double precision eps
2298 data rm/0.9313225746154785D-09/
2317 IF(RN.LT.EPS) GOTO 1
2318 IF(RN.GT.1D0-EPS) GOTO 1