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
67 character*160 Lfile(ndepth)
75 integer fnonrfai, fnonrfai2, fnodat2
76 real cosz, age, sum, Nx, depth, wgt, wwgt, prob
77 real nptcls(
nrbin, 4, ndepth)
78 integer indivdep(ndepth), packeddepidx(ndepth), depidx
80 integer icon, kgetenv2, nrec
81 logical SeeLowdE, accept
90 write(0,*)
"Env. NRFAIFILE not given" 93 call copenfw2(fnonrfai, nrfaifile, 1, icon)
95 write(0,*)
' error cannot open', nrfaifile
100 write(0,*)
' SeeLowdE not given' 103 seelowde = datfile(1:
leng) .eq.
"yes" 105 leng2 =
kgetenv2(
"DATFILE", datfile)
106 if(leng2 .le. 0)
then 107 write(0,*)
"Env. DATFILE not given" 111 lengbasedir=
kgetenv2(
"BASEDIR", basedir)
112 if(lengbasedir .eq. 0)
then 113 write(0,*)
'BASEDIR not given' 116 lengexecid=
kgetenv2(
"EXECID", execid)
117 if(lengexecid .eq. 0)
then 118 write(0,*)
'EXECID not given' 125 call copenfw2(fnodat, datfile, 2, icon)
127 write(0,*)
' input main data not exist' 128 write(0,*)
' file=',datfile
133 datfile2 = datfile(1:leng2)//
"-r" 135 nrfaifile2 = datfile(1:leng2-3)//
"nrfai-r" 136 call copenfw2(fnonrfai2, nrfaifile2, 1, icon)
138 write(0,*)
' error ', nrfaifile2,
' cannot be created' 148 rnrfairec(
i, l,
j, k)=0
156 read(fnonrfai,
'(a)', end=1000 ) input0
157 if(input0 .ne.
" ")
then 158 call ksplit(input0, 20, 15, field, nr)
160 read(input0(1:
klena(input0)), *)
161 * evno0, e0,nn, cosz, limit(1), nrbina, nfaia, ansites0
165 elseif(nr .eq. 9 )
then 166 read(input0(1:
klena(input0)), *)
167 * evno0, e0,nn, cosz, limit(1), nrbina, nfaia, ansites0,
171 elseif(nr .eq. 13)
then 172 read(input0(1:
klena(input0)), *)
173 * evno0, e0,nn, cosz, emin, nrbina, nfaia, ansites0,
177 write(0,*)
' header fmt strage ' 184 if(nrbina .ne.
nrbin .or. nfaia .ne.
nfai)
then 185 write(0,*)
' nrbina=',nrbina,
'or nfaia=',nfaia,
186 *
' differ from the def. in this prog' 189 if(ansites0 .gt. ndepth)
then 190 write(0,*)
' too many depths' 197 read(fnonrfai,
'(a, f7.1, 4i4)' )
198 * id, recdep(
i), recl0(
i), i0, j0, k0
200 packeddepidx(recl0(
i))=
i 209 if(i0 .ne.
i .or.
j .ne. j0 .or. k .ne. k0)
then 210 write(0,*)
' intdep, i0,j0,k0=',
211 * recdep(
i), i0, j0, k0,
' strange' 214 if( id .ne.
"rec")
then 215 write(0,*)
'id=',id,
' strange' 220 * ( nrfairec0(l,k,
j,
i), l=1,
nrbin )
228 read(fnonrfai,
'(a,f7.1, 4i4)' )
229 * id, intdep(
i), l0(
i), i0, j0, k0
231 if(i0 .ne.
i .or.
j .ne. j0 .or. k .ne. k0)
then 232 write(0,*)
' intdep, i0,j0,k0=',
233 * intdep(
i), i0, j0, k0,
' strange' 236 if( id .ne.
"all")
then 237 write(0,*)
'id=',id,
' strange' 241 * ( nrfaiall0(l,k,
j,
i), l=1,
nrbin )
248 read(fnonrfai,
'(a,f7.1, 3i4)' )
249 * id5, intdep(
i), l0(
i), i0, k0
251 if(i0 .ne.
i .or. k .ne. k0)
then 252 write(0,*)
' intdep, i0,k0=',
253 * intdep(
i), i0, k0,
' strange' 256 if( id5 .ne.
"dE/dx")
then 257 write(0,*)
'id=',id5,
' strange' 261 * ( derfai(l,k,
i), l=1,
nrbin )
262 if(seelowde)
read(fnonrfai, *)
263 * ( derfai2(l,k,
i), l=1,
nrbin )
268 write(0,*)
' all nrfai data has been read' 269 limit(1) = reallimitg
270 limit(2) = reallimite
271 limit(3) = reallimitmu
272 limit(4) = reallimith
273 if(newfmt .eq. 0)
then 274 write(0,
'(i2, 1pE11.3,i3, 0pf7.1, 1pE11.3,0p, 3i4)')
275 * evno0, e0,nn, cosz, limit(1), nrbina, nfaia, ansites0
276 elseif( newfmt .eq. 1 )
then 277 write(0,
'(i2, 1pE11.3,i3, 0pf7.1, 1pE11.3, 0p,4i4)')
278 * evno0, e0,nn, cosz, limit(1), nrbina, nfaia, ansites0,
281 write(0,
'(i2, 1pE11.3,i3, 0pf7.1,1pE11.3,0p,4i4,4f8.9)')
282 * evno0, e0,nn, cosz, emin, nrbina, nfaia, ansites0,
291 limit(1) = reallimitg
292 limit(2) = reallimite
293 limit(3) = reallimitmu
294 limit(4) = reallimith
296 if(newfmt .ne. 2)
then 297 write(0,*)
' limit=',limit(1),
' is being used' 299 write(0,*)
' limit=',limit,
' ares being used' 306 if(nrfairec0(l, k,
j,
i) .gt. limit(
j))
then 308 pnrfairec(l, k,
j,
i)=
309 * limit(
j)/nrfairec0(l, k,
j,
i)
311 pnrfairec(l, k,
j,
i)=1.0
315 write(0,
'(f7.1, 4i4,a)' )
316 * recdep(
i), indivdep(
i),
i,
j, k,
' prob' 317 write(0,
'(1p10E11.3)')
318 * (pnrfairec(l,k,
j,
i), l=1,
nrbin)
334 if(recl0(
i) .gt. 0)
then 335 write(lfile(recl0(
i)),
'(a,"/", a, "-L",i2.2,".dat")')
336 * basedir(1:lengbasedir), execid(1:lengexecid), recl0(
i)
337 open(100+recl0(
i), file=lfile(recl0(
i)), access=
"append" ,
338 * form=
"formatted", iostat=icon)
340 write(0,*) lfile(recl0(
i)),
" could not be opend" 349 read(fnodat,end=100) bufc, (buf(
i),
i=1, bufc)
356 depidx = packeddepidx(ldep)
357 faiidx= buf(
i).faiidx
359 codex = min(buf(
i).
code, 4)
361 prob = pnrfairec(ridx, faiidx, codex, depidx)
362 if( prob .gt. 1.)
then 367 if(prob .gt. 1.)
then 381 rnrfairec(ridx, faiidx, codex, depidx)=
382 * rnrfairec(ridx, faiidx, codex, depidx) + wwgt
384 write(100+buf(
i).ldep,
385 *
'(6i3, 1pE11.3, 0p,f6.1,1p2E11.3,0p, 2f8.4,f10.6,1pE11.3)')
387 * buf(
i).
charge, buf(
i).ridx, buf(
i).faiidx,
388 * buf(
i).rinmu, buf(
i).fai, buf(
i).ek,
389 * buf(
i).
t, buf(
i).wx, buf(
i).wy, buf(
i).wz,
397 *
'(i2,1pE11.3, 0p,i3, f8.4, 1pE11.3,0p,4i4,4f8.0)' )
398 * evno0, e0, nn, cosz, emin,
nrbin,
nfai, ansites0,
405 write(fnonrfai2,
'("rec",f7.1, 4i4)' )
406 * recdep(
i), l,
i,
j, k
407 write(fnonrfai2,
'(1p10E11.3)')
408 * ( rnrfairec(l,k,
j,
i), l=1,
nrbin )
417 write(fnonrfai2,
'("all",f7.1, 4i4)' )
418 * intdep(
i), l,
i,
j, k
419 write(fnonrfai2,
'(1p10E11.3)')
420 * ( nrfaiall0(l,k,
j,
i), l=1,
nrbin )
429 write(fnonrfai2,
'("dE/dx",f7.1, 3i4)' )
431 write(fnonrfai2,
'(1p10E11.3)')
432 * ( derfai(l,k,
i), l=1,
nrbin )
433 if(seelowde)
write(fnonrfai2,
'(1p10E11.3)')
434 * ( derfai2(l,k,
i), l=1,
nrbin )
438 write(0,*)
'end of run' 442 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