COSMOS v7.655  COSMOSv7655
(AirShowerMC)
clatDist.f
Go to the documentation of this file.
1 ! test cnkg and cmnkg
2 !
3 ! real*8 cnkg, s, r
4 ! s = 0.4
5 ! do while (s .lt. 1.8)
6 ! r = 0.01
7 ! do while (r .lt. 50.)
8 ! write(*, *) sngl(r), sngl(cnkg(s, r))
9 ! r = r * 10.**0.1
10 ! enddo
11 ! write(*, *)
12 ! s = s + 0.2
13 ! enddo
14 ! end
15 !
16 ! *****************************************************************
17 ! * *
18 ! * cnkg: lateral distribution of electrons by Greisen's formula *
19 ! * *
20 ! *****************************************************************
21 !
22 ! It is not recomended to use cnkg as it is, because it give too wide
23 ! lateral distribution. You must use about 1/2 Moliere Unit to get
24 ! rather good distribution.
25 !
26 
27 !
28 ! (time: if don't use polynomial approximation, it will be 1.9 times)
29 !
30  real*8 function cnkg(s, r)
31  implicit none
32  real*8 s ! input. age of shower (one dimensional age)
33  real*8 r ! input. distance from the center of shower. in moliere unit
34 ! function value. normalized number of electrons /(m.u)**2
35  ! (integral (nkg)*2pir*dr from 0 to infinity = 1 )
36 ! if s <=0 or s > 2.25, rho=0 is put
37 
38 !
39  real*8 cnkgcs
40 !
41  if(s .gt. 0. .and. s .lt. 2.25) then
42  cnkg = r**(s-2.) * (1.+r)**(s-4.5) * cnkgcs(s)
43  else
44  cnkg = 0.
45  endif
46  end
47  real*8 function cnkgcs(s)
48  implicit none
49 ! parameter (pi=3.1415, tpii=1./pi/2.)
50 ! csnkg=gma(4.5 - s)
51 ! * /gma(s)/gma(4.5-s*2) * tpii
52 ! polynom approx.
53 ! better than .05 % except s<.15 or s>2.0
54  real*8 s
55  real*8 temp
56  temp = (((((((-.4315466e-01*s+0.2827905 )*s-.5464292 )*s+
57  * .1768150 )*s+0.1253462 )*s+0.1909647 )*s+0.2234282 )*s-
58  * .1260477e-01)*s+0.7873029e-03
59  cnkgcs = temp/s
60  end
61 ! *****************************************************************
62 ! * *
63 ! * cmnkg: lateral distribution of electrons by pair electrons *
64 ! * created by m.c *
65 ! * *
66 ! *****************************************************************
67 !
68 !
69 
70 !
71 ! -- output --
72 !
73 ! *** note ***
74 ! if s < 0.6 or s > 2, nkg is used.
75 ! for 10000 call's in the mnkg region, 181 msec is needed on m380.
76 ! if polynomial approx for r0,rx,cs are not used, it becomes 400
77 ! msec.
78 !
79  real*8 function cmnkg(s, r)
80  implicit none
81  real*8 s ! input. 1 dim age.
82  real*8 r ! input. distance from the center of shower. in moliere unit
83 !
84 ! function value: normalized number of electrons /(m.u)**2
85 ! (integral (rho)*2pir*dr from 0 to infinity = 1 )
86 
87  real*8 a, b, r0, cs
88 !
89  call cmnkgcs(s, a, b, r0, cs)
90  cmnkg = (r/r0)**(s-a) * (1.+r/r0)**(s-b) *cs
91  end
92 ! ************************
93  subroutine cmnkgcs(s, a, b, r0, cs)
94  implicit none
95  real*8 s, a, b, r0, cs
96 !
97  real*8 cnkgcs, rx
98 
99  if(s .lt. .6 .or. s .gt. 2.) then
100 ! use nkg
101  cs = cnkgcs(s)
102  a = 2.
103  b = 4.5
104  r0 = 1.
105  else
106 ! tmp=(-3.309*log10(s) - .285)*log10(s) - .249
107 ! r0=10.**tmp
108 ! .1 % approx of r0 at s=(.4-2.0).
109  r0=(((((((0.2272372 *s-2.547489 )*s+ 12.33055 )*s-
110  * 33.50755)*s+ 55.33528 )*s-55.46729 )*s+ 30.93687 )*s-
111  * 7.405076 )*s+0.6610533
112 ! this give too large lateral for small s
113 ! rx=.29* s**1.415/r0
114 ! rx for m.c lateral (s=.4 to 2.) good within .2 %)
115 ! rx=((((((-.3179712 *s+ 2.959941 )*s-11.47338 )*s+
116 ! * 24.40712)*s-30.39885 )*s+ 22.81418 )*s-9.357027 )*s+
117 ! * 1.880529
118 !
119 ! corrected one. rx=.29*s**(1.40+.1/s**4)/r0 (s=.5 to 2.)
120  rx=(((((-.3310270 *s+ 2.953910)*s-10.35767)*s+
121  * 19.40102 )*s-19.71657 )*s+ 10.79047 )*s-2.225853
122  a=-.21*s + 2.146
123  b= (2*s+2.-a) + (s+2.-a)/rx
124 !
125 ! cs=gma(b-s)/gma(s+2.-a)/gma(a+b-2.-s*2)*tpii / r0**2
126 ! cs*s for m.c lateral (good at s=.4 to 2 within .3 %)
127  cs=((((((-.9450091 *s+ 8.993343 )*s-35.02486 )*s+
128  * 71.67270)*s-82.55823 )*s+ 56.46587 )*s-21.05954 )*s
129  * + 3.595105
130  cs = cs/s
131  endif
132  end
dE dx *! Nuc Int sampling table e
Definition: cblkMuInt.h:130
real *8 function cmnkg(s, r)
Definition: clatDist.f:80
real *8 function cnkg(s, r)
Definition: clatDist.f:31
subroutine cmnkgcs(s, a, b, r0, cs)
Definition: clatDist.f:94
real *8 function cnkgcs(s)
Definition: clatDist.f:48