COSMOS v7.655  COSMOSv7655
(AirShowerMC)
cprimAcceptance.f
Go to the documentation of this file.
1  subroutine cprimacceptance(
2  * comp, e_or_p, rigth, cos1, cos2, fai1, fai2, prob)
3 #include "Zglobalc.h"
4 #include "Zptcl.h"
5 #include "Zprimary.h"
6 
7  real*8 azmmin, azmmax, rig, cosx
8  logical degree, cosfactor
9  common /zpirmflux/ azmmin, azmmax, rig, cosx,
10  * degree, cosfactor
11 
12 
13  type(component)::comp ! input primary component
14  real*8 e_or_p ! input. E or p as given in primary file
15  real*8 rigth ! input. threshold rigidty below which geomagneic
16  ! effect appears. make it 0 if
17  ! no rigidity cut.
18  real*8 cos1, cos2 ! input. cos zenith range (cos1 < cos2)
19  real*8 fai1, fai2 ! input. azimuthal angle range (fai1< fai2) deg.
20  real*8 prob ! output. average prob. that the primary can come
21 
22  type(ptcl):: aptcl
23 !
24 
25  external crigfunc1
26  real*8 crigfunc1
27  real*8 error, ans
28 
29  integer icon
30  data eps/1.d-4/
31 
32 
33 
34  azmmin = fai1
35  azmmax = fai2
36  call cconv_prim_e(comp, e_or_p, aptcl)
37 ! rigidity
38  rig =
39  * sqrt( aptcl%fm%p(4)**2 - aptcl%mass**2 )/aptcl%charge
40 
41  if(rig .lt. rigth) then
42  call kdexpintf(crigfunc1, cos1, cos2, eps, ans, error, icon)
43  prob= ans/( (fai2-fai1) * (cos2 - cos1 )) ! fai is in deg. o.k
44  else
45  prob = 1.0
46  endif
47  end
48 ! ******************
49  real*8 function crigfunc1(zen)
50  implicit none
51 #include "Zglobalc.h"
52 #include "Zptcl.h"
53 #include "Zprimary.h"
54 
55  real*8 azmmin, azmmax, rig, cosx
56  logical degree, cosfactor
57  common /zpirmflux/ azmmin, azmmax, rig, cosx,
58  * degree, cosfactor
59 
60  real*8 zen
61 
62  real*8 ans
63 
64 
65  external crigfunc2
66  real*8 crigfunc2
67 
68 ! integrate over phi = azmmin, azmmax
69  cosx = zen
70  call k16pgaussleg(crigfunc2, azmmin, azmmax, 16, ans)
71  crigfunc1 = ans
72  if(cosfactor) then
73  crigfunc1 = crigfunc1 * cosx
74  endif
75  end
76 ! ******************
77  real*8 function crigfunc2(phi)
78  implicit none
79 #include "Zglobalc.h"
80 #include "Zptcl.h"
81 #include "Zprimary.h"
82  real*8 phi ! iput in degree
83 ! for fixed cos and phi; get R(theta, fai, rig)
84 
85  real*8 azmmin, azmmax, rig, cosx
86  logical degree, cosfactor
87  common /zpirmflux/ azmmin, azmmax, rig, cosx,
88  * degree, cosfactor
89 
90  real*8 temp
91 !
92  real*8 prob
93 !
94  if(degree) then
95  temp = acos(cosx)/torad
96  else
97  temp = cosx
98  endif
99  call crigcut(phi, temp, rig, prob)
100  crigfunc2 = prob
101  end
102 ! ***************************
103  subroutine csetcosdeg(cosin, degin)
104  implicit none
105  logical cosin, degin
106  real*8 azmmin, azmmax, rig, cosx
107  logical degree, cosfactor
108  common /zpirmflux/ azmmin, azmmax, rig, cosx,
109  * degree, cosfactor
110 
111  cosfactor = cosin
112  degree = degin
113  end
subroutine crigcut(azmin, zen, rig, prob)
Definition: crigCut.f:6
subroutine cconv_prim_e(comp, e_or_p, aPtcl)
Definition: csampPrimary.f:128
subroutine csetcosdeg(cosin, degin)
real *8 function crigfunc2(phi)
subroutine kdexpintf(func, a, b, eps, ans, error, icon)
Definition: kdexpIntF.f:55
subroutine k16pgaussleg(func, a, b, n, ans)
Definition: k16pGaussLeg.f:20
dE dx *! Nuc Int sampling table d
Definition: cblkMuInt.h:130
Definition: Zptcl.h:75
subroutine cprimacceptance(comp, e_or_p, rigth, cos1, cos2, fai1, fai2, prob)
real *8 function crigfunc1(zen)