COSMOS v7.655  COSMOSv7655
(AirShowerMC)
cexcessLen.f File Reference

Go to the source code of this file.

Functions/Subroutines

subroutine cexcesslen (dx, dy, dt)
 

Function/Subroutine Documentation

◆ cexcesslen()

subroutine cexcesslen ( real*8  dx,
real*8  dy,
real*8  dt 
)

Definition at line 19 of file cexcessLen.f.

References e, and rndc().

Referenced by cputdeflection().

19 !
20  implicit none
21 !---- include '../Ztrack.h'
22 #include "Ztrack.h"
23 !---- include '../Ztrackv.h'
24 #include "Ztrackv.h"
25 !---- include 'Zelemagp.h'
26 #include "Zelemagp.h"
27 !
28  real*8 dx, dy ! small dispalcement by scattering and geomag effect.
29 ! this treatment valid for only scattering displacement, but
30 ! for small displacement, we may add geomag. effect too.
31 !
32  real*8 dt ! output in m (not devided by beta)
33  real*8 tmp, ee1, rr2, rp2, t, tang, tang1, za, za2
34  real*8 dtp, en, u, g, al, tt, reall2, ge, reall
35 !
36 !
37  real*8 dtp0/.12/ ! dtp at rp2=0
38  real*8 cthick2den
39 !
40  if(dx .eq. 0. .and. dy .eq. 0.) then
41  dt = 0.
42  else
43  za = trackbefmove%pos%depth
44  za2 = movedtrack%pos%depth
45  ee1 = trackbefmove%p%fm%p(4)
46  reall = intinfarray(processno)%length
47  t = intinfarray(processno)%thickness/x0 ! r%l travelled
48 
49  tmp=(es/ee1)**2*cthick2den(.6666*za+ .3333*za2 )/x0
50 !
51  rr2 = dx**2 + dy**2
52  rp2 = rr2/tmp/reall**3
53 ! get coefficient for straight line for rp2 vs dtp
54 ! (average relation)
55 ! get tangent
56 
57  if(ee1 .gt. 500.e-3) then
58  if(t .gt. 0.3) then
59  tang=(0.49/(za+.1) + .053)*t + 1.13
60  else
61  tang=0.33 *t + 1.05
62  endif
63  else
64  tang1=4.37e-2/ee1 + 1.3e-2
65  tang=tang1*t+ 1.05
66  endif
67 !
68 ! get <dtp>
69  dtp=tang*rp2+dtp0
70 ! get n for
71 ! dtp(>tt)/dtp(all)= tt**n/( .7544+tt**n)
72 ! this dtp is normalized by <dtp>
73  en=19.375*rp2 +3.531
74 ! dtp= t**en/(beta+t**en) is a first good approximation
75 ! which is solved for uniform random # as
76 ! t=( beta*u/(1-1))**(1/en). at small u,
77 ! t is under estimated so that it's correction is needed.
78 ! sample dtp ( <> normailzed )
79  call rndc(u)
80  if(u .lt. .3) then
81 ! g= (1.35-1.15)/6.5 * (en-10.)+ 1.35 =
82  g= 3.077e-2*en +1.042
83  al= ((3.33- 3.33/g)*u+1./g)/en
84  else
85  al=1./en
86  endif
87 
88  tt=( 0.7544*u/(1.-u) )** al
89 ! convert to dt (in m)
90  reall2=reall**2
91  dt=dtp*tmp*reall2/2
92 ! it should be > sqrt(reall**2 + r**2) -reall
93 ! it may happen not so due to some approximation
94  ge = sqrt(reall2 + rr2) -reall
95  dt = max(ge, dt)
96  endif
dE dx *! Nuc Int sampling table e
Definition: cblkMuInt.h:130
integer npitbl real *nx dx real dx
Definition: Zcinippxc.h:10
subroutine rndc(u)
Definition: rnd.f:91
real(4), save al
Definition: cNRLAtmos.f:22
real(8) function cthick2den(t)
Definition: cNRLAtmos.f:591
dE dx *! Nuc Int sampling table g
Definition: cblkMuInt.h:130
nodes t
Here is the call graph for this function:
Here is the caller graph for this function: