16 #include "../FleshHist/asinfo.f" 17 #include "../FleshHist/asdensity.f" 18 #include "../FleshHist/crecprob.f" 22 #include "../FleshHist/Zprivate0.h" 24 integer ldep, code, subcode,
25 *
charge, ridx, faiidx, codex
26 real rinmu, fai, Ek, time,
27 * wx, wy, wz,
wgt, wwgt
37 real recprob(
nrbin, 4, ndepth)
38 integer newfmt, nr, maxsites
40 character*20 field(15)
42 real rat, all, rec, prob
44 real intdeprec(ndepth), intdepall(ndepth)
45 integer nrbina, nfaia, ansites0
46 integer leng, i, j, k, l, leng2
47 integer i0, j0, k0, l0
49 integer icon0, iconx, icont
51 character*100 nrfaifile, nrfaifile2, datfile, datfile2
54 integer fnonrfai, fnonrfai2, fnodat, fnodat2
55 real cosz, age, sum, Nx, depth
56 real nptcls(
nrbin, 4, ndepth)
57 integer indivdeprec(ndepth), indivdepall(ndepth)
58 integer packeddepidx(ndepth), depidx
60 integer icon, kgetenv2, nrec
70 write(0,*)
"Env. NRFAIFILE not given" 73 call copenfw2(fnonrfai, nrfaifile, 1, icon)
75 write(0,*) nrfaifile ,
' not exist' 81 write(0,*)
"Env. DATFILE not given" 84 call copenfw2(fnodat, datfile, 1, icon)
86 write(0,*)
' input main data not exist' 87 write(0,*)
' file=',datfile
91 datfile2 = datfile(1:leng2)//
"-r" 99 nrfaifile2 = datfile(1:leng2-3)//
"nrfai-r" 100 call copenfw2(fnonrfai2, nrfaifile2, 1, icon)
102 write(0,*)
' error ', nrfaifile2,
' cannot be created' 111 rnrfairec(
i, l,
j, k)=0
119 read(fnonrfai,
'(a)', end=1000 ) input0
121 if(input0 .ne.
" ")
then 122 call ksplit(input0, 20, 15, field, nr)
124 read(input0(1:
klena(input0)), *)
125 * evno0, e0,nn, cosz, limit(1), nrbina, nfaia, ansites0
129 elseif(nr .eq. 9 )
then 130 read(input0(1:
klena(input0)), *)
131 * evno0, e0,nn, cosz, limit(1), nrbina, nfaia, ansites0,
135 elseif( nr .eq. 13)
then 136 read(input0(1:
klena(input0)), *)
137 * evno0, e0,nn, cosz, emin, nrbina, nfaia, ansites0,
141 write(0,*)
' EvNo0=',evno0,
142 * e0,nn, cosz, emin, nrbina, nfaia, ansites0, maxsites,
145 if(nrbina .ne.
nrbin .or. nfaia .ne.
nfai)
then 146 write(0,*)
' nrbina=',nrbina,
'or nfaia=',nfaia,
147 *
' differ from the def. in this prog' 150 if(ansites0 .gt. ndepth)
then 151 write(0,*)
' too many depths' 158 read(fnonrfai,
'(a, f7.1, 4i4)' )
159 * id, intdeprec(
i), l0, i0, j0, k0
170 if(i0 .ne.
i .or.
j .ne. j0 .or. k .ne. k0)
then 171 write(0,*)
' intdep, i0,j0,k0=',
172 * intdeprec(
i), i0, j0, k0,
' strange' 175 if( id .ne.
"rec")
then 176 write(0,*)
'id=',id,
' strange' 181 * ( nrfairec0(l,k,
j,
i), l=1,
nrbin )
189 read(fnonrfai,
'(a,f7.1, 4i4)' )
190 * id, intdepall(
i), l0, i0, j0, k0
192 if(i0 .ne.
i .or.
j .ne. j0 .or. k .ne. k0)
then 193 write(0,*)
' intdep, i0,j0,k0=',
194 * intdepall(
i), i0, j0, k0,
' strange' 197 if( id .ne.
"all")
then 198 write(0,*)
'id=',id,
' strange' 202 * ( nrfaiall0(l,k,
j,
i), l=1,
nrbin )
209 read(fnonrfai,
'(a,f7.1, 4i4)' )
210 * id5, intdepall(
i), l0, i0, k0
212 if(i0 .ne.
i .or. k .ne. k0)
then 213 write(0,*)
' intdep, i0,k0=',
214 * intdepall(
i), i0, k0,
' strange' 217 if( id5 .ne.
"dE/dx")
then 218 write(0,*)
'id=',id5,
' strange' 222 * ( derfai(l,k,
i), l=1,
nrbin )
227 write(0,*)
' all nrfai data has been read' 229 *
'(i2, 1pE11.3,i3, 0pf7.1, 1pE11.3,0p, 4i4, 4f8.0)')
230 * evno0, e0,nn, cosz, emin, nrbina, nfaia, ansites0,
236 limit(1) = reallimitg
237 limit(2) = reallimite
238 limit(3) = reallimitmu
239 limit(4) = reallimith
242 write(0,*)
' limit=',limit,
' are being used' 248 if(nrfairec0(l, k,
j,
i) .gt. limit(
j))
then 250 pnrfairec(l, k,
j,
i)=
251 * limit(
j)/nrfairec0(l, k,
j,
i)
253 pnrfairec(l, k,
j,
i)=1.0
257 write(0,
'(f7.1, 4i4,a)' )
258 * intdeprec(
i), indivdeprec(
i),
i,
j, k,
' prob' 259 write(0,
'(1p10E11.3)')
260 * (pnrfairec(l,k,
j,
i), l=1,
nrbin)
273 read(fnodat,
'(a)', end=100, err=500) input0
274 if( index(input0(1:2),
"i") .gt. 0 ) cycle
283 #if KeepWeight == yes 287 depidx = packeddepidx(ldep)
289 if(depidx .le. 0)
then 290 write(0,*)
' should not happen. depidx=',depidx
291 write(0,*)
' ldep=',ldep,
' code=',
code,
'nrec=',nrec
298 prob = pnrfairec(ridx, faiidx, codex, depidx)
299 if( prob .gt. 1.)
then 304 if(prob .gt. 1.)
then 318 rnrfairec(ridx, faiidx, codex, depidx)=
319 * rnrfairec(ridx, faiidx, codex, depidx) + wwgt
320 #if KeepWeight != yes 322 *
'(6i3, 1pE11.3, 0p,f6.1,1p2E11.3,0p, 2f8.4,f10.6)')
330 *
'(6i3, 1pE11.3, 0p,f6.1,1p2E11.3,0p, 2f8.4,f10.6,1pE11.3)')
344 if(newfmt .eq. 0)
then 346 *
'(i2,1pE11.3, 0p,i3, f8.4, 1pE11.3,0p, 3i4)' )
347 * evno0, e0, nn, cosz, limit(1),
nrbin,
nfai, ansites0
348 elseif( newfmt .eq. 1)
then 350 *
'(i2,1pE11.3, 0p,i3, f8.4, 1pE11.3,0p,4i4)' )
351 * evno0, e0, nn, cosz, limit(1),
nrbin,
nfai, ansites0,
355 *
'(i2,1pE11.3, 0p,i3, f8.4, 1pE11.3,0p,4i4,4f8.0)' )
356 * evno0, e0, nn, cosz, emin,
nrbin,
nfai, ansites0,
363 write(fnonrfai2,
'("rec",f7.1, 4i4)' )
364 * intdeprec(
i), l,
i,
j, k
365 write(fnonrfai2,
'(1p10E11.3)')
366 * ( rnrfairec(l,k,
j,
i), l=1,
nrbin )
374 write(fnonrfai2,
'("all",f7.1, 4i4)' )
375 * intdepall(
i), l,
i,
j, k
376 write(fnonrfai2,
'(1p10E11.3)')
377 * ( nrfaiall0(l,k,
j,
i), l=1,
nrbin )
385 write(fnonrfai2,
'("dE/dx",f7.1, 3i4)' )
386 * intdepall(
i), l,
i, k
387 write(fnonrfai2,
'(1p10E11.3)')
388 * ( derfai(l,k,
i), l=1,
nrbin )
392 write(0,*)
'end of run' 396 write(0,*)
' input error at record =', nrec
397 read(fnodat,
'(a)') input0
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