COSMOS v7.655  COSMOSv7655
(AirShowerMC)
crecprob.f
Go to the documentation of this file.
1  subroutine crecprob(depthin, code, limit, dfai, E0in, NN, cosz,
2  * nr, recprob, nptcl, age, sum, Nx)
3  implicit none
4 !
5 ! compute probabilty that we accept observed particles
6 ! which fall in at Moliere unit r and r+dr with dfai
7 ! azimuthal angle range; the probabilty is determined
8 ! so that the maximumk number may not exceed 'limit'
9 ! in each region.
10 ! This is based on 10^18 eV shower.
11 !
12  real depthin ! input g/cm^2
13  integer code ! input gamma-1, e-2, mu-3, had-4
14  real limit ! input max number of particls to be recorded
15  ! in actual simulation run.
16  integer nr ! input number of r bin; 42. is standard
17  ! r is digitized from r1=0.01 (m.u) with 0.1 log10
18  ! bin.
19  real dfai ! input fai angle (deg) bin. 30 is standard
20  real E0in ! input primary total energy in GeV.
21  integer NN ! input primary nucleon number.
22  real cosz ! input primary zenith angle in cosine
23  real recprob(nr) ! ouput. probability to record particles
24  ! at r (at depth) in dfai region. if >1.
25  ! accept always
26  real nptcl(nr) ! output. average number of particles falling
27  ! on the given band region.
28  real age ! output. given depth is at age
29 
30  real sum ! output sum of particles
31  real Nx ! output number of particles at depth (Nx ~ sum)
32 
33  integer idep, ir
34  real r1, r2, A, s, r
35  real sizex, asdensity, rho, n
36  real pi, fita, fitb, fitc
37  real eps, depth, E0, fac
38  real cogdep, dep2cogdep, cogdep2s
39 !
40  pi=3.141592
41  sum = 0.
42  if(nn .ge. 1) then
43  e0=e0in/nn
44  fac = nn
45  else
46 ! to be updateded
47  e0 = e0in
48  fac = 1
49  endif
50  depth = depthin/cosz
51  cogdep = dep2cogdep(e0in, nn, depth)
52  s = cogdep2s(e0in, nn, cogdep)
53  nx = sizex(e0in, nn, code, s)
54  r1 = 0.01/10**0.05
55  do ir=1, nr
56  r2=r1*10.**0.1
57  a = pi*(r2**2- r1**2)*dfai/360.
58  r = sqrt(r1*r2)
59  rho=asdensity(e0, code, s, r)
60  n= nx*rho*a
61  nptcl(ir)=n
62  sum = sum + n
63  eps =limit/n
64  recprob(ir)= eps
65  r1= r2
66  enddo
67  age = s
68  end
subroutine crecprob(depthin, code, limit, dfai, E0in, NN, cosz, nr, recprob, nptcl, age, sum, Nx)
Definition: crecprob.f:3