13 #include "Zmanagerp.h" 28 do while (icon .ne. 0)
33 if(fin .eq. 1)
goto 10
41 call cmkinc(incident, angle)
52 if(cutofffile .ne.
' ')
then 58 if(job .ne.
'newflesh')
then 62 eventsintherun = eventsintherun + 1
63 if(job .ne.
'flesh')
then 69 elseif( desteventno(2) .lt. 0 )
then 70 if(job .ne.
'newflesh')
then 71 eventsintherun = eventsintherun + 1
72 if(job .ne.
'flesh')
then 109 #include "Zglobalc.h" 114 #include "Zincidentp.h" 117 type(
track)::incident
122 real*8 len, cs, sn, sint, u, oa1, oa2
133 oa2 = imag_p(azimuth)
140 do while (cosx .gt. -ux)
142 call cuonsphere(1, polarinjpos%r(3), polarinjpos%r(1),
143 * polarinjpos%r(2), oa1, oa2, incident%pos%xyz)
147 call cuonsphere(2, polarinjpos%r(3), polarinjpos%r(1),
148 * polarinjpos%r(2), oa1, oa2, incident%pos%xyz)
157 if(za1ry .eq.
'is')
then 158 dir2%r(3) = -( (imag_p(
coszenith)-
real(CosZenith) )*u +
160 elseif(za1ry .eq.
'cos')
then 163 *
real(CosZenith), IMAG_P(
coszenith), dir2%r(3))
164 dir2%r(3) = -dir2%r(3)
169 *
' for ObsPlane=3 is invalid; must be: "is" or "cos"',0)
173 sint = sqrt(1.
d0-dir2%r(3)**2)
174 dir2%r(1) = - sint*cs
175 dir2%r(2) = - sint*sn
184 if(reverse .ne. 0)
then 186 dir2%r(1) = -dir2%r(1)
187 dir2%r(2) = -dir2%r(2)
188 dir2%r(3) = -dir2%r(3)
203 type(
ptcl)::incidentp
207 #if defined (KEKA) || defined (KEKB) 209 inc2%p%charge=incidentp%charge
210 inc2%p%subcode=incidentp%subcode
211 inc2%p%fm%p(4) = incidentp%fm%p(4)
212 inc2%p%mass = incidentp%mass
235 type(
track)::incident
245 subroutine cmkinc(incident, angle)
248 #include "Zglobalc.h" 255 #include "Zincidentp.h" 256 #include "Zincidentv.h" 259 type(
track)::incident
265 real*8 to100km, clenbetween2h, zenithcos, len
268 angleatobscopy = angle
269 if(reverse .ne. 0 )
then 272 angleatobscopy%r(i) = - angleatobscopy%r(i)
275 incident%p%charge = -incident%p%charge
276 if(incident%p%code .ne.
kgnuc)
then 277 incident%p%subcode = -incident%p%subcode
281 call ctransvectzx(1, detzaxis, detxaxis, angleatobscopy,
284 incident%pos%xyz%sys =
'xyz' 290 zenithcos = - angleatobscopy%r(3)
292 to100km = clenbetween2h(
293 * obssites(noofsites)%pos%radiallen + offsetheight,
294 * eradius + heightofinj, zenithcos )
301 upgoing = reverse .eq. 0 .and. zenithcos .lt. 0.
302 * .and. heightofinj .lt. obssites(noofsites)%pos%height
304 if(( reverse .eq. 0 .and. zenithcos .lt. 0.
305 * .and. heightofinj .gt. obssites(noofsites)%pos%height)
306 * .or. ( reverse .ne. 0 .and. zenithcos .gt. 0.))
then 310 * 2*(obssites(noofsites)%pos%radiallen + offsetheight)*
318 incident%pos%xyz%r(i) = obssites(noofsites)%pos%xyz%r(i)
319 * + offset%r(i) + to100km * dcatobsxyz%r(i)
335 elseif( obsplane .ne.
notused )
then 336 if( heightofinj .gt. obssites(i)%pos%height )
then 342 if(heightofinj .lt. borderheightl)
then 343 call cerrormsg(
'Injection height is < BorderHeightL',0)
345 incident%where = noofsites + 1
347 if(heightofinj .gt. borderheighth)
then 348 call cerrormsg(
'Injection height is > BorderHeightH',0)
353 incident%pos%colheight = infty
354 incidentcopy = incident
358 if(offsetheight .eq. 0. .and. obsplane .ne.
spherical)
then 359 if(zenithcos .ge. 0. .or. upgoing)
then 360 do i = 1, noofsites-1
362 * obssites(noofsites)%pos%radiallen,
363 * obssites(i)%pos%radiallen,
367 obssites(i)%pos%xyz%r(j) =
368 * obssites(noofsites)%pos%xyz%r(j)
369 * + len * dcatobsxyz%r(j)
373 do i = 1, noofassites-1
375 * asobssites(noofassites)%pos%radiallen,
376 * asobssites(i)%pos%radiallen,
379 asobssites(i)%pos%xyz%r(j) =
380 * asobssites(noofsites)%pos%xyz%r(j)
381 * + len * dcatobsxyz%r(j)
390 if(heightofinj .lt. borderheightl)
then 391 call cerrormsg(
'Injection height is < BorderHeightL',0)
410 #include "Zglobalc.h" 417 #include "Zincidentp.h" 418 #include "Zincidentv.h" 421 type(
track)::incident
424 incident%pos%xyz%sys =
'xyz' 429 call cgetzenith(incident, incident%vec%coszenith)
440 incident%pos%colheight = infty
441 incidentcopy = incident
456 #include "Zincidentp.h" 457 #include "Zincidentv.h" 472 * obssites(i)%pos%radiallen, from%vec%coszenith,
475 obssites(i)%minitime = leng
478 obssites(i)%minitime = 1.d10
489 #include "Zincidentv.h" 490 type(
track)::incident
491 type(
coord)::AngleAtObs
492 incident = incidentcopy
493 angleatobs = angleatobscopy
496 subroutine cuonsphere(ini, rin, teta, phi, oa1, oa2, pos)
498 #include "Zglobalc.h" 523 real*8 a(4, 4), b(4, 4), ba(4, 4)
528 r = rin *0.999999999
d0 536 fcos =
cos( min(oa2,180.
d0) * torad)
537 fcos = (
cos( min(oa1,180.
d0)*torad ) - fcos) * u + fcos
538 fsin = sqrt(1.
d0- fcos**2)
541 xyz%p(1) = r * (fsin *
cos(u))
542 xyz%p(2) = r * (fsin * sin(u))
557 #include "Zglobalc.h" 566 type(
coord)::angleatOb
569 real*8 p, rig, zen, azm, theta, prob, u
573 if(inc%p%charge .eq. 0)
then 576 if(rdatafmt .le. 4)
then 578 angleatob%r(1) = - angleatob%r(1)
579 angleatob%r(2) = - angleatob%r(2)
580 angleatob%r(3) = - angleatob%r(3)
582 call kdir2deg(angleatob%r(1), angleatob%r(2),
583 * angleatob%r(3), theta, azm)
590 azm = mod(azm+ xaxisfromsouth, 360.
d0)
591 if(zenvalue .eq.
'cos')
then 597 elseif(rdatafmt .eq. 5)
then 602 zen = atan2( inc%pos%xyz%r(3),
603 * sqrt(inc%pos%xyz%r(1)**2+inc%pos%xyz%r(2)**2) )
604 if(zenvalue .eq.
'cos')
then 610 azm = atan2(inc%pos%xyz%r(2), inc%pos%xyz%r(1))*todeg
612 call cerrormsg(
'dataformat for cut off invalid',0)
615 p = sqrt(inc%p%fm%p(4)**2 - inc%p%mass**2)
616 rig = p/abs(inc%p%charge)
617 call crigcut(azm, zen, rig, prob)
subroutine cerrormsg(msg, needrtn)
subroutine cmultrotmat4(a, b, c)
subroutine cqincident(incident, AngleAtObs)
subroutine csetmintime(from)
subroutine cuonsphere(ini, rin, teta, phi, oa1, oa2, pos)
! for length to thickness conversion or v v ! integer maxnodes real Hinf ! This is used when making table for dim simulation ! The slant length for vertical height to km is ! divided by LenStep m steps ! It can cover the slant length of about km for cos
max ptcl codes in the kgnuc
subroutine crigcut(azmin, zen, rig, prob)
subroutine cmkinc2(incident)
subroutine cresetprim2(incident)
subroutine cgetzenith(aTrack, cosz)
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 cgetrotmat4(m, ang, rm)
subroutine cmkincident(incident, fin)
subroutine cresetposang(incident)
subroutine csprimang(dir)
subroutine cmkinc(incident, angle)
subroutine ctranscoord2(sys, a, b)
block data cblkEvhnp ! currently usable models data RegMdls ad *special data *Cekaon d0
subroutine ctransvectzx(init, zax, xax, dir1, dir2)
subroutine capplyrot4(a, v, vn)
subroutine ctransvectz(zax, dir1, dir2)
subroutine c3dv2ddcos(a, b, len)
! constants thru Cosmos real * pi
subroutine csetdircos(dc, aTrack)
subroutine cinitracking(incident)
*Zfirst p fm *Zfirst p Zfirst p Zfirst p *Zfirst p *Zfirst pos xyz Zfirst pos xyz *Zfirst pos *Zfirst pos Zfirst pos *Zfirst pos *Zfirst Zfirst vec w *Zfirst vec w Zfirst vec coszenith
subroutine clenbetw2h(h1, h2, cost, leng, icon)
subroutine kcossn(cs, sn)
subroutine ksamplin(a, b, alpha, beta, x)
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
subroutine cresetprim(incidentp, angle)
subroutine csampprimary(p, fin)
! Zobs h header file for observation sites definition ! integer * perpendicular
subroutine kdir2deg(dx, dy, dz, theta, fai)
subroutine cifcutoff(icon)
subroutine csetpos(location)
subroutine cscalerprod(a, b, c)