COSMOS v7.655  COSMOSv7655
(AirShowerMC)
getST.f
Go to the documentation of this file.
1 #include "BlockData/cblkGene.h"
2  implicit none
3 #include "Zglobalc.h"
4 #include "Zmanagerp.h"
5 #include "ZrigCut.h"
6 #include "Zptcl.h"
7 #include "Zobs.h"
8 #include "Zobsp.h"
9 #include "Zprimary.h"
10 #include "Zprimaryc.h"
11 #include "Zprimaryv.h"
12 #include "Zincidentp.h"
13 #ifdef NEXT486
14 #define IMAG_P dimag
15 #else
16 #define IMAG_P imag
17 #endif
18 
19 
20  integer i
21 
22  real*8 cosmin, cosmax
23  real*8 ans, sum
24 
25  real*8 azmmin, azmmax, zen1, zen2, rigc
26  type(component)::compx
27  common/zgetst/compx, zen1, zen2, azmmin, azmmax, rigc
28 
29  call creadparam(5)
30  call cbeginrun
31  call cprintprim(errorout)
32  cosmax = imag_p(coszenith)
33  cosmin = real(coszenith)
34  azmmax = imag_p(azimuth) + xaxisfromsouth
35  azmmin = real(Azimuth) + XaxisFromSouth
36  if(cutofffile .eq. ' ') then
37  rigc = 0.
38  call csetcosdeg(.true., .false.)
39  else
40  rigc = 100.
41  if(zenvalue .eq. 'deg') then
42  call csetcosdeg(.true., .true.)
43  else
44  call csetcosdeg(.true., .false.)
45  endif
46  endif
47  zen1 = cosmin
48  zen2 = cosmax
49 
50  write(*,*) ' primary Int(cos x dI/dE) sum(cumlative)'
51  sum = 0.
52  do i = 1, prim%no_of_comps
53  call inteflux(prim%each(i), ans)
54  sum = sum +
55  * ans * (cosmax-cosmin)*abs((azmmax-azmmin)*torad)
56  write(*,*)' ', prim%each(i)%symb,' ', sngl(ans),
57  * ' ', sngl(sum)
58  enddo
59  write(*,*)
60  * 'If N primaries are generated in simulation, ST= N/sum'
61  end
62 ! ******************
63  subroutine inteflux(comp, ans)
64  implicit none
65 #include "Zptcl.h"
66 #include "Zprimary.h"
67  type(component):: comp
68  real*8 ans
69 
70  real*8 azmmin, azmmax, zen1, zen2, rigc
71  type(component)::compx
72  common/zgetst/compx, zen1, zen2, azmmin, azmmax, rigc
73 
74 
75  real*8 eps, error, ans2, Eth, e_or_p
76  integer icon
77 
78 
79  integer imax
80  external primdn
81  real*8 primdN
82  type(ptcl)::aptcl
83  integer j
84  data eps/1.d-4/
85 
86 ! take into account the horizontal area.
87 
88  compx = comp
89  imax = comp%no_of_seg
90  if(rigc .eq. 0.) then
91 ! no rigidy cut. integrate segmented power functions
92  call inteprim2(comp, 1, imax, ans)
93  else
94  call cmkptc(comp%code, comp%subcode, comp%charge, aptcl)
95  eth =sqrt( (rigc*comp%charge)**2 + aptcl%mass**2 )
96  call cconv_prim_e2(comp, eth, e_or_p)
97  call kdwhereis(e_or_p, comp%no_of_seg+1, comp%energy, 1, j)
98  if(j .le. imax) then
99  call kdexpintfb(primdn, comp%energy(1), comp%energy(j+1),
100  * eps, ans, error, icon)
101 ! add E> comp.energy(j+1)
102  endif
103  if(j+1 .lt. imax ) then
104  call inteprim2(comp, j+1, imax, ans2)
105  else
106  ans2 = 0.
107  endif
108  ans = ans + ans2
109  endif
110  end
111 
112 ! ****************************
113  real*8 function primdn(E)
114  implicit none
115 
116 #include "Zglobalc.h"
117 #include "Zptcl.h"
118 #include "Zprimary.h"
119 ! primary flux at E
120  real*8 E
121 
122  real*8 azmmin, azmmax, zen1, zen2, rigc
123  type(component)::compx
124  common/zgetst/compx, zen1, zen2, azmmin, azmmax, rigc
125 
126  real*8 flux
127  call cprimflux(compx, e, rigc, zen1, zen2, azmmin,
128  * azmmax, flux)
129  primdn = flux
130  end
131  subroutine inteprim2(comp, i1, i2, ans)
132  implicit none
133 #include "Zptcl.h"
134 #include "Zprimary.h"
135 ! primary flux at E
136  type(component)::comp
137  integer i1, i2
138  real*8 ans
139 
140  real*8 sum, beta
141 
142  integer i
143  sum = 0.
144 
145  do i = i1, i2
146  beta=comp%beta(i)
147  if(beta .ne. 1.) then
148  sum = sum +
149  * comp%flux(i)*comp%energy(i)
150  * / (beta - 1.)
151  * *( 1. -
152  * (comp%energy(i+1)/comp%energy(i))**(1.-beta))
153  else
154  sum =
155  * sum + comp%flux(i)* comp%energy(i)
156  * * log(comp%energy(i+1)/comp%energy(i))
157  endif
158  enddo
159  ans = sum
160  end
161  subroutine chooktrace
162  end
163  subroutine chookceren
164  end
165  subroutine chookcerens
166  end
167  subroutine chookcerene
168  end
169  subroutine chookbgrun
170  end
real zen2
Definition: Zflux.h:1
real *8 function primdn(eorp)
Definition: getST.f:246
subroutine cprimflux(comp, e_or_p, rigth, cos1, cos2, fai1, fai2, flux)
Definition: cprimFlux.f:4
real zen1
Definition: Zflux.h:1
atmos%rho(atmos%nodes) **exp(-(z-atmos%z(atmos%nodes))/Hinf) elseif(z .lt. atmos%z(1)) then ans=atmos%rho(1) **exp((atmos%z(1) -z)/atmos%H(1)) else call kdwhereis(z, atmos%nodes, atmos%z, 1, i) a=atmos%a(i) if(a .ne. 0.d0) then ans=atmos%rho(i) **(1+a *(z-atmos%z(i))/atmos%H(i)) **(-1.0d0-1.d0/a) else ans=*atmos%rho(i) *exp(-(z-atmos%z(i))/atmos%H(i)) endif endif ! zsave=z ! endif cvh2den=ans end ! ---------------------------------- real *8 function cvh2temp(z) implicit none ! vettical height to temperatur(Kelvin) real *8 z ! input. vertical height in m ! output is temperature of the atmospher in Kelvin real *8 ans integer i if(z .gt. atmos%z(atmos%nodes)) then ans=atmos%T(atmos%nodes) elseif(z .lt. atmos%z(1)) then ans=atmos%T(1)+atmos%b(1) *(z - atmos%z(1)) else call kdwhereis(z, atmos%nodes, atmos%z, 1, i) ans=atmos%T(i)+atmos%b(i) *(z-atmos%z(i)) endif cvh2temp=ans end !--------------------------------------------- real *8 function cthick2h(t) implicit none real *8 t ! input. air thickness in kg/m^2 real *8 logt, ans integer i real *8 dod0, fd, a logt=log(t) if(t .ge. atmos%cumd(1)) then ans=atmos%z(1) - *(logt - atmos%logcumd(1)) *atmos%H(1) elseif(t .le. atmos%cumd(atmos%nodes)) then ans=atmos%z(atmos%nodes) - *Hinf *log(t/atmos%cumd(atmos%nodes)) else call kdwhereis(t, atmos%nodes, atmos%cumd, 1, i) ! i is such that X(i) > x >=x(i+1) ans
nodes i
subroutine cconv_prim_e2(comp, E, e_or_p)
Definition: csampPrimary.f:230
subroutine kdwhereis(x, in, a, step, loc)
Definition: kdwhereis.f:27
real * azmmin
Definition: Zflux.h:1
block data cblkElemag data *AnihiE ! Eposi< 1 TeV, anihilation considered *X0/365.667/, ! radiation length of air in kg/m2 *Ecrit/81.e-3/, ! critical energy of air in GeV *MaxComptonE/1./, ! compton is considered below 1 GeV *MaxPhotoE/1.e-3/, ! above this, PhotoElectric effect neg. *MinPhotoProdE/153.e-3/, ! below 153 MeV, no gp --> hadrons ! scattering const not MeV *Knockon true
Definition: cblkElemag.h:7
subroutine cprintprim(out)
Definition: cprintPrim.f:3
subroutine csetcosdeg(cosin, degin)
subroutine chookceren
Definition: det2Exyz.f:63
real rigc
Definition: Zflux.h:1
subroutine creadparam(io)
Definition: creadParam.f:5
subroutine chooktrace
Definition: chook.f:275
subroutine kdexpintfb(func, a, b, eps, ans, error, icon)
Definition: kdexpIntFb.f:10
subroutine chookcerene
Definition: det2Exyz.f:67
dE dx *! Nuc Int sampling table d
Definition: cblkMuInt.h:130
*Zfirst p fm *Zfirst p Zfirst p Zfirst p *Zfirst p *Zfirst pos xyz Zfirst pos xyz *Zfirst pos *Zfirst pos Zfirst pos *Zfirst pos *Zfirst Zfirst vec w *Zfirst vec w Zfirst vec coszenith
Definition: ZavoidUnionMap.h:1
subroutine chookcerens(no, primary, angle)
Definition: ctemplCeren.f:19
subroutine inteprim2(comp, i1, i2, ans)
Definition: intePrim2.f:2
subroutine inteflux(comp, ans)
Definition: getST.f:150
block data cblkElemag data *AnihiE ! Eposi< 1 TeV, anihilation considered *X0/365.667/, ! radiation length of air in kg/m2 *Ecrit/81.e-3/, ! critical energy of air in GeV *MaxComptonE/1./, ! compton is considered below 1 GeV *MaxPhotoE/1.e-3/, ! above this, PhotoElectric effect neg. *MinPhotoProdE/153.e-3/, ! below 153 MeV, no gp --> hadrons ! scattering const not MeV *Knockon ! knockon is considered Obsolete *PhotoProd false
Definition: cblkElemag.h:7
subroutine cmkptc(code, subcode, charge, p)
Definition: cmkptc.f:15
real azmmax
Definition: Zflux.h:1
Definition: Zptcl.h:75
subroutine cbeginrun
Definition: cbeginRun.f:7
subroutine chookbgrun
Definition: chook.f:15