1 #if defined (KEKB) || defined (KEKA) 46 include
"../../SkelFlesh/Zprivate.h" 53 integer i, nlow, cumnum, num, ir(2)
57 character*120 skelfilebase
58 character*100 basename
59 character*100 filename
61 character*100 hostlist, thinhostlist
63 integer n, j, k, nr, ll, kgetenv2
69 read( msg(1:ll), *) ncpu
71 read( msg(1:ll), *) mcpu
73 read( msg(1:ll), *) margin
77 skelfilebase=msg(1:ll)
83 if(ll .gt. 0) hostlist = msg(1:ll)
86 if(ll .gt. 0) thinhostlist = msg(1:ll)
89 call copenfw2(11, skelfilebase, 2, icon)
91 write(msg,*) skelfilebase(1:
klena(skelfilebase)),
92 *
' could not be opened properly' 95 write(msg,*)
"# of cpu's=",ncpu, mcpu
97 if(ncpu .lt. 1 .or. ncpu .gt. maxcpu)
then 98 call cerrormsg(
"# of cpu's > MaxCPU <1 ",0)
103 if( outdir(k:k) .ne.
'/')
then 107 write(msg,
'(a,a)')
'output directory is ',
111 *
' files will be created there as '//
112 * basename(1:
klena(basename))//
'0001 etc' 117 if(hostlist .ne.
' ')
then 118 call copenf(12, hostlist, icon)
119 if(icon .ne. 0 )
then 121 call cerrormsg(
' could not be opened', 0)
124 write(0,*)
' hostlist not given' 128 if( mcpu .le. ncpu )
then 129 if( thinhostlist .ne.
' ' )
then 130 call copenf(13, thinhostlist, icon)
131 if(icon .ne. 0 )
then 133 call cerrormsg(
' could not be opened', 0)
136 write(0,*)
' thinhostlist not given' 140 write(0,*)
' Mcpu =', mcpu,
' > Ncpu=', ncpu
145 read(12,
'(a)') input
150 call ksplit(input, 30, 3, field, nr)
151 read(field(1),
'(i6)' ) numba(
i)
152 if( numba(
i) .gt. ncpu .or. numba(
i) .lt. 1 )
then 153 write(0,*)
i,
'-th line has ivalid number=',
154 * numba(
i),
' in Hosts' 160 read(field(3), * )
cpupw(
i)
165 if(mcpu .le. ncpu)
then 166 do i = 1, mcpu+margin
167 read(13,
'(a)') input
172 call ksplit(input, 30, 3, field, nr)
173 read(field(1),
'(i6)' ) ii
174 if( ii .gt. ncpu .or. ii .lt. 1 )
then 175 write(0,*)
i,
'-th line has ivalid number=',
176 * ii,
' in ThinHosts' 185 if( numba(
i) .lt. 0 )
then 186 write(filename,
'(a,i5.5)')
187 * basename(1:
klena(basename)),
i 188 skelfile(
i) = outdir(1:
klena(outdir))//filename
204 read(11, end=100) cumnum, num, ir,
205 #if defined (AVOIDFOOL) 206 #include "ZavoidUnionMap.h" 211 if( numba(
i) .lt. 0 )
then 214 #if defined (AVOIDFOOL) 215 open(basefn+
i, file=skelfile(
i),
position=
"append",
217 open(basefn+
i, file=skelfile(
i), access=
"append" ,
219 * form=
"unformatted", iostat=icon)
221 write(basefn+
i) cumnum, num, ir,
222 #if defined (AVOIDFOOL) 223 #include "ZavoidUnionMap.h" 229 write(0,*) skelfile(
i),
" could not be opened" 238 write(msg, *) np,
' ptcls are observed ones in skeleton' 240 if(np .gt. maxob)
then 242 *
'It is too large; enlarge Maxob', 0)
250 do while (nlow .ge. 0)
255 if(ctc .lt.
maxp)
then 260 *
'too many particles in skeleton',1)
262 *
'Enlarge Maxp in Zprivate2.h', 0)
268 *
'# of total ptcls at flesh=',ctc
275 write(0,*)
' sort by energy starts' 277 write(0,*)
' sort by energy ended' 281 if(ctc .lt. ncpu)
then 283 write(msg, *)
'# of ptcls < Ncpu' 288 write(0,*)
' distribute particles to',
n,
' cpus' 291 write(0,*)
' starts to write sub skeletons' 298 call cerrormsg(
'all events have been smashed',1)
308 include
"../../SkelFlesh/Zprivate.h" 309 include
"Zprivate2.h" 325 idxlist(1, i) =
idx(i)
376 if( bigtosmall )
then 391 if( noncpu( k ) .gt. maxptclpercpu )
then 393 *
'# of ptcls on a cpu', k,
' is ', noncpu( k ) ,
394 *
' exceeded limit=', maxptclpercpu
396 call cerrormsg(
'Enlarge MaxPtclPerCpu in Zprivate2.h',0)
398 idxlist( noncpu(k), k ) =
idx(j)
408 include
"../../SkelFlesh/Zprivate.h" 409 include
"Zprivate2.h" 412 integer navob, navobc, navobx
437 write(0,*)
' navobx=', navobx,
' resob=',resob
441 if(numba(i) .lt. 0 )
then 445 if( u .lt. resob)
then 448 if(navobc+navob .gt. np .or. cpuc .eq. mcpu )
then 451 #if defined (AVOIDFOOL) 452 open(basefn+i, file=skelfile(i),
position=
"append",
454 open(basefn+i, file=skelfile(i), access=
"append",
456 * form=
"unformatted", iostat=icon)
459 write(0,*)
' cpu ',i,
' obs=',navob
461 write(basefn+i) navob
464 do j = navobc +1, navobc+navob
465 write(basefn+i) oo(j)
467 navobc = navobc + navob
469 write(0,*)
' skelfile=', skelfile(i),
" cannot be opened" 484 write(basefn+i) noncpu(i)
486 #if defined (AVOIDFOOL) 487 zfirst =ct( idxlist(j, i) )
489 #include "ZavoidUnionMap.h" 491 write(basefn+i) ct( idxlist(j, i) )
501 include
"../../SkelFlesh/Zprivate.h" 502 include
"Zprivate2.h" 507 msg =
' cpu# cpuPW Sum E # of ptcls' 511 write(msg,
'(i6, f7.1, g16.7, i9)')
523 include
"../../SkelFlesh/Zprivate.h" 524 include
"Zprivate2.h" 530 erg(i) = ct(i).
p.fm.
p(4)
531 averg = averg +
erg(i)
538 averg = averg/ctc * ncpu
543 if(
erg(
idx(ctc) ) .gt. averg*1.1 )
then 546 write(msg,*)
'WARGNING: max E=',
erg(
idx(i)),
547 *
' is > average total energy for 1 cpu=',
559 include
"../../SkelFlesh/Zprivate.h" 560 include
"Zprivate2.h" 568 t.
p.fm.
p(1) = f.fm(1)
569 t.
p.fm.
p(2) = f.fm(2)
570 t.
p.fm.
p(3) = f.fm(3)
571 t.
p.fm.
p(4) = f.fm(4)
573 t.pos.
xyz.
r(1) = pp.posx
574 t.pos.
xyz.
r(2) = pp.posy
575 t.pos.
xyz.
r(3) = pp.posz
subroutine ksplit(a, m, n, b, nr)
*Zfirst p fm *Zfirst p Zfirst p Zfirst p *Zfirst p *Zfirst pos xyz Zfirst pos xyz *Zfirst pos *Zfirst pos depth
subroutine cerrormsg(msg, needrtn)
integer function kgetenv2(envname, envresult)
*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 colheight
*Zfirst p fm *Zfirst p Zfirst p Zfirst p *Zfirst p *Zfirst pos xyz r
subroutine movetrack(f, t)
latitude latitude this system is used *****************************************************************! type coord sequence union map real z z in m endmap xyz map real ! latitude in deg is to the north ! longitude in deg is to the east *h ! height in m endmap llh map real ! polar angle ! azimuthal angle *radius ! radial distance endmap sph endunion character *sys ! which system xyz
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 * sumergi(MaxCPU)
*Zfirst p fm *Zfirst p Zfirst p Zfirst p *Zfirst p *Zfirst pos xyz Zfirst pos xyz sys
averg real MaxCPU integer idx(Maxp)
subroutine cresetdirec(aTrack)
********************block data cblkHeavy ********************integer j data *HeavyG2symbol p
subroutine copenfw2(io, fnin, form, icon)
subroutine kqsortd(A, ORD, N)
*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 Zfirst Zfirst asflag
*Zfirst p fm *Zfirst p Zfirst p code
subroutine ksortinv(idx, n)
averg real sumergw(MaxCPU)
subroutine copenf(io, fnin, icon)
averg real MaxCPU integer idxlocal(MaxCPU) integer numba(MaxCPU) integer ctc
*Zfirst p fm *Zfirst p Zfirst p Zfirst p *Zfirst p *Zfirst pos xyz Zfirst pos xyz *Zfirst pos *Zfirst pos Zfirst pos height
*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 mass
averg real cpupw(MaxCPU) integer nOnCpu(MaxCPU) integer idxlist(MaxPtclPerCpu
*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
*Zfirst p fm *Zfirst p Zfirst p Zfirst p *Zfirst p *Zfirst pos xyz Zfirst pos xyz *Zfirst pos radiallen