2 include
"Zprivate2g77.f" 4 character*120 tracefile
5 integer leng, icon, i, outtype
6 real*4 mint, maxt, dt, t1, t2, rmax
16 * tracefile, dir, mint, maxt, dt, pixel0, pixelinc, split,
17 * outtype, mulalpha, maxppt, rmax
20 read(*,*) aax, aay, aaz
21 read(*,*) bbx, bby, bbz
22 read(*,*) ccx, ccy, ccz
24 if(maxppt .le. 0)
then 28 * tracefile(1:
klena(tracefile)),
" ", dir(1:
klena(dir)),
29 * mint, maxt, dt, pixel0, pixelinc, split,
30 * outtype, mulalpha, maxppt, rmax
34 open(11, file=tracefile, form=
'formatted' )
42 do while (t2 .lt. maxt)
44 t2 = min(t1+ dt*
n , maxt)
47 call slice(t1, t2, dt)
48 write(0,*)
' t1=',t1,
't2=',t2,
' slice ended' 50 write(0,*)
' thinning ended' 53 if( ibits(outtype, 0, 1) .ne. 0)
then 56 if( ibits(outtype, 1, 1) .ne. 0)
then 59 write(0,*)
' all output finished' 61 if(ibits(outtype, 0, 1) .ne. 0)
then 64 if(ibits(outtype, 1, 1) .ne. 0)
then 67 write(0,*)
' ouput to a file ended' 78 subroutine slice(mint, maxt, dt)
80 include
"Zprivate2g77.f" 87 real*4 xx1, yy1, zz1, time1
88 real*4 xx2, yy2, zz2, time2
102 read(11,
'(a)', end=1000 ) input
104 if( mod(linec, 1.d7) .eq. 0 )
then 106 *
' ------------------------------------linec=',linec
108 if( input .ne.
" " )
then 109 read(input, * ) xx1, yy1, zz1, time1, code, chg
110 do while( input .ne.
" ")
111 read(11,
'(a)', end =1000) input
113 if( mod(linec, 1.d7) .eq. 0 )
then 115 *
' ------------------------------------linec=',
119 if( input .ne.
" " )
then 120 read(input, * ) xx2, yy2, zz2, time2, code, chg
121 xxp = xx2*aax + yy2*aay
122 yyp = xx2*bbx + yy2*bby + zz2*bbz
123 if(xxp**2 + yyp**2 .gt. rmax2)
goto 900
124 it1 = (time1- mint)/dt +1
125 it2 = (time2- mint)/dt
126 if(it1 .lt. 1)
goto 900
127 if(it2 .gt.
n)
goto 900
128 if(time2 .gt. maxt)
goto 900
129 jmin = min(jmin, it1)
130 jmax = max(jmax, it2)
133 if(
idx(j) .ge. maxppt )
then 136 *
'ptcls at time=', t ,
' > ', maxppt
138 *
'try to thin ptcls in the same pixel' 142 do while (
idx(j) .ge. maxppt)
143 pixel = pixel*pixelinc
144 write(0,*)
'ptcls > ', maxppt
145 write(0,*)
'thinning not worked' 147 *
'brute thinning is tried by',pixelinc,
148 *
'x current pixel =', pixel
155 k = (t - time1) /(time2-time1)
156 x(
idx(j), j) = (xx2-xx1) * k + xx1
157 y(
idx(j), j) = (yy2-yy1) * k + yy1
158 z(
idx(j), j) = (zz2-zz1) * k + zz1
159 codex(
idx(j), j) = code
160 chgx(
idx(j), j) = chg
178 include
"Zprivate2g77.f" 184 integer nc, j, i, k1, k2, l, nc0
189 if(
idx(j) .gt. 0)
then 195 if(k1 .lt. 0)
goto 20
198 if(k2 .lt. 0)
goto 10
199 if(abs(
x(k1, j)-
x(k2,j)) .gt. pixel )
goto 20
203 if(abs(
y(k1, j)-
y(k2,j)) .gt. pixel )
goto 10
204 if(abs(
z(k1, j)-
z(k2,j)) .gt. pixel )
goto 10
220 write(0,*)
' thinning ', nc0,
"-->", nc
233 subroutine mvdata(f, j, nc)
235 include
"Zprivate2g77.f" 261 include
"Zprivate2g77.f" 286 include
"Zprivate2g77.f" 288 character* 130 filename
295 if(
idx(j) .gt. 0)
then 296 write(filename,
'(a, a, i5.5,a)') dir(1:klena(dir)),
297 *
"/ts", j+offset,
".dat" 298 open(20, file=filename, form=
'formatted')
300 write(20,
'(3g16.8,i3,i3)')
301 *
x(i, j),
y(i,j),
z(i,j), codex(i,j), chgx(i,j)
310 include
"Zprivate2g77.f" 312 character* 130 filename
320 if(
idx(j) .gt. 0)
then 321 write(filename,
'(a, a, i5.5, a)') dir(1:klena(dir)),
322 *
"/ts", j+offset,
".skel" 323 open(20, file=filename, form=
'formatted')
324 write(20,
'(a)')
"SKEL" 326 * codex(1,j), chgx(1, j),
idx(j), mulalpha)
335 include
"Zprivate2g77.f" 338 character* 130 filename
345 if( filec .eq. 0 )
then 346 filename = dir(1:klena(dir))//
"/timesorted.dat" 347 open(20, file=filename,
354 write(20,
'(3g16.8, i3,i3)' )
355 *
x(i, j),
y(i,j),
z(i,j), codex(i,j), chgx(i,j)
357 if(
idx(j) .gt. 0 )
write(20,*)
362 include
"Zprivate2g77.f" 365 character* 130 filename
372 if( filec .eq. 0 )
then 373 filename = dir(1:klena(dir))//
"/timesorted.skel" 374 open(20, file=filename,
380 if(
idx(j) .gt. 0)
then 381 write(20,
'(a)')
"SKEL" 383 *
x(1, j),
y(1,j),
z(1,j), codex(1,j), chgx(1,j),
idx(j),
391 subroutine wtaskel(fno, xa, ya, za, code, chg, np, mulalpha)
395 real*4 xa(np), ya(np), za(np)
397 integer*2 code(np), chg(np)
403 write(fno,
'(2i9)') np, np
405 write(fno,
'(3g16.8)' ) xa(i), ya(i), za(i)
408 call code2rgb(code(i), chg(i), r, g, b, alpha)
409 write(fno,
'("1 ", i8, 3f5.2,f6.3)')
410 * i-1, r, g, b, alpha*mulalpha
414 subroutine code2rgb(codei, chgi, r, g, b, alpha)
416 integer*2 codei, chgi
419 integer ncolor, mncolor
422 integer*2 tcode(mncolor)
423 integer*2 tchg(mncolor)
436 save first, ncolor, tcode, tchg, tr, tg, tb, talpha
438 if(first .eq. 0)
then 441 open(13, file=
'colortab')
444 read(13,
'(a)',end=10) input
446 if(input(1:1) .ne.
"#" .and. input .ne.
' ')
then 448 if(i .gt. mncolor)
then 449 write(0,*)
' too many color spec. in colortab' 455 * tr(i), tg(i), tb(i),
466 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 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
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)