6 character*120 tracefile, timeprofile, filename
11 real ta1(ntimem), ta2(ntimem), dta(ntimem),
12 * pixela(ntimem), rmaxa(ntimem),
13 * maxppta(ntimem), maxthina(ntimem),
15 character*120 dira(ntimem)
22 * tracefile, timeprofile, split, outtype
24 read(*,*) chgsel, codesel
28 read(*,*) aax, aay, aaz
29 read(*,*) bbx, bby, bbz
30 read(*,*) ccx, ccy, ccz
35 if( codesel(
i) .eq. 0)
goto 10
40 if(chgsel .ne. -1)
select =
select + 1
42 if(ncodes .gt. 0)
select =
select + 2
45 write(0,*) tracefile(1:
klena(tracefile)),
" ",
46 * timeprofile(1:
klena(timeprofile)), split, outtype
47 write(0,*) chgsel, codesel
48 write(0,*) aax, aay, aaz
49 write(0,*) bbx, bby, bbz
50 write(0,*) ccx, ccy, ccz
55 open(11, file=timeprofile(1:
klena(timeprofile)) )
57 write(0,*)
' profile opened' 61 read(11,*, end=200) ta1(
i), ta2(
i), dta(
i), pixela(
i),
62 * rmaxa(
i), maxppta(
i), maxthina(
i),
64 if( ta1(
i) .eq. 0. .and. ta2(
i) .eq. 0.)
goto 200
66 write(0, *) ta1(
i), ta2(
i), dta(
i), pixela(
i),
67 * rmaxa(
i), maxppta(
i), maxthina(
i),
68 * offseta(
i), dira(
i)(1:
klena(dira(
i)))
71 if(rmaxa(
i) .eq. 0.)
then 79 filename = dira(
i)(1:
klena(dira(
i)))//
"/dummy" 80 open(11, file=filename, err=210)
85 write(0,*)
' following dir may be missing:= ',
91 open(11, file=tracefile(1:
klena(tracefile)),
92 * form=
'formatted', err=230 )
95 write(0,*)
' trace file may be missing:= ',
96 * tracefile(1:
klena(tracefile))
99 write(0,*)
' trace file opend' 101 if(maxppta(
i) .eq. 0)
then 106 maxthin = maxthina(
i)
110 * ta1(
i), ta2(
i), dta(
i), pixela(
i), rmaxa(
i) )
115 subroutine slice1tbin(mint, maxt, dt, pixelin, rmax)
117 #include "Zprivate2.f" 118 real*4 mint, maxt, dt, t1, t2, rmax, pixelin
123 do while (t2 .lt. maxt)
125 t2 = min(t1+ dt*
n , maxt)
129 call slice(t1, t2, dt)
130 write(0,*)
' t1=',t1,
't2=',t2,
' slice ended' 131 write(0,*)
' maxppt=', maxppt
133 write(0,*)
' thinning ended' 135 if( ibits(outtype, 0, 1) .ne. 0)
then 138 if( ibits(outtype, 1, 1) .ne. 0)
then 141 write(0,*)
' all output finished' 143 if(ibits(outtype, 0, 1) .ne. 0)
then 146 if(ibits(outtype, 1, 1) .ne. 0)
then 149 write(0,*)
' ouput to a file ended' 160 subroutine slice(mint, maxt, dt)
162 #include "Zprivate2.f" 164 real*4 mint, maxt, dt
168 integer it1, it2, kkk
169 real*4 xx1, yy1, zz1, time1
170 real*4 xx2, yy2, zz2, time2
179 chkcode = ncodes .gt. 0
189 read(11,
'(a)', end=1000 ) input
191 if( mod(linec, 1.d7) .eq. 0 )
then 193 *
' ------------------------------------linec=',linec
198 if( input .ne.
" " )
then 199 read(input, * ) xx1, yy1, zz1, code, kerg1, chg,
201 if(
select .eq. 0)
goto 100
203 if( chgsel .ne. -1 )
then 205 if(chgsel .eq. 0 .and. chg .ne. 0)
goto 950
206 if(chgsel .eq. 1 .and. chg .eq. 0)
goto 950
210 if(codesel(kkk) .eq. code)
goto 100
216 do while( input .ne.
" " )
217 read(11,
'(a)', end =1000) input
219 if( mod(linec, 1.d7) .eq. 0 )
then 221 *
' ------------------------------------linec=',
228 if( input .ne.
" " )
then 229 read(input, * ) xx2, yy2, zz2, code, kerg2, chg,
231 xxp = xx2*aax + yy2*aay
232 yyp = xx2*bbx + yy2*bby + zz2*bbz
233 it1 = (time1- mint)/dt +1
234 it2 = (time2- mint)/dt +1
236 if(xxp**2 + yyp**2 .gt. rmax2)
goto 900
237 if(it1 .lt. 1)
goto 900
238 if(it2 .gt.
n)
goto 900
239 if(time2 .gt. maxt)
goto 900
240 jmin = min(jmin, it1)
241 jmax = max(jmax, it2)
244 if(
idx(j) .eq. maxppt .and.
245 * thinc(j) .lt. maxthin )
then 247 *
'ptcls at time=', t ,
' > ', maxppt
253 thinc(j) = thinc(j) + 1
256 if(
idx(j) .le. maxppt)
then 258 if(time2 .eq. time1)
then 261 k = (t - time1) /(time2-time1)
263 x(
idx(j), j) = (xx2-xx1) * k + xx1
264 y(
idx(j), j) = (yy2-yy1) * k + yy1
265 z(
idx(j), j) = (zz2-zz1) * k + zz1
266 codex(
idx(j), j) = code
267 chgx(
idx(j), j) = chg
288 #include "Zprivate2.f" 293 integer nc, j, i, k1, k2, l, nc0
299 ntp= min(
idx(j), maxppt)
301 if( ntp .gt. maxppt/2.0 )
then 305 if( k1 .lt. 0 )
goto 20
308 if(k2 .lt. 0)
goto 10
309 if(abs(
x(k1, j)-
x(k2,j)) .gt. pixel )
goto 20
313 if(abs(
y(k1, j)-
y(k2,j)) .gt. pixel )
goto 10
314 if(abs(
z(k1, j)-
z(k2,j)) .gt. pixel )
goto 10
329 write(0,*)
' at time idx=',j,
330 *
' thinning ', nc0,
"-->", nc
340 subroutine mvdata(f, j, nc)
342 #include "Zprivate2.f" 348 integer i, nc, l, ntp
352 ntp = min(
idx(j), maxppt)
369 #include "Zprivate2.f" 374 integer i, nc, l, ntp
378 ntp = min(
idx(j), maxppt)
397 #include "Zprivate2.f" 399 character* 130 filename
407 if(
idx(j) .gt. 0)
then 409 write(filename,
'(a, a, i5.5,a)') dir(1:klena(dir)),
410 *
"/ts", filec+offset,
".dat" 411 open(20, file=filename(1:klena(filename)),
413 do i= 1, min(
idx(j), maxppt)
414 write(20,
'(3g16.8,i3,i3)')
415 *
x(i, j),
y(i,j),
z(i,j), codex(i,j), chgx(i,j)
424 #include "Zprivate2.f" 426 character* 130 filename
436 write(0,*)
' jmin,max=', jmin, jmax
440 ntp = min(
idx(j), maxppt)
441 if(
idx(j) .gt. 0)
then 443 write(filename,
'(a, a, i5.5, a)') dir(1:klena(dir)),
444 *
"/ts", filec+offset,
".skel" 446 open(20, file=filename(1:klena(filename)),
448 write(20,
'(a)')
"SKEL" 450 * codex(1,j), chgx(1, j), ntp)
458 #include "Zprivate2.f" 461 character* 130 filename
468 if( filec .eq. 0 )
then 469 filename = dir(1:klena(dir))//
"/timesorted.dat" 470 open(20, file=filename(1:klena(filename)),
476 do i= 1, min(
idx(j), maxppt)
477 write(20,
'(3g16.8, i3,i3)' )
478 *
x(i, j),
y(i,j),
z(i,j), codex(i,j), chgx(i,j)
480 if(
idx(j) .gt. 0 )
write(20,*)
485 #include "Zprivate2.f" 488 character* 130 filename
495 if( filec .eq. 0 )
then 496 filename = dir(1:klena(dir))//
"/timesorted.skel" 497 open(20, file=filename(1:klena(filename)),
503 ntp = min(
idx(j), maxppt)
504 if(
idx(j) .gt. 0)
then 505 write(20,
'(a)')
"SKEL" 507 *
x(1, j),
y(1,j),
z(1,j), codex(1,j), chgx(1,j), ntp)
514 subroutine wtaskel(fno, xa, ya, za, code, chg, np)
518 real*4 xa(np), ya(np), za(np)
519 integer*2 code(np), chg(np)
526 write(fno,
'(2i9)') np, np
528 write(fno,
'(3g16.8)' ) xa(i), ya(i), za(i)
531 call code2rgb(code(i), chg(i), r, g, b, alpha)
532 write(fno,
'("1 ", i8, 3f5.2)')
537 subroutine code2rgb(codei, chgi, r, g, b, alpha)
539 integer*2 codei, chgi
542 integer ncolor, mncolor
545 integer*2 tcode(mncolor)
546 integer*2 tchg(mncolor)
559 save first, ncolor, tcode, tchg, tr, tg, tb, talpha
562 if(first .eq. 0)
then 565 open(13, file=
'colortab')
568 read(13,
'(a)',end=10) input
570 if(input(1:1) .ne.
"#" .and. input .ne.
' ')
then 572 if(i .gt. mncolor)
then 573 write(0,*)
' too many color spec. in colortab' 579 * tr(i), tg(i), tb(i),
590 if(tcode(i) .eq. codei .and. tchg(i) .eq. chgi)
goto 100
integer npitbl real *nx parameter(n=101, npitbl=46, nx=n-1) real *8 uconst
subroutine slice1tbin(mint, maxt, dt, pixelin, rmax)
subroutine mvdata(f, j, nc)
subroutine thinning(i1, i2)
subroutine wtaskel(fno, xa, ya, za, code, chg, np, mulalpha)
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
averg real MaxCPU integer idx(Maxp)
block data cblkEvhnp ! currently usable models data RegMdls ad *special data *Cekaon d0
subroutine code2rgb(codei, chgi, r, g, b, alpha)
latitude latitude this system is used *****************************************************************! type coord sequence union map real y
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
*************************block data cblkTracking *************************implicit none data *ExactThick *Freec *RatioToE0 *MagChgDist *TimeStructure *Truncn *Truncx data *IncMuonPolari *KEminObs *ThinSampling *EthinRatio *Generate *LpmEffect *MagPairEmin e10
subroutine mvdatai(f, j, nc)
subroutine kqsortr(A, ORD, N)
! structure defining a particle at production ! Basic idea of what is to be contained in ! the particle structue is that dynamical ones should be included those derivable from the particle code ! is not included ******************************************************type fmom momentum sequence union map real e endmap map real * x
subroutine slice(mint, maxt, dt)