COSMOS v7.655  COSMOSv7655
(AirShowerMC)
asdensity.f
Go to the documentation of this file.
1 !c test asdensity
2 ! real r, s(10), den
3 ! real asdensity
4 ! integer code
5 ! integer ir, i, pw
6 !
7 ! do while (.true.)
8 ! write(0,*) 'enter code '
9 ! read(*,*) code
10 ! do i= 1, 10
11 ! s(i) = 0.
12 ! enddo
13 ! if(code .eq. 3) then
14 ! write(0,*) 'enter depth/cog upto 10 with /'
15 ! pw=2
16 ! else
17 ! write(0,*) 'enter ages upto 10 with /'
18 ! pw=3
19 ! endif
20 ! read(*,*) s
21 !
22 ! do i = 1, 10
23 ! if(s(i) .gt. 0.) then
24 ! r= 0.01
25 ! do ir = 1, 42
26 ! den=asdensity(1.e9, code, s(i), r)
27 ! write(*,*)
28 ! * r, den*2*3.1415*r**pw
29 ! r= r*10.**0.1
30 ! enddo
31 ! write(*,*)
32 ! endif
33 ! enddo
34 ! enddo
35 ! end
36  real function asdensity(E0, code, age, r)
37  implicit none
38 !
39 ! air shower particle density /m.u^2 for vertical shower
40 !
41  real E0 ! input. primary proton total E in GeV. not used
42 
43  integer code ! input particle code. 1---> gamma
44  ! 2---> electron
45  ! 3---> muon
46  ! 4---> hadrons
47 
48  real age ! input age of the shower.
49 !
50  real r ! input. core distance in Moliere unit.
51  ! measured at 2 r.l above the observation
52  ! point along the shower axis.
53 !
54  real a, b, c, d, x
55  real ag1, bg1, cg1, dg1
56  real ag2, bg2, cg2, dg2
57  real ae1, be1, ce1, de1
58  real ae2, be2, ce2, de2
59  real am, bm, cm, dm
60  real s, f, rr
61  real twopi
62  real y, s2cogdep
63  parameter(twopi=2*3.141592)
64 ! for gamma all r
65 ! a b c
66 !
67  ag1(s)= 8.610*s**(-1.585)
68  bg1(s) =3.4716*s**(-0.640)
69  cg1(s) = -0.41456*s*s + 0.9951*s -0.1680515
70  dg1(s) = 0.47598*s*s -1.5426*s + 0.798
71 ! e r<2
72  ae2(s) = 82.66*s**2.433
73  be2(s) = 6.130*s**0.1376
74  ce2(s) = 0.39671*s**(-0.29685)
75  de2(s) = -(0.50456*s**2.05154)
76 ! e r>1
77  ae1(s) =0.18857*s**2.2397
78  be1(s) =0.1144*s**2.1224
79  ce1(s) =0.94314*s**(-0.59357)
80  de1(s) = 2.0624*s**(-0.69654)
81 ! mu all r
82  am(y) = 0.77492* y**(-1.804)
83  bm(y) = 1.24209* y**(-0.7329)
84  cm(y) = 0.56881* y**0.156110
85  dm(y) = -0.4031*y** 0.781031
86 !
87  x = age
88  if(code .eq. 1) then
89  a=ag1(x)
90  b=bg1(x)
91  c=cg1(x)
92  d=dg1(x)
93  elseif(code .eq. 2) then
94  if(r .gt. 1.5) then
95  a=ae1(x)
96  b=be1(x)
97  c=ce1(x)
98  d=de1(x)
99  else
100  a=ae2(x)
101  b=be2(x)
102  c=ce2(x)
103  d=de2(x)
104  endif
105  elseif(code .le. 6) then
106  y = s2cogdep(e0, x)
107  a=am(y)
108  b=bm(y)
109  c=cm(y)
110  d=dm(y)
111  else
112  write(0,*) ' exor code for asdensity'
113  stop 9753
114  endif
115  rr=max(r, 0.01)
116  f = a*exp(-b*rr**c) / rr**d
117  asdensity = f/twopi/rr
118  end
integer npitbl real *nx parameter(n=101, npitbl=46, nx=n-1) real *8 uconst
real function asdensity(E0, code, age, r)
Definition: asdensity.f:37