9 #include "Zincidentv.h" 28 real*8 leng, dedt, cosfromaxis
31 logical cross, seeupper
42 real*8 dummylen, r0, rp, obsrl, cosp, dt2, m2
48 loc = trackbefmove%where
50 if(intinfarray(processno)%length .gt. 0. )
then 53 * movedtrack%pos%xyz, diffvec)
56 if( obsplane .ne.
notused )
then 60 call cifxhorizon(diffvec, unitv, cross, leng, seeupper)
66 intinfarray(processno)%length = leng
67 intinfarray(processno)%thickness = clen2thick(
68 * trackbefmove%pos%radiallen - eradius,
69 * trackbefmove%vec%coszenith, leng)
72 movedtrack%vec%w = unitv
89 movedtrack%where = nextwhere
91 movedtrack%where = loc
96 if(movedtrack%p%charge /= 0)
then 99 call cqelossrate(dedt, dedtf)
100 energyloss = dedt * intinfarray(processno)%thickness
101 movedtrack%p%fm%p(4) = trackbefmove%p%fm%p(4)-energyloss
105 energyloss = trackbefmove%p%fm%p(4)- movedtrack%p%fm%p(4)
113 movedtrack%where = loc
117 subroutine cifxhorizon(diffvec, unitv, cross, leng, seeupper)
122 #include "Zincidentv.h" 134 logical cross, seeupper
141 real*8 dummylen, r0, rp, obsrl, cosp, dt2, m2
145 loc = trackbefmove%where
147 r0 = obssites(loc)%pos%radiallen
148 rp = trackbefmove%pos%radiallen
150 if(dt2 .lt. 0.
d0)
then 151 if(dt2 .lt. -1.
d0)
then 152 write(0,*)
' loc =',loc,
' r0=',r0,
' rp=',rp,
153 *
' dt2=',dt2,
' code=',trackbefmove%p%code,
154 *
' rp%h=', trackbefmove%pos%height,
155 * obssites(loc)%pos%height
156 call cerrormsg(
'position info invalid',0)
163 call c3dv2ddcos(trackbefmove%pos%xyz, unitp, dummylen)
166 seeupper = cosp .le. 0
169 seeupper = cosp**2 .le. coscr2
173 if(.not. seeupper )
then 174 if(movedtrack%pos%radiallen .le. r0)
then 187 if(movedtrack%pos%radiallen .ge.
188 * obssites(loc-1)%pos%radiallen)
then 199 obsrl = obssites(loc-1 )%pos%radiallen
200 if(loc .eq. 1) movestat=
borderh 202 obsrl = obssites(loc)%pos%radiallen
203 if(loc .eq. noofsites+1 )
then 209 if(rp .gt. obsrl )
then 210 leng = -r0r - sqrt(r0r**2 -
213 leng = -r0r + sqrt(r0r**2 -
214 * (rp**2 - obsrl**2))
216 leng = leng + 0.001
d0 219 subroutine cifxperpen(unitv, cross, leng, seeupper)
224 #include "Zincidentv.h" 234 logical cross, seeupper
236 real*8 clen2thick, cosfromaxis, leng2
244 loc = trackbefmove%where
251 call cxyz2prim(obssites(noofsites)%pos%xyz,
252 * movedtrack%pos%xyz, xyz2)
253 call cxyz2prim(obssites(noofsites)%pos%xyz,
254 * trackbefmove%pos%xyz, xyz1)
260 seeupper = cosfromaxis .le. 0.
261 if(.not. seeupper)
then 263 if( loc .gt. noofsites )
then 264 if( movedtrack%pos%height .le. borderheightl )
then 267 movedtrack%where = noofsites+1
269 elseif( movedtrack%pos%height .ge. borderheighth )
then 276 if(xyz1%r(3) .gt. obssites(loc)%zpl .and.
277 * xyz2%r(3) .le. obssites(loc)%zpl)
then 279 elseif( movedtrack%pos%height .le. borderheightl )
then 283 movedtrack%where = noofsites + 1
284 elseif( movedtrack%pos%height .ge. borderheighth )
then 294 if( movedtrack%pos%height .ge. borderheighth )
then 299 elseif(movedtrack%pos%height .le. borderheightl )
then 302 movedtrack%where = noofsites+1
306 if(xyz1%r(3) .lt. obssites(loc-1)%zpl .and.
307 * xyz2%r(3) .ge. obssites(loc-1)%zpl )
then 309 elseif( movedtrack%pos%height .ge. borderheighth )
then 314 elseif( movedtrack%pos%height .le. borderheightl )
then 318 movedtrack%where = noofsites + 1
328 if(.not. cross )
then 332 elseif( cross .and. movestat .eq.
borderl )
then 335 * trackbefmove%pos%xyz%r(1), trackbefmove%pos%xyz%r(2),
336 * trackbefmove%pos%xyz%r(3),
337 * unitv%r(1), unitv%r(2), unitv%r(3),
338 * borderheightl+eradius, leng, icon)
344 elseif( cross .and. movestat .eq.
borderh )
then 347 * trackbefmove%pos%xyz%r(1), trackbefmove%pos%xyz%r(2),
348 * trackbefmove%pos%xyz%r(3),
349 * unitv%r(1), unitv%r(2), unitv%r(3),
350 * borderheighth+eradius, leng, icon)
360 leng = (obssites(loc-1)%zpl - xyz1%r(3))/dircos%r(3)
362 leng = (obssites(loc)%zpl - xyz1%r(3))/dircos%r(3)
371 if( movedtrack%pos%height .gt. borderheightl .and.
372 * movedtrack%pos%height .lt. borderheighth )
then 376 elseif( movedtrack%pos%height .ge. borderheighth )
then 380 * trackbefmove%pos%xyz%r(1), trackbefmove%pos%xyz%r(2),
381 * trackbefmove%pos%xyz%r(3),
382 * unitv%r(1), unitv%r(2), unitv%r(3),
383 * borderheighth+eradius, leng2, icon)
387 if( leng2 .lt. leng )
then 391 elseif( movedtrack%pos%height .le. borderheightl )
then 395 * trackbefmove%pos%xyz%r(1), trackbefmove%pos%xyz%r(2),
396 * trackbefmove%pos%xyz%r(3),
397 * unitv%r(1), unitv%r(2), unitv%r(3),
398 * borderheightl+eradius, leng2, icon)
402 if( leng2 .lt. leng )
then 408 write(0, *)
'logic error' 423 diff%r(i) = r2%r(i) - r1%r(i)
426 subroutine cxplsph(x0, y0, z0, l, m, n, r, el, icon)
443 rsqr = x0**2 + y0**2 + z0**2 -r**2
444 if(rsqr .le. 0.)
then 450 r0l = x0*l + y0*m + z0*n
469 if(icon2 .eq. 0)
then 471 elseif(icon1 .eq. 0)
then subroutine cerrormsg(msg, needrtn)
subroutine cxplsph(x0, y0, z0, l, m, n, r, el, icon)
subroutine cifxhorizon(diffvec, unitv, cross, leng, seeupper)
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 cxyz2prim(base, a, b)
block data cblkEvhnp ! currently usable models data RegMdls ad *special data *Cekaon d0
subroutine cifxperpen(unitv, cross, leng, seeupper)
subroutine cifxobssite(nextwhere)
subroutine cresetmombyedir(aTrack)
subroutine c3dv2ddcos(a, b, len)
subroutine cxyz2primd(a, b)
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 cmovestreight(leng, dir)
subroutine cdiffvec(r1, r2, diff)
! Zobs h header file for observation sites definition ! integer * perpendicular
subroutine cscalerprod(a, b, c)