4 #include "csoftenPiK.f" 18 integer i, nev, j, ntp, eof, ntpo
27 *
' number of events generated is ',
j-1
55 *
' number of events generated is ',nevent
58 *
"Equivalent Lab. Energy was ", labequive,
" GeV/n" 69 #include "Zmanagerp.h" 73 character*200 input, file
75 integer klena, icon, eof
83 if(tracedir .eq.
' ')
then 85 tracedir =
'/tmp/'//uid(1:klena(uid))
88 if(desteventno(2) .eq. 0)
then 89 nevent =abs( desteventno(1) )
91 nevent = abs( desteventno(2) )
97 write(0,*)
' cos* min max=', wzmin,
wzmax 103 if(input(1:4) .eq.
"file")
then 105 xyz=index(input,
"xyz")
108 file=input(1:klena(input))
112 *
' file=', file,
' cannot be opened in Gencol' 123 input = trim(input)//
" /" 127 if(input .ne.
' ')
then 129 read(input, *) xpos(1:3)
140 if( index( intmodel,
'qgsjet1') .ne. 0 )
then 143 activemdl =
'qgsjet1' 145 write(0,*)
'to use qgsjet1, define it in Zintmodel.h' 155 write(0, *)
'Active int. model=',activemdl
157 if( plab%code ==
kgnuc )
then 158 labequive= plab%fm%p(4)/plab%subcode
160 labequive=plab%fm%p(4)
162 if( activemdl ==
"dpmjet3" )
then 168 if(pj%code ==
kmuon )
then 179 if( targetname /=
" " )
then 183 write(0,*)
" targetName =", targetname
184 write(0,*)
" not acceptable " 188 write(0,*)
" projectile code =", plab%code,
"= muon" 189 write(0,*)
" In this case, media name of the target must" 190 write(0,*)
" follow the target partcile momentum, e.g," 191 write(0,*)
" UserHookc = '1 -1 0 0. 0 500'," 192 write(0,*)
" '9 16 8 0 0 0. LiqO2'," 202 #include "Zprivate.h" 206 character(80):: input
212 if( tg%code ==
kgnuc )
then 213 if( pj%fm%p(4) < 7. )
then 215 *
'photon E must be >= 7 for A target' 219 if( pj%fm%p(4) < 6. )
then 221 *
'photon E must be >= 6 for non-A target' 227 call copenf(11,
"dpmjet.inp", icon)
229 write(0,*)
' dpmjet.inp cannot be opened' 234 call ksplit(input,8, 3, bb, nr)
235 if( bb(1) ==
"ENERGY")
then 237 write(0,*)
"ENERGY in dpmjet.inp =", einput
238 if( einput < labequive)
then 239 write(0,*)
" is too small; give a value" 240 write(0,*)
"little bit larger than ",labequive
241 write(0,*)
" if taget is A, ~1.5 % " 242 write(0,*)
" if taget is p/n, very little" 244 *
"E.g ",labequive*1.001,
" with ~ 4 digit accuracy" 247 elseif( tg%code ==
kgnuc .and.
248 * einput > labequive*1.040 )
then 249 write(0,*)
" is too large; give a vlaue" 250 write(0,*)
"little bit larger than ",labequive
252 *
"E%g ",labequive*1.03,
" with ~ 4 digit accuracy" 254 elseif( tg%code /=
kgnuc .and.
255 * einput > labequive*1.002 )
then 256 write(0,*)
" is too large; give a vlaue" 257 write(0,*)
"little bit larger than ",labequive
259 *
"E%g ",labequive*1.001,
" with ~ 4 digit accuracy" 262 write(0,*)
" is close to ", labequive,
" and OK" 275 #include "Zprivate.h" 279 character(80):: input
283 integer code, subc, charge
285 call copenf(11,
"dpmjet.inp", icon)
287 write(0,*)
' dpmjet.inp cannot be opened' 291 read(11,
'(a)', end=100) input
292 call ksplit(input,8, 5, bb, nr)
294 if( bb(1) ==
"PROJPAR")
then 298 if( code /= pj%code .or. charge /= pj%charge )
then 301 *
' projectile mismatch bw dpmjet.inp and param' 302 write(0,*)
' dpmjet.inp :', btype
303 write(0,*)
' param: ', pj%code, pj%charge
306 elseif( nr == 3 )
then 308 read( bb(3), *) charge
310 if( subc /= pj%subcode .or. charge /= pj%charge )
then 311 write(0,*)
'proj mismatch bw dpmjet.inp and param' 315 if( pj%code /=
knuc .and. charge /= pj%charge )
then 316 write(0,*)
'proj mismatch bw dpmjet.inp and param' 321 elseif(bb(1) ==
"TARGETPAR")
then 325 if( code /= tg%code .or. charge /= tg%charge )
then 328 *
' target mismatch bw dpmjet.inp and param' 329 write(0,*)
' dpmjet.inp :', btype
330 write(0,*)
' param: ', tg%code, tg%charge
333 elseif( nr == 3 )
then 335 read( bb(3), *) charge
337 if( subc /= tg%subcode .or. charge /= tg%charge )
then 339 *
'target mismatch bw dpmjet.inp and param' 343 if( tg%code /=
knuc .and. charge /= tg%charge )
then 345 *
'target mismatch bw dpmjet.inp and param' 355 *
' proj targ consistency btw dpmjet.inp and param: OK' 357 subroutine cbtype2cos(btype, code, subc, charge)
360 character(8),
intent(in):: btype
361 integer,
intent(out):: code, subc, charge
413 write(0,*)
' not acceptable ptcl=',btype
450 #include "Zmanager.h" 451 #include "Zmanagerp.h" 455 type(
ptcl)::resttg, zcmsp, zplab
469 pj%fm%p(1) =
pjpx*pjmnum
470 pj%fm%p(2) =
pjpy*pjmnum
471 pj%fm%p(3) = pjpz*pjmnum
473 * sqrt(pj%fm%p(1)**2 + pj%fm%p(2)**2 + pj%fm%p(3)**2
483 tg%fm%p(1) =
tgpx*tgmnum
484 tg%fm%p(2) =
tgpy*tgmnum
485 tg%fm%p(3) = tgpz*tgmnum
487 * sqrt(tg%fm%p(1)**2 + tg%fm%p(2)**2 + tg%fm%p(3)**2
490 if(
tgpx .eq. 0. .and.
tgpy .eq. 0. .and.
496 s= 2*pj%fm%p(4)*tg%mass +tg%mass**2 + pj%mass**2
500 s = pj%mass**2 + tg%mass**2 +
501 * 2*(pj%fm%p(4)*tg%fm%p(4) -
502 * dot_product(pj%fm%p(1:3), tg%fm%p(1:3) ) )
506 write(0, *)
' roots/2=', roots/2
507 write(0, *)
's,roots above are total not by /n' 510 call cbst1(1, tg, pj, plab)
512 call cbst1(2, tg, tg, resttg)
514 call cgeqm2(plab, resttg, cmsp, icon)
516 write(0,*)
' Cmsp= (/n)',cmsp%fm%p(:), cmsp%mass
517 write(0,*)
' plab=',plab%fm%p(4)
518 write(0,*)
' tg=', tg%fm%p(4)
521 write(0,*)
' input 2 ptcls cannot form CMS' 531 zplab%fm%p(3) = sqrt( zplab%fm%p(4)**2- zplab%mass**2)
533 call cgeqm2(zplab, resttg, zcmsp, icon)
546 #include "Zmanagerp.h" 547 #include "Zmanager.h" 556 integer nw, difcode(20)
563 * dot_product(
a(i)%fm%p(1:3),
a(i)%fm%p(1:3)) )
564 wx(1:3)=
a(i)%fm%p(1:3)/p
567 *
'(i3,i5,i4,1p, g14.5,0p, 3f17.13, i8)')
568 *
a(i)%code,
a(i)%subcode,
a(i)%charge,
569 *
a(i)%fm%p(4)-
a(i)%mass, wx(1:3), j
573 write(*,
'(i3,i5,i4,g14.5,1p3E11.3,0p3f17.13, i8)')
574 *
a(i)%code,
a(i)%subcode,
a(i)%charge,
575 *
a(i)%fm%p(4)-
a(i)%mass, xpos(1:3), wx(1:3), j
579 if(ntp .gt. 0 .or. outzero .eq. 1)
then 591 #include "Zmanagerp.h" 601 real*8 xs, SIGbdif, xsair
607 if(pj%code ==
kmuon )
then 613 elseif(pj%code ==
kelec .or.
614 * ( pj%code /=
kgnuc .and. pj%code >
knuc ) )
then 615 write(0,*)
' ptcl code =', pj%code,
' not ' 616 write(0,*)
' supported in Gencol' 620 if(activemdl .eq.
'qgsjet2' )
then 621 call cxsecqgs(plab, ta, xs)
622 elseif(activemdl .eq.
'epos' )
then 623 call ceposinioneevent(plab, tg, xs)
629 if(activemdl .eq.
'qgsjet1')
then 631 call qgs01event(plab, ta, tz,
a, ntp)
637 call chacol(plab, ta, tz,
a, ntp)
687 #include "Zelemagp.h" 692 integer,
intent(in):: tA
693 integer,
intent(in):: tZ
695 integer,
intent(out):: ntp
697 real(8):: TargetA, xs
698 if( howphotop > 0 .and. plab%fm%p(4) > minphotoprode )
then 712 call cgpxsec(targeta, plab%fm%p(4), xs)
716 a(1:nproduced) = pwork(1:nproduced)
719 write(0,*)
' HowPhotoP=', howphotop,
' Eg=', plab%fm%p(4)
720 write(0,*)
' Either of above NG for photon projectile' 732 #include "Zmanagerp.h" 742 p =
a(i)%fm%p(1)**2 +
a(i)%fm%p(2)**2 +
746 if( wz .ge. wzmin .and. wz .le.
wzmax )
then 765 ke(i) =
a(i)%fm%p(4) -
a(i)%mass
778 #include "Zmanagerp.h" 779 #include "Zmanager.h" 785 integer i, j, leng, icon, klena
789 character*100 tracefile
790 real(8):: x1(3), x2(3)
792 write(tracefile, *) tracedir(1:klena(tracedir))//
'/trace', nev
793 call kseblk(tracefile,
' ', leng)
794 call copenfw(tracedev, tracefile(1:leng), icon)
796 call cerrormsg(
'tracefile could not be opened',0)
818 #include "Zmanagerp.h" 823 real(8),
intent(in)::x1(3)
825 real(8),
intent(in):: leng
827 real(8)::wx(3), x2(3), p
829 p = sqrt( dot_product(
a%fm%p(1:3),
a%fm%p(1:3)))
831 wx(1:3)=
a%fm%p(1:3)/p
835 x2(1:3) = x1(1:3) + wx(1:3)*leng
836 write(tracedev,
'(3g14.5, i3, g14.4, i3, i2)')
838 *
a%code,
a%fm%p(4) -
a%mass,
a%charge,
840 write(tracedev,
'(3g14.5, i3, g14.4, i3, g14.4)' )
842 *
a%code,
a%fm%p(4) -
a%mass,
a%charge,
855 #include "Zmanagerp.h" 856 #include "Zmanager.h" 858 integer,
save:: nthev=0
861 INTEGER IPROCE,IDNODF,IDIFR1,IDIFR2,IDDPOM,IPRON
862 COMMON /poprcs/ iproce,idnodf,idifr1,idifr2,iddpom,ipron(15,4)
883 real*8 p, wx, wy, wz, pt, y, eta
884 integer npzm, npzp, Ncht, Nchpzm, Nchpzp
885 integer nw, diffcode(20)
889 real(8):: ylab, etalab
891 type(
ptcl):: pcms, pl
904 if(
a(i)%fm%p(3) .gt. 0.)
then 906 if(
a(i)%charge .ne. 0)
then 911 if(
a(i)%charge .ne. 0)
then 916 ncht = nchpzm + nchpzp
921 pt = sqrt(
a(i)%fm%p(1)**2 +
a(i)%fm%p(2)**2)
922 p= sqrt( pt**2 +
a(i)%fm%p(3)**2 )
923 xfke = (
a(i)%fm%p(4)-
a(i)%mass) /( pj%fm%p(4)- pj%mass)
924 xfpz =
a(i)%fm%p(3) / pj%fm%p(3)
928 write(*,
'(3i4, 1p, 7g13.4)')
929 *
a(i)%code,
a(i)%subcode,
a(i)%charge,
930 * pt, y, eta,
a(i)%fm%p(4)-
a(i)%mass,
a(i)%fm%p(3),
939 if(ntp .gt. 0 .or. outzero .eq. 1)
then 950 #include "Zmanagerp.h" 951 #include "Zmanager.h" 953 integer,
save:: nthev=0
956 INTEGER IPROCE,IDNODF,IDIFR1,IDIFR2,IDDPOM,IPRON
957 COMMON /poprcs/ iproce,idnodf,idifr1,idifr2,iddpom,ipron(15,4)
977 real*8 p, wx, wy, wz, pt, y, eta
978 integer npzm, npzp, Ncht, Nchpzm, Nchpzp
979 integer nw, diffcode(20)
985 real(8):: s, rootsh, xf, xflab, xfmax
986 real(8):: Esmax, Pszmax, Pzmax, Ebypzmax, Esbyrootsh
987 real(8):: ys, etas, Es, Elab, pabs, cost, teta
992 call cmkptc(6, -1, 1, restn)
993 restn%fm%p(1:3)=(/0.,0.,0./)
994 restn%fm%p(4) = restn%mass
995 call cgetcm(pj, restn, gc, icon)
996 s =( restn%mass + pj%fm%p(4) ) *2 * restn%mass
998 esmax=rootsh - pj%mass
999 pszmax=sqrt( esmax**2 -
maspic**2 )
1000 pzmax = gc%p(4)*pszmax + gc%p(3)* esmax
1003 call cbst0(j, gc,
a(j), cmptcl)
1004 call cyeta(cmptcl, ys, etas)
1009 xf = cmptcl%fm%p(3)/rootsh
1010 xflab =
a(j)%fm%p(3)/pzmax
1011 pt =sqrt(
a(j)%fm%p(1)**2 +
a(j)%fm%p(2)**2 )
1012 pabs = sqrt( pt**2 +
a(j)%fm%p(3)**2 )
1013 cost =
a(j)%fm%p(3)/pabs
1015 write(*,
'(2i4, 1p, 9g14.4)')
1016 *
a(j)%code,
a(j)%charge, etas, es, xf, eta, elab,
1017 * xflab, cost, teta, pt
1020 if(ntp .gt. 0 .or. outzero .eq. 1)
then 1033 #include "Zmanagerp.h" 1034 #include "Zmanager.h" 1035 #include "Ztrackp.h" 1036 include
"Zprivate.h" 1043 integer nw, difcode(20)
1047 call csibylgetdiffcode(nw, difcode)
1055 write(*,*)
'dif ', nw, difcode(1:nw)
1058 p2 = dot_product(
a(i)%fm%p(1:3),
a(i)%fm%p(1:3) )
1061 mass2= (
a(i)%fm%p(4)- p)*(
a(i)%fm%p(4)+ p)
1073 if(ntp .gt. 0 .or. outzero .eq. 1)
then
subroutine ksplit(a, m, n, b, nr)
subroutine cmkseed(dummy, seed)
subroutine cerrormsg(msg, needrtn)
subroutine csetcosorepi(from)
subroutine sortbyke(a, ntp)
integer maxn LabEquivE real outresul integer pjchg integer tgchg integer xyz real pjpz real tgpy
subroutine outresulx(a, ntp)
subroutine cbst1(init, p1, p2, po)
integer maxn LabEquivE real outresul integer pjchg integer tgchg integer inpfileno
max ptcl codes in the kgnuc
subroutine cintmodels(from)
subroutine cfixmodel(aPtcl)
latitude latitude this system is used *****************************************************************! type coord sequence union map real z z in m endmap xyz map real ! latitude in deg is to the north ! longitude in deg is to the east *h ! height in m endmap llh map real ! polar angle ! azimuthal angle *radius ! radial distance endmap sph endunion character *sys ! which system xyz
subroutine puttrace(x1, a, leng)
max ptcl codes in the kkaon
subroutine cibst1(init, p1, p2, po)
subroutine readinpfile(eof)
max ptcl codes in the kelec
integer maxn LabEquivE real outresul integer pjcode
block data cblkElemag data *AnihiE ! Eposi< 1 TeV, anihilation considered *X0/365.667/, ! radiation length of air in kg/m2 *Ecrit/81.e-3/, ! critical energy of air in GeV *MaxComptonE/1./, ! compton is considered below 1 GeV *MaxPhotoE/1.e-3/, ! above this, PhotoElectric effect neg. *MinPhotoProdE/153.e-3/, ! below 153 MeV, no gp --> hadrons ! scattering const not MeV *Knockon true
subroutine outtrace(nev, a, ntp)
subroutine cbst0(init, gb, p, po)
subroutine epreadmediaformuon
subroutine getimpactparam(bout)
subroutine outresulb(a, ntp)
********************block data cblkHeavy ********************integer j data *HeavyG2symbol *data *HeavyG2code kiron data j
subroutine copenfw2(io, fnin, form, icon)
subroutine getdiffcode(nw, difcode)
subroutine kqsortd(A, ORD, N)
subroutine cquhookr(i, rv)
integer maxn LabEquivE real outresul integer pjchg integer tgcode
subroutine ksortinv(idx, n)
subroutine creadparam(io)
max ptcl codes in the klambda
integer maxn LabEquivE real outresul integer pjchg integer tgsub
subroutine gencol(a, ntp)
integer maxn LabEquivE real outresul integer pjchg integer tgchg integer xyz real pjpz real * tgpx
integer maxn LabEquivE real * ke(maxn) integer indx(maxn) integer nevent integer outzero
********************block data cblkHeavy ********************integer j data *HeavyG2symbol *data *HeavyG2code knuc
subroutine copenf(io, fnin, icon)
subroutine cputgencolcms(cms)
subroutine cfixprefix(dsn)
integer maxn LabEquivE real outresul integer pjchg integer tgchg integer xyz real pjpy
subroutine outresulc(a, ntp)
subroutine cbtype2cos(btype, code, subc, charge)
subroutine formpjtg(confirm)
dE dx *! Nuc Int sampling table b
subroutine epgencolbyphoton(plab, tA, tZ, a, ntp)
subroutine copenfw(io, fnin, icon)
subroutine csoftenfe(inci, fwbwin, a, nin, nout)
subroutine cutbyangle(a, ntp0, ntp)
subroutine epgencolbymuon
subroutine cquhooki(i, iv)
subroutine cmkptc(code, subcode, charge, p)
subroutine outresul(a, ntp)
integer maxn LabEquivE real outresul integer pjsub
subroutine cquhookc(i, cv)
subroutine outresula(a, ntp)
max ptcl codes in the kpion
integer maxn LabEquivE real outresul integer pjchg integer tgchg integer xyz real * pjpx
subroutine chacol(pj, ia, iz, a, ntp)
subroutine cyeta(p, y, eta)
max ptcl codes in the kmuon
subroutine cgeqm2(p1, p2, q, icon)
subroutine kseblk(text, c, lc)
subroutine cgetcm(p1, p2, gc, icon)
subroutine cgpxsec(a, energy, xs)
subroutine cgetloginn(userid)