12 #include "Zmanagerp.h" 22 #include "Zincidentv.h" 26 #include "Zprivate1.f" 27 #include "Zprivate2.f" 28 #include "Zprivate3.f" 29 save rspec, lossrspec, arspec, respec
30 save rzspec, zfspec, rtspec1, rtspec2, retspec1, retspec2
31 save rezspec, rzfspec, rfspec, efspec, refspec
34 type(
track):: incident
35 type(
coord):: AngleAtObs
56 integer i, j, k, icon, ir, l
58 integer iij, code, codex
61 real*8 r, Eloss, rinmu, cosang
62 real*8 dedt, rho, dist, disto, dedxmu
67 real*8 wx, wy, wz, temp
71 integer ldep, ridx, faiidx
80 data ptcl/
"Photons",
"Electrons",
"Muons",
"hadrons"/
82 data ptcl2/
"Electrons",
"Muons",
"All"/
85 real E0, cosz, limit, limite
90 character*96 evid(nsites)
91 real*8 cog, cog2, sumne, obstimes, Savederg(5)
96 integer leng, lengn, lengid
104 #include "interfaceHBGR.f" 108 lengenv = kgetenv2(
"NCPU", input)
109 read(input(1:lengenv),*) ncpu
110 lengenv = kgetenv2(
"MCPU", input)
111 read(input(1:lengenv),*) mcpu
112 lengenv = kgetenv2(
"MARGIN", input)
113 read(input(1:lengenv),*) margin
115 enhance = enhance/mcpu
116 limite = limit * enhance
117 write(0,*)
' *** ncpu=',ncpu,
118 *
' mcpu=',mcpu,
' enhance factor=',enhance
119 write(0,*)
' margin=',margin
121 lengn = kgetenv2(
"NUMB", numb)
122 leng = kgetenv2(
"OUTDIR", input)
123 lengid = kgetenv2(
"EXECID", execid)
126 msg =input(1:leng)//
"/"//execid(1:lengid)//
127 *
"-@."//numb(1:lengn)//
".hyb" 130 write(0,*)
' icon=', icon
148 if(inci.
p.code .eq. 9)
then 150 elseif(inci.
p.code .eq. 1)
then 157 firstz= zfirst.pos.
depth*0.1
158 write(0,
'(a,1pE11.3,a,E11.3,a,E11.3,a)')
159 *
' E0=',e0,
' cosz=',cosz,
' firstz=',
162 do i = 1, noofassites
170 #include "interfaceHBGE.f" 174 entry xobs(atrack, id)
183 obstimes = obstimes + 1.
d0 184 if(mod(obstimes, 500000.
d0) .eq. 0. )
then 186 do i = 1, min(4,stack_pos)
187 if(stack(i).
p.fm.
p(4) .ne. savederg(i))
then 188 savederg(i)=stack(i).
p.fm.
p(4)
195 write(0, *)
' obstimes=', obstimes,
' ptclE=',atrack.
p.fm.
p(4)
196 do i = 1, min(4,stack_pos)
197 write(0,*)
' stack tops=', stack(i).
p.fm.
p(4)
202 if(id .eq. 2 .and. code .le. 6 )
then 204 wz = atrack.vec.w.r(3)
210 ng(ldep) =
ng(ldep) + enhance
211 elseif(code .eq.
kelec)
then 212 ne(ldep) =
ne(ldep) + enhance
213 elseif(code .eq.
kmuon)
then 214 nmu(ldep) =
nmu(ldep) + enhance
216 nhad(ldep)=nhad(ldep) + enhance
219 ek = atrack.
p.fm.
p(4) -atrack.
p.
mass 222 if(atrack.
p.
charge .ne. 0 )
then 223 rho = cvh2den(atrack.pos.
height)
230 if(abs(wz) .gt. 1.
d-2)
then 240 if(atrack.
p.code .eq.
kmuon )
then 242 call cmudedx(muni, mubr, mupr, atrack.
p.fm.
p(4),
249 call cqelossrate(dedt)
252 eloss = dedt*dist*enhance
254 sumeloss(ldep)=sumeloss(ldep) + eloss
258 if(atrack.
where .eq. 6)
then 260 *
'(4i3, 1p4E11.3, 0p, 2f8.4,f10.6)')
263 * atrack.pos.
xyz.
x, atrack.pos.
xyz.
y,
264 * -atrack.vec.w.r(1), -atrack.vec.w.r(2), wz
268 #include "interfaceHOBS.f" 274 firstz= zfirst.pos.
depth*0.1
279 do i = 1, noofassites
280 asobssites(i).esize = asobssites(i).esize* enhance
281 if(i .gt. 1 .and. i .lt. noofassites )
then 282 dd =(asdepthlist(i+1) - asdepthlist(i-1))/2.0
283 elseif(i .eq. 1)
then 284 dd =(asdepthlist(2) - asdepthlist(1))
286 dd =(asdepthlist(noofassites) -
287 * asdepthlist(noofassites-1))
289 cog = cog + asobssites(i).esize*dd*asdepthlist(i)
290 sumne= sumne +asobssites(i).esize*dd
296 do i = 1, noofassites
297 if( asobssites(i).age .gt.
298 * (2.0-asobssites(noofassites).age))
then 299 if(i .gt. 1 .and. i .lt. noofassites )
then 300 dd =( asdepthlist(i+1) - asdepthlist(i-1))/2.0
301 elseif(i .eq. 1)
then 302 dd =(asdepthlist(2) - asdepthlist(1))
304 dd =(asdepthlist(noofassites) -
305 * asdepthlist(noofassites-1))
308 cog2 = cog2 + asobssites(i).esize*asdepthlist(i)*dd
309 sumne= sumne +asobssites(i).esize*dd
312 if(sumne .gt. 0.)
then 313 cog2 = cog2*0.1/sumne
316 cog2 = asdepthlist(noofassites)*0.1
319 if(fnob .ge. 0 )
then 321 *
'("h ", i4, 3i3, 1pE11.3, 0p 3f11.7, f7.2, 2f7.0)')
322 * eventno, inci.
p.code,
324 * inci.
p.fm.
e, -angle.r(1), -angle.r(2), -angle.r(3),
327 do i = 1, noofassites
329 write(fnob,
'("t ", i3, 2f7.1, 2f6.3, 332 * asdepthlist(i)*0.1, asobssites(i).mu,
333 * asobssites(i).age, asdepthlist(i)*0.1/cog2,
334 *
ng(i),
ne(i),
nmu(i), nhad(i),
335 * asobssites(i).esize, sumeloss(i)
338 if(fnob .gt. 0 )
then 343 #include "interfaceHENE.f" *Zfirst p fm *Zfirst p Zfirst p Zfirst p *Zfirst p *Zfirst pos xyz Zfirst pos xyz *Zfirst pos *Zfirst pos depth
subroutine cerrormsg(msg, needrtn)
subroutine cqincident(incident, AngleAtObs)
dE dx *! Nuc Int sampling table e
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 cmudedx(flagN, flagBr, flagPr, Emu, dEdx, dEdxF)
max ptcl codes in the kelec
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
********************block data cblkHeavy ********************integer j data *HeavyG2symbol p
subroutine copenfw2(io, fnin, form, icon)
subroutine cdedxinair(aPtcl, rhoin, dedt, dedtF)
block data cblkEvhnp ! currently usable models data RegMdls ad *special data *Cekaon d0
*Zfirst p fm *Zfirst p Zfirst p Zfirst p *Zfirst p *Zfirst pos xyz Zfirst pos xyz *Zfirst pos *Zfirst pos Zfirst pos height
latitude latitude this system is used *****************************************************************! type coord sequence union map real y
dE dx *! Nuc Int sampling table d
*Zfirst p fm *Zfirst p Zfirst p Zfirst p *Zfirst p charge
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 ! knockon is considered Obsolete *PhotoProd false
*Zfirst p fm *Zfirst p mass
max ptcl codes in the kmuon
! structure defining a particle at production ! Basic idea of what is to be contained in ! the particle structue is that dynamical ones should be included those derivable from the particle code ! is not included ******************************************************type fmom momentum sequence union map real e endmap map real * x
*Zfirst p fm *Zfirst p Zfirst p Zfirst p subcode