COSMOS v7.655  COSMOSv7655
(AirShowerMC)
checknrfai.f
Go to the documentation of this file.
1 #include "../FleshHist/asinfo.f"
2 #include "../FleshHist/asdensity.f"
3 #include "Zmaxdef.h"
4 #include "../FleshHist/crecprob.f"
5 
6 ! read final .nrfai data and
7 ! see if the probabilty of recording partilces;
8 ! is it not too small or not too large ?
9  implicit none
10 #include "Zobs.h"
11 #include "../FleshHist/Zprivate0.h"
12  integer ndepth
13  parameter(ndepth= nsites)
14  real nrfaiRec0(nrbin, nfai, 4, ndepth)
15  real nrfaiAll0(nrbin, nfai, 4, ndepth)
16  real recprob(nrbin, 4, ndepth)
17 
18  integer EvNo0
19 
20  real limit(4), E0, Emin
21  real rat, all, rec, prob
22  integer klena
23  real intdep(ndepth)
24  integer nrbina, nfaia, ansites0
25  integer leng, i, j, k, l
26  integer i0, j0, k0, l0
27  integer NN
28  integer newfmt, maxsites, nr
29  integer icon0, iconx, icont
30  character*128 input0
31  real cosz, age, sum, Nx, depth
32  character*20 field(15)
33  real nptcls(nrbin, 4, ndepth)
34 ! limit= 5000.
35  e0=1.e8
36  cosz= 1.0
37  do while(.true.)
38  input0 = ' '
39  read( *, '(a)', end=1000 ) input0
40  if(input0 .ne. " ") then
41  call ksplit(input0, 20, 15, field, nr)
42  if(nr .eq. 8) then
43  read(input0(1:klena(input0)), *)
44  * evno0, e0,nn, cosz, limit(1), nrbina, nfaia, ansites0
45  maxsites = ansites0
46  emin=500.d-6
47  newfmt = 0
48  elseif(nr .eq. 9 ) then
49  read(input0(1:klena(input0)), *)
50  * evno0, e0,nn, cosz, limit(1), nrbina, nfaia, ansites0,
51  * maxsites
52  emin=500.d-6
53  newfmt = 1
54  elseif( nr .eq. 13) then
55  read(input0(1:klena(input0)), *)
56  * evno0, e0,nn, cosz, emin, nrbina, nfaia, ansites0,
57  * maxsites, limit
58  newfmt = 2
59  endif
60 
61  if(nrbina .ne. nrbin .or. nfaia .ne. nfai) then
62  write(0,*)' nrbina=',nrbina, 'or nfaia=',nfaia,
63  * ' differ from the def. in this prog'
64  stop 5555
65  endif
66 ! ********
67  do i = 1, ansites0
68  do j = 1, 4
69  do k= 1, nfai
70  read(*, '(3x, f7.1, 4i4)' )
71  * intdep(i), l0, i0, j0, k0
72  if(i0 .ne. i .or. j .ne. j0 .or. k .ne. k0) then
73  write(0,*) ' intdep, i0,j0,k0=',
74  * intdep(i), i0, j0, k0, ' strange'
75  stop 8888
76  endif
77 !
78  read(*, *)
79  * ( nrfairec0(l,k,j,i), l=1,nrbin )
80  enddo
81  enddo
82  enddo
83 ! ************
84  do i = 1, ansites0
85  do j = 1, 4
86  do k = 1, nfai
87  read(*, '(3x,f7.1, 4i4)' )
88  * intdep(i), l0, i0, j0, k0
89  if(i0 .ne. i .or. j .ne. j0 .or. k .ne. k0) then
90  write(0,*) ' intdep, i0,j0,k0=',
91  * intdep(i), i0, j0, k0, ' strange'
92  stop 9876
93  endif
94  read(*, *)
95  * ( nrfaiall0(l,k,j,i), l=1,nrbin )
96  enddo
97  enddo
98  enddo
99  else
100 ! 1 event read
101  if(newfmt .eq. 0) then
102  write(0, '(i2, 1pE11.3, 0pf7.1, 1pE11.3, 3i4)')
103  * evno0, e0,nn, cosz, limit(1), nrbina, nfaia, ansites0
104  elseif( newfmt .eq. 1) then
105  write(0, '(i2, 1pE11.3, 0pf7.1, 1pE11.3, 4i4)')
106  * evno0, e0,nn, cosz, limit(1), nrbina, nfaia, ansites0,
107  * maxsites
108  elseif( newfmt .eq. 2) then
109  write(0,
110  * '(i2, 1pE11.3, 0pf7.1, 1pE11.3, 4i4, 4f10.0)')
111  * evno0, e0,nn, cosz, emin, nrbina, nfaia, ansites0,
112  * maxsites, limit
113  endif
114  write(*,'(12a)') 'prob ', ' accpt ', ' accuracy ',
115  * ' rec', ' all', ' exp-all',
116  * ' dep ', ' code', ' fai',' r ',' age', ' dep'
117  do i = 1, ansites0
118  depth =intdep(i)
119  do j = 1, 4
120  do k = 1, nfaia
121  if(k .eq. 1) then
122  call crecprob(depth, j, limit,
123  * 360.0/nfai, e0,
124  * cosz, nrbin, recprob(1, j, i),
125  * nptcls(1, j, i), age, sum, nx)
126  endif
127 
128  do l = 1, nrbin
129  if( nrfaiall0(l, k, j, i) .gt. 0.) then
130  prob=recprob(l, j, i)
131  rec = nrfairec0(l,k,j,i)
132  all = nrfaiall0(l,k,j,i)
133  rat=rec/limit(j)
134  write(*,'(1p6E11.3,4i4, 0p,f7.3,f7.1)')
135  * prob, rec/all, rat, rec,
136  * all, nptcls(l, j, i), i,j,k,l, age, depth
137  endif
138  enddo
139  enddo
140  enddo
141  enddo
142  endif
143  enddo
144  1000 continue
145  write(0,*) 'all events processed '
146  end
integer npitbl real *nx parameter(n=101, npitbl=46, nx=n-1) real *8 uconst
subroutine ksplit(a, m, n, b, nr)
Definition: ksplit.f:2
*Zfirst p fm *Zfirst p Zfirst p Zfirst p *Zfirst p *Zfirst pos xyz Zfirst pos xyz *Zfirst pos *Zfirst pos depth
Definition: ZavoidUnionMap.h:1
nodes i
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
! timing nrbin
Definition: Zprivate2.h:12
********************block data cblkHeavy ********************integer j data *HeavyG2symbol *data *HeavyG2code kiron data j
Definition: cblkHeavy.h:36
subroutine crecprob(depthin, code, limit, dfai, E0in, NN, cosz, nr, recprob, nptcl, age, sum, Nx)
Definition: crecprob.f:3
dE dx *! Nuc Int sampling table d
Definition: cblkMuInt.h:130
integer function klena(cha)
Definition: klena.f:20
! timing nfai
Definition: Zprivate2.h:12