2 #include "./realLimit.h" 22 #include "../FleshHist/asinfo.f" 23 #include "../FleshHist/asdensity.f" 24 #include "../FleshHist/crecprob.f" 28 #include "../FleshHist/Zprivate0.h" 29 #include "../FleshHist/Zprivate1.h" 30 #include "../FleshHist/Zprivate3.h" 33 *
charge, ridx, faiidx, codex
48 real recprob(
nrbin, 4, ndepth)
49 character*20 field(15)
51 integer l0(ndepth), recl0(ndepth)
55 real intdep(ndepth), recdep(ndepth)
59 integer nrbina, nfaia, ansites0
60 integer leng, i, j, k, l, leng2, lengh
62 integer i0, j0, k0, reci0, recj0, reck0
64 integer icon0, iconx, icont
66 character*100 nrfaifile, nrfaifile2, datfile, datfile2
70 integer fnonrfai, fnonrfai2, fnodat2
71 real cosz, age, sum, Nx, depth, wgt, wwgt, prob
72 real nptcls(
nrbin, 4, ndepth)
73 integer indivdep(ndepth), packeddepidx(ndepth), depidx
75 integer icon, kgetenv2, nrec
76 logical SeeLowdE, accept
85 write(0,*)
"Env. NRFAIFILE not given" 88 call copenfw2(fnonrfai, nrfaifile, 1, icon)
90 write(0,*)
' error cannot open', nrfaifile
95 write(0,*)
' SeeLowdE not given' 98 seelowde = datfile(1:
leng) .eq.
"yes" 100 leng2 =
kgetenv2(
"DATFILE", datfile)
101 if(leng2 .le. 0)
then 102 write(0,*)
"Env. DATFILE not given" 105 call copenfw2(fnodat, datfile, 2, icon)
107 write(0,*)
' input main data not exist' 108 write(0,*)
' file=',datfile
113 datfile2 = datfile(1:leng2)//
"-r" 115 nrfaifile2 = datfile(1:leng2-3)//
"nrfai-r" 116 call copenfw2(fnonrfai2, nrfaifile2, 1, icon)
118 write(0,*)
' error ', nrfaifile2,
' cannot be created' 128 rnrfairec(
i, l,
j, k)=0
136 read(fnonrfai,
'(a)', end=1000 ) input0
137 if(input0 .ne.
" ")
then 138 call ksplit(input0, 20, 15, field, nr)
140 read(input0(1:
klena(input0)), *)
141 * evno0, e0,nn, cosz, limit(1), nrbina, nfaia, ansites0
145 elseif(nr .eq. 9 )
then 146 read(input0(1:
klena(input0)), *)
147 * evno0, e0,nn, cosz, limit(1), nrbina, nfaia, ansites0,
151 elseif(nr .eq. 13)
then 152 read(input0(1:
klena(input0)), *)
153 * evno0, e0,nn, cosz, emin, nrbina, nfaia, ansites0,
157 write(0,*)
' header fmt strage ' 164 if(nrbina .ne.
nrbin .or. nfaia .ne.
nfai)
then 165 write(0,*)
' nrbina=',nrbina,
'or nfaia=',nfaia,
166 *
' differ from the def. in this prog' 169 if(ansites0 .gt. ndepth)
then 170 write(0,*)
' too many depths' 177 read(fnonrfai,
'(a, f7.1, 4i4)' )
178 * id, recdep(
i), recl0(
i), i0, j0, k0
180 packeddepidx(recl0(
i))=
i 189 if(i0 .ne.
i .or.
j .ne. j0 .or. k .ne. k0)
then 190 write(0,*)
' intdep, i0,j0,k0=',
191 * recdep(
i), i0, j0, k0,
' strange' 194 if( id .ne.
"rec")
then 195 write(0,*)
'id=',id,
' strange' 200 * ( nrfairec0(l,k,
j,
i), l=1,
nrbin )
208 read(fnonrfai,
'(a,f7.1, 4i4)' )
209 * id, intdep(
i), l0(
i), i0, j0, k0
211 if(i0 .ne.
i .or.
j .ne. j0 .or. k .ne. k0)
then 212 write(0,*)
' intdep, i0,j0,k0=',
213 * intdep(
i), i0, j0, k0,
' strange' 216 if( id .ne.
"all")
then 217 write(0,*)
'id=',id,
' strange' 221 * ( nrfaiall0(l,k,
j,
i), l=1,
nrbin )
228 read(fnonrfai,
'(a,f7.1, 3i4)' )
229 * id5, intdep(
i), l0(
i), i0, k0
231 if(i0 .ne.
i .or. k .ne. k0)
then 232 write(0,*)
' intdep, i0,k0=',
233 * intdep(
i), i0, k0,
' strange' 236 if( id5 .ne.
"dE/dx")
then 237 write(0,*)
'id=',id5,
' strange' 241 * ( derfai(l,k,
i), l=1,
nrbin )
242 if(seelowde)
read(fnonrfai, *)
243 * ( derfai2(l,k,
i), l=1,
nrbin )
248 write(0,*)
' all nrfai data has been read' 249 limit(1) = reallimitg
250 limit(2) = reallimite
251 limit(3) = reallimitmu
252 limit(4) = reallimith
253 if(newfmt .eq. 0)
then 254 write(0,
'(i2, 1pE11.3,i3, 0pf7.1, 1pE11.3,0p, 3i4)')
255 * evno0, e0,nn, cosz, limit(1), nrbina, nfaia, ansites0
256 elseif( newfmt .eq. 1 )
then 257 write(0,
'(i2, 1pE11.3,i3, 0pf7.1, 1pE11.3, 0p,4i4)')
258 * evno0, e0,nn, cosz, limit(1), nrbina, nfaia, ansites0,
261 write(0,
'(i2, 1pE11.3,i3, 0pf7.1,1pE11.3,0p,4i4,4f8.9)')
262 * evno0, e0,nn, cosz, emin, nrbina, nfaia, ansites0,
271 limit(1) = reallimitg
272 limit(2) = reallimite
273 limit(3) = reallimitmu
274 limit(4) = reallimith
276 if(newfmt .ne. 2)
then 277 write(0,*)
' limit=',limit(1),
' is being used' 279 write(0,*)
' limit=',limit,
' ares being used' 286 if(nrfairec0(l, k,
j,
i) .gt. limit(
j))
then 288 pnrfairec(l, k,
j,
i)=
289 * limit(
j)/nrfairec0(l, k,
j,
i)
291 pnrfairec(l, k,
j,
i)=1.0
295 write(0,
'(f7.1, 4i4,a)' )
296 * recdep(
i), indivdep(
i),
i,
j, k,
' prob' 297 write(0,
'(1p10E11.3)')
298 * (pnrfairec(l,k,
j,
i), l=1,
nrbin)
313 read(fnodat,end=100) bufc, (buf(
i),
i=1, bufc)
320 depidx = packeddepidx(ldep)
321 faiidx= buf(
i).faiidx
323 codex = min(buf(
i).
code, 4)
325 prob = pnrfairec(ridx, faiidx, codex, depidx)
326 if( prob .gt. 1.)
then 331 if(prob .gt. 1.)
then 345 rnrfairec(ridx, faiidx, codex, depidx)=
346 * rnrfairec(ridx, faiidx, codex, depidx) + wwgt
348 *
'(6i3, 1pE11.3, 0p,f6.1,1p2E11.3,0p, 2f8.4,f10.6,1pE11.3)')
350 * buf(
i).
charge, buf(
i).ridx, buf(
i).faiidx,
351 * buf(
i).rinmu, buf(
i).fai, buf(
i).ek,
352 * buf(
i).
t, buf(
i).wx, buf(
i).wy, buf(
i).wz,
360 *
'(i2,1pE11.3, 0p,i3, f8.4, 1pE11.3,0p,4i4,4f8.0)' )
361 * evno0, e0, nn, cosz, emin,
nrbin,
nfai, ansites0,
368 write(fnonrfai2,
'("rec",f7.1, 4i4)' )
369 * recdep(
i), l,
i,
j, k
370 write(fnonrfai2,
'(1p10E11.3)')
371 * ( rnrfairec(l,k,
j,
i), l=1,
nrbin )
380 write(fnonrfai2,
'("all",f7.1, 4i4)' )
381 * intdep(
i), l,
i,
j, k
382 write(fnonrfai2,
'(1p10E11.3)')
383 * ( nrfaiall0(l,k,
j,
i), l=1,
nrbin )
392 write(fnonrfai2,
'("dE/dx",f7.1, 3i4)' )
394 write(fnonrfai2,
'(1p10E11.3)')
395 * ( derfai(l,k,
i), l=1,
nrbin )
396 if(seelowde)
write(fnonrfai2,
'(1p10E11.3)')
397 * ( derfai2(l,k,
i), l=1,
nrbin )
401 write(0,*)
'end of run' 405 write(0,*)
' input error at record =', nrec
integer npitbl real *nx parameter(n=101, npitbl=46, nx=n-1) real *8 uconst
subroutine ksplit(a, m, n, b, nr)
integer function kgetenv2(envname, envresult)
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
********************block data cblkHeavy ********************integer j data *HeavyG2symbol *data *HeavyG2code kiron data j
subroutine copenfw2(io, fnin, form, icon)
*Zfirst p fm *Zfirst p Zfirst p code
dE dx *! Nuc Int sampling table d
*Zfirst p fm *Zfirst p Zfirst p Zfirst p *Zfirst p charge
integer function klena(cha)
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
*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 *Zfirst wgt
*Zfirst p fm *Zfirst p Zfirst p Zfirst p subcode