1 #if defined (KEKB) || defined (KEKA) 41 include
"../../SkelFlesh/Zprivate.h" 48 integer i, nlow, cumnum, num, ir(2)
52 character*120 skelfilebase
53 character*100 basename
54 character*100 filename
56 character*100 hostlist, thinhostlist
58 integer n, j, k, nr, ll, kgetenv2
67 read( msg(1:ll), *) ncpu
69 read( msg(1:ll), *) mcpu
71 read( msg(1:ll), *) margin
73 write(0,*) ncpu, mcpu, margin
77 skelfilebase=msg(1:ll)
83 if(ll .gt. 0) hostlist = msg(1:ll)
86 if(ll .gt. 0) thinhostlist = msg(1:ll)
88 call copenfw2(11, skelfilebase, 2, icon)
90 write(msg,*) skelfilebase(1:
klena(skelfilebase)),
91 *
' could not be opened properly' 94 write(msg,*)
"# of cpu's=",ncpu, mcpu
96 if(ncpu .lt. 1 .or. ncpu .gt. maxcpu)
then 97 call cerrormsg(
"# of cpu's > MaxCPU <1 ",0)
102 if( outdir(k:k) .ne.
'/')
then 106 write(msg,
'(a,a)')
'output directory is ',
110 *
' files will be created there as '//
111 * basename(1:
klena(basename))//
'00003 etc' 116 if(hostlist .ne.
' ')
then 117 call copenf(12, hostlist, icon)
118 if(icon .ne. 0 )
then 120 call cerrormsg(
' could not be opened', 0)
123 write(0,*)
' hostlist not given' 127 if( mcpu .le. ncpu )
then 128 if( thinhostlist .ne.
' ' )
then 129 call copenf(13, thinhostlist, icon)
130 if(icon .ne. 0 )
then 132 call cerrormsg(
' could not be opened', 0)
135 write(0,*)
' thinhostlist not given' 139 write(0,*)
' Mcpu =', mcpu,
' > Ncpu=', ncpu
144 read(12,
'(a)') input
149 call ksplit(input, 30, 3, field, nr)
150 read(field(1),
'(i5)' ) numba(
i)
151 if( numba(
i) .gt. ncpu .or. numba(
i) .lt. 1 )
then 152 write(0,*)
i,
'-th line has ivalid number=',
153 * numba(
i),
' in Hosts' 159 read(field(3), * )
cpupw(
i)
164 if(mcpu .le. ncpu)
then 165 do i = 1, mcpu+margin
166 read(13,
'(a)') input
171 call ksplit(input, 30, 3, field, nr)
172 read(field(1),
'(i5)' ) ii
173 if( ii .gt. ncpu .or. ii .lt. 1 )
then 174 write(0,*)
i,
'-th line has invalid number=',
175 * ii,
' in ThinHosts' 184 if( numba(
i) .lt. 0 )
then 185 write(filename,
'(a,i5.5)')
186 * basename(1:
klena(basename)),
i 187 skelfile(
i) = outdir(1:
klena(outdir))//filename
203 read(11, end=100) cumnum, num, ir,
204 #if defined (AVOIDFOOL) 205 #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)
222 write(basefn+
i) cumnum, num, ir,
223 #if defined (AVOIDFOOL) 224 #include "ZavoidUnionMap.h" 234 write(0,*) skelfile(
i),
" could not be opened" 243 write(msg, *) np,
' ptcls are observed ones in skeleton' 245 if(np .gt. maxob)
then 247 *
'It is too large; enlarge Maxob', 0)
253 write(0,*)
' observed ptcles have been read' 256 do while (nlow .ge. 0)
264 if(ctc .lt.
maxp)
then 269 *
'too many particles in skeleton',1)
271 *
'Enlarge Maxp in Zprivate2.h', 0)
277 *
'# of total ptcls at flesh=',ctc
284 write(0,*)
' sort by energy starts' 286 write(0,*)
' sort by energy ended' 290 if(ctc .lt. ncpu)
then 292 write(msg, *)
'# of ptcls < Ncpu' 297 write(0,*)
' distribute particles to',
n,
' cpus' 300 write(0,*)
' starts to write sub skeletons' 307 call cerrormsg(
'all events have been smashed',1)
317 include
"../../SkelFlesh/Zprivate.h" 318 include
"Zprivate2.h" 332 idxlist(1, i) =
idx(i)
387 noncpu( k ) = noncpu( k ) + 1
388 if( noncpu( k ) .gt. maxptclpercpu )
then 390 *
'# of ptcls on a cpu', k,
' exceeded limit=',
393 call cerrormsg(
'Enlarge MaxPtclPerCpu in Zprivate2.h',0)
395 idxlist( noncpu(k), k ) =
idx(j)
405 include
"../../SkelFlesh/Zprivate.h" 406 include
"Zprivate2.h" 409 integer navob, navobc, navobx
434 write(0,*)
' navobx=', navobx,
' resob=',resob
438 if(numba(i) .lt. 0 )
then 442 if( u .lt. resob)
then 445 if(navobc+navob .gt. np .or. cpuc .eq. mcpu )
then 448 #if defined (AVOIDFOOL) 449 open(basefn+i, file=skelfile(i),
position=
"append",
451 open(basefn+i, file=skelfile(i), access=
"append",
453 * form=
"unformatted", iostat=icon)
456 write(0,*)
' cpu ',i,
' cpuc=',cpuc,
' obs=',navob
458 write(basefn+i) navob
461 do j = navobc +1, navobc+navob
462 write(basefn+i) oo(j)
464 navobc = navobc + navob
466 write(0,*)
' skelfile=', skelfile(i),
" cannot be opened" 482 write(0,*)
' i=', i,
' nOnCpu(i)=',noncpu(i)
487 write(basefn+i) noncpu(i)
489 #if defined (AVOIDFOOL) 490 zfirst = ct( idxlist(j, i) )
492 #include "ZavoidUnionMap.h" 494 write(basefn+i) ct( idxlist(j, i) )
505 include
"../../SkelFlesh/Zprivate.h" 506 include
"Zprivate2.h" 511 msg =
' cpu# cpuPW Sum E # of ptcls' 515 write(msg,
'(i6, f7.1, g16.7, i9)')
527 include
"../../SkelFlesh/Zprivate.h" 528 include
"Zprivate2.h" 534 erg(i) = ct(i).
p.fm.
p(4)
535 averg = averg +
erg(i)
542 averg = averg/ctc * ncpu
547 if(
erg(
idx(ctc) ) .gt. averg*1.1 )
then 550 write(msg,*)
'WARGNING: max E=',
erg(
idx(i)),
551 *
' is > average total energy for 1 cpu=',
563 include
"../../SkelFlesh/Zprivate.h" 564 include
"Zprivate2.h" 572 t.
p.fm.
p(1) = f.fm(1)
573 t.
p.fm.
p(2) = f.fm(2)
574 t.
p.fm.
p(3) = f.fm(3)
575 t.
p.fm.
p(4) = f.fm(4)
577 t.pos.
xyz.
r(1) = pp.posx
578 t.pos.
xyz.
r(2) = pp.posy
579 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)
*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