COSMOS v7.655  COSMOSv7655
(AirShowerMC)
chookSkel.f File Reference

Go to the source code of this file.

Functions/Subroutines

subroutine chookbgrun
 
subroutine chookbgevent
 
subroutine chookobs (aTrack, id)
 
subroutine chookenevent
 
subroutine chookenrun
 
subroutine chooktrace
 
subroutine chookeint (never)
 
subroutine chookgint (never)
 
subroutine chooknepint (never)
 
subroutine cmemonode (dev, flag, neporeg)
 
subroutine cmemorize (from, to)
 
subroutine cputhes (to)
 
subroutine cputnodinfo (from, to)
 

Function/Subroutine Documentation

◆ chookbgevent()

subroutine chookbgevent ( )

Definition at line 102 of file chookSkel.f.

References charge, code, cqincident(), csetemin(), depth, e, kgnuc, p, r, subcode, true, and x.

102  implicit none
103 
104 #include "Ztrack.h"
105 #include "Ztrackv.h"
106 #include "Ztrackp.h"
107 #include "Zobs.h"
108 #include "Zobsp.h"
109 #include "Zobsv.h"
110 #include "Zcode.h"
111 #include "Zprivate.h"
112 
113 
114 
115  type(coord )::angle
116 
117 
118  integer eventno
119  integer i, j
120  integer seed(2)
121  real*8 sveaswait, svethin(2), kepn
122  save
123 
124  bgevent = .true.
125  np = 0
126  call cqincident( incident, angle)
127  kepn = incident.p.fm.p(4)
128  if( incident.p.code .eq. kgnuc ) then
129  kepn = kepn/ incident.p.subcode
130  endif
131  ethresh = kepn * waitratio
132 
133  sveaswait = easwait ! for safety save
134  svethin(1) = ethin(1) ! //
135  svethin(2) = ethin(2) ! //
136  call csetemin(generate2, keminobs2, cutneg, cuteg)
137  easwait = sveaswait ! restore
138  ethin(1) = svethin(1)
139  ethin(2) = svethin(2)
140 
141  rewind wdev
142 
143 ! ===================================================
144 
145  eventno = eventno + 1
146  do i = 1, noofsites
147  write(*, 1000)
148  * sngl(obssites(i).pos.depth),
149  * eventno,
150  * incident.p.code,
151  * incident.p.subcode,
152  * incident.p.charge,
153  * incident.p.fm.e,
154  * -angle.r(1),
155  * -angle.r(2),
156  * -angle.r(3)
157  1000 format(f10.3,i9,3i4,e15.5,3(1x,f12.8))
158  enddo
159 
160 
161 ! ===================================================
*Zfirst p fm *Zfirst p Zfirst p Zfirst p *Zfirst p *Zfirst pos xyz Zfirst pos xyz *Zfirst pos *Zfirst pos depth
Definition: ZavoidUnionMap.h:1
subroutine cqincident(incident, AngleAtObs)
Definition: cmkIncident.f:486
dE dx *! Nuc Int sampling table e
Definition: cblkMuInt.h:130
*Zfirst p fm *Zfirst p Zfirst p Zfirst p *Zfirst p *Zfirst pos xyz r
Definition: ZavoidUnionMap.h:1
nodes i
max ptcl codes in the kgnuc
Definition: Zcode.h:2
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
Definition: cblkElemag.h:7
subroutine csetemin(gen, eminob, emin, emCas)
Definition: ciniTracking.f:242
********************block data cblkHeavy ********************integer j data *HeavyG2symbol p
Definition: cblkHeavy.h:7
********************block data cblkHeavy ********************integer j data *HeavyG2symbol *data *HeavyG2code kiron data j
Definition: cblkHeavy.h:36
*Zfirst p fm *Zfirst p Zfirst p code
Definition: ZavoidUnionMap.h:1
*Zfirst p fm *Zfirst p Zfirst p Zfirst p *Zfirst p charge
Definition: ZavoidUnionMap.h:1
Definition: Zcoord.h:43
! 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
Definition: Zptcl.h:21
*Zfirst p fm *Zfirst p Zfirst p Zfirst p subcode
Definition: ZavoidUnionMap.h:1
Here is the call graph for this function:

◆ chookbgrun()

subroutine chookbgrun ( )

Definition at line 15 of file chookSkel.f.

References cerrormsg(), cgetfname(), cprintobs(), cprintprim(), cquhookc(), cquhooki(), cquhookr(), cwriteparam(), true, and where.

15  implicit none
16 #include "Zmanagerp.h"
17 #include "Ztrack.h"
18 #include "Zprivate.h"
19 
20  character*10 append
21  character*100 msg
22  logical ex, opn
23  integer klena
24 
25 ! namelist output
26  call cwriteparam(errorout, 0)
27 ! primary information
28  call cprintprim(errorout)
29 ! observation level information
30  call cprintobs(errorout)
31 
32 
33  call cquhooki(1, mdev) ! get skeleton memo dev #
34  call cquhooki(2, wdev) ! get working disk dev #
35 
36 
37  call cquhooki(3, ngmin) ! get Nh min
38  call cquhooki(4, nhmin) ! get Ng min
39  call cquhooki(5, where) ! where to check
40 
41  call cquhookr(1, sumegmin) ! sum E min
42  call cquhookr(2, sumehmin)
43 
44 
45 
46  call cquhookc(1, msg) ! get file name for sekelton memo
47  call cgetfname(msg, mskel) ! add host name etc if needed
48  call cquhookc(2, msg) ! get file name for working
49  call cgetfname(msg, wskel) ! add host name etc if neededn
50  call cquhookc(3, append) ! append data, if Mskel already exists
51 
52  write(msg, *) 'Skeleton is judged at obs.pos=', Where
53  call cerrormsg(msg, 1)
54  write(msg, *) ' Ngmin=',ngmin,
55  * ' SumEGmin=',sumegmin/1000.,'TeV'
56  call cerrormsg(msg, 1)
57  write(msg, *) ' Nhmin=',nhmin,
58  * ' SumEHmin=',sumehmin/1000.,'TeV'
59  call cerrormsg(msg, 1)
60 
61 !
62  inquire(file=mskel(1:klena(mskel)), opened=opn, exist=ex)
63  if(opn) then
64  call cerrormsg(mskel, 1)
65  call cerrormsg(' already opened: starange', 0)
66  elseif(ex .and.
67  * append(1:klena(append)) .eq. 'append' ) then
68  open(mdev, file=mskel, form='unformatted',status='old')
69  call cerrormsg('skeleton node info. will be appended', 1)
70 ! skip to the end of file
71  do while( .true. )
72  read(mdev, end=100)
73  enddo
74  else
75  if(ex .and.
76  * append(1:klena(append)) .ne. 'append' ) then
77  call cerrormsg(
78  * 'Old skeleton node info. file exists', 1)
79  call cerrormsg(
80  * 'but node info. will NOT be appended', 1)
81  endif
82  open(mdev, file=mskel(1:klena(mskel)), form='unformatted',
83  * status='unknown')
84  endif
85 
86  100 continue
87 
88  open(wdev, file=wskel(1:klena(wskel)), form='unformatted',
89  * status='unknown' )
90 
91  accepted = 0 ! counter; accepted as skeleton
92 !
subroutine cgetfname(fnin, fn)
Definition: copenf.f:275
subroutine cerrormsg(msg, needrtn)
Definition: cerrorMsg.f:4
subroutine cprintobs(io)
Definition: cprintObs.f:2
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
Definition: cblkElemag.h:7
subroutine cprintprim(out)
Definition: cprintPrim.f:3
subroutine cwriteparam(io, force)
Definition: cwriteParam.f:4
subroutine cquhookr(i, rv)
Definition: cqUHookr.f:2
integer function klena(cha)
Definition: klena.f:20
subroutine cquhooki(i, iv)
Definition: cqUHookr.f:15
*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 where
Definition: ZavoidUnionMap.h:1
subroutine cquhookc(i, cv)
Definition: cqUHookr.f:28
Here is the call graph for this function:

◆ chookeint()

subroutine chookeint ( integer  never)

Definition at line 379 of file chookSkel.f.

References asflag, cmemonode(), code, kelec, and p.

379  implicit none
380 
381 #include "Ztrack.h"
382 #include "Ztrackv.h"
383 #include "Zcode.h"
384 #include "Zprivate.h"
385 ! #include "Ztrackp.h"
386  integer never ! input & output
387  integer nlow
388 !
389 ! If Job = 'newskel', input "never" may be < 0, and MovedTrack
390 ! may not be an electron.
391 ! never = -1 : MovedTrack K.E becomes < KEminObs due to
392 ! energy loss during traveling.
393 ! never = -2 : The same as above, but the particle crosses an
394 ! observation depth, so the calling point to this
395 ! routine is different from the never = -1 case.
396 ! never = -3 : K.E >= KEminiObs. The ptcl is observed at the
397 ! current deepest Obs. level. but at the flesh time
398 ! the deepest level will be more deep so that
399 ! this must be memorized.
400 !
401 ! For above cases, the product is only MovedTrack and
402 ! no particle is in PWork.
403 ! Otherwise,
404 ! MovedTrack is the electron that made interaction
405 ! Pwork contains produced particles (normally gamma, but mayb e).
406 ! Nproduced has the number of particles in Pwork.
407 ! IntInfArray(ProcessNo) contains the type of interaction
408 ! IntInfArray(ProcessNo).process will have one of
409 ! 'brems', 'mscat', 'bscat' 'anihi' or 'mbrem'
410 !
411  if(never .lt. 0) then
412  nproduced = 1
413 ! IBM user must modify next
414  pwork(1) = movedtrack.p
415  endif
416 
417 ! high energy parent at node might be used
418 ! for hybrid AS generation if it is in some
419 ! energy region.
420  if( movedtrack.p.code .eq. kelec ) then
421  if( movedtrack.asflag .eq. 0 ) then
422  if( movedtrack.p.fm.p(4) .lt. ethresh ) then
423  movedtrack.asflag = -1
424  endif
425  endif
426  endif
427 
428  call cmemonode(wdev, never, 2)
429  if(movedtrack.asflag .eq. -1) then
430 ! decendent should not be used to generae A.S
431  movedtrack.asflag = -2
432  endif
433 
434  10 continue
435  never = 0
max ptcl codes in the kelec
Definition: Zcode.h:2
********************block data cblkHeavy ********************integer j data *HeavyG2symbol p
Definition: cblkHeavy.h:7
*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
Definition: ZavoidUnionMap.h:1
*Zfirst p fm *Zfirst p Zfirst p code
Definition: ZavoidUnionMap.h:1
subroutine cmemonode(dev, flag)
Definition: chookSkel.f:467
Here is the call graph for this function:

◆ chookenevent()

subroutine chookenevent ( )

Definition at line 255 of file chookSkel.f.

References cmemorize(), code, cwriteseed(), erg, kelec, kgnuc, knuc, kpion, o, p, and where.

255 
256  implicit none
257 #include "Ztrack.h"
258 #include "Zcode.h"
259 #include "Ztrackv.h"
260 #include "Zobs.h"
261 #include "Zobsp.h"
262 #include "Zobsv.h"
263 #include "Zmanagerp.h"
264 #include "Zprivate.h"
265 
266  integer i
267  integer seed(2)
268  real sumeg, sumeh
269  logical memorize
270 
271  integer ng, nh
272 
273  ng = 0
274  nh = 0
275 
276  sumeg = 0
277  sumeh =0
278 ! count sum Eg etc
279  do i = 1, np
280  if(o(i).where .eq. where) then
281  if(o(i).code .le. kelec) then
282  ng = ng + 1
283  sumeg = sumeg + o(i).erg
284  elseif( ( o(i).code .ge. kpion .and.
285  * o(i).code .le. knuc )
286  * .or.
287  * o(i).code .eq. kgnuc) then
288  nh = nh + 1
289  sumeh = sumeh + o(i).erg
290  endif
291  endif
292  enddo
293 
294 ! ===================================================
295  memorize =(ng .ge. ngmin .and. sumeg .ge. sumegmin) .or.
296  * ( nh .ge. nhmin .and. sumeh .ge. sumehmin)
297 
298 !/////
299  write(0,*) ' memo=', memorize,
300  * ' ng=',ng, ' seg=',sumeg, ' nh=',nh,' seh=',sumeh
301 !//////
302 
303 
304 ! ===================================================
305  if(memorize) then
306  accepted = accepted + 1
307  call cwriteseed ! SeedFile
308 ! flag for end of 1 event on working disk
309  write(wdev) -1, p
310  call cmemorize(wdev, mdev) ! reocord this event
311  endif
others if is ng
Definition: cblkManager.h:9
nodes i
max ptcl codes in the kgnuc
Definition: Zcode.h:2
subroutine cmemorize(from, to)
Definition: chookSkel.f:599
max ptcl codes in the kelec
Definition: Zcode.h:2
********************block data cblkHeavy ********************integer j data *HeavyG2symbol p
Definition: cblkHeavy.h:7
subroutine cwriteseed
Definition: cwriteSeed.f:15
*Zfirst p fm *Zfirst p Zfirst p code
Definition: ZavoidUnionMap.h:1
********************block data cblkHeavy ********************integer j data *HeavyG2symbol *data *HeavyG2code knuc
Definition: cblkHeavy.h:7
struct ob o[NpMax]
Definition: Zprivate.h:34
float erg[maxp]
Definition: Zprivate.h:7
int nh[nl][nth]
Definition: Zprivate.h:13
*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 where
Definition: ZavoidUnionMap.h:1
max ptcl codes in the kpion
Definition: Zcode.h:2
Here is the call graph for this function:

◆ chookenrun()

subroutine chookenrun ( )

Definition at line 319 of file chookSkel.f.

References cerrormsg(), and cprintstatus().

319  implicit none
320 #include "Ztrack.h"
321 #include "Zprivate.h"
322  character*100 msg
323 ! =========================================
324 
325 
326 ! =========================================
327  call cerrormsg('++++++++++++', 1)
328  write(msg, '(i8, a)') accepted,
329  * ' events are memorized as skeleton'
330  call cerrormsg(msg, 1)
331  call cerrormsg('their seeds are also memorized', 1)
332  call cerrormsg('-----------',1)
333  call cprintstatus ! if don't like, comment out
subroutine cerrormsg(msg, needrtn)
Definition: cerrorMsg.f:4
subroutine cprintstatus
Definition: cendRun.f:35
Here is the call graph for this function:

◆ chookgint()

subroutine chookgint ( integer  never)

Definition at line 442 of file chookSkel.f.

References cmemonode().

442  implicit none
443 
444 #include "Ztrack.h"
445 #include "Ztrackv.h"
446 #include "Zprivate.h"
447 ! #include "Ztrackp.h"
448 
449  integer never ! input & output
450 
451 ! don't make never = 1, if you want to get
452 ! information after a gamma ray made interaction
453 ! if this is made non zero, this routine will never be called.
454 !
455 ! MovedTrack is the gamma that made interaction
456 ! Pwork contains produced particles.
457 ! Nproduced has the number of particles in Pwork
458 ! IntInfArray(ProcessNo) contains the type of interaction
459 ! IntInfArray(ProcessNo).process will have one of
460 ! 'pair', 'comp', 'photoe' 'photop' 'mpair'
461  call cmemonode(wdev, 1, 1)
462  never = 0
subroutine cmemonode(dev, flag)
Definition: chookSkel.f:467
Here is the call graph for this function:

◆ chooknepint()

subroutine chooknepint ( integer  never)

Definition at line 469 of file chookSkel.f.

References cbst1(), cgeqm(), cgetcurrentstackpos(), cirot3vec(), cmemonode(), cmkptc(), code, cyeta(), kgnuc, knuc, krsetbit(), ksetbit(), mass, p, and process().

469  implicit none
470 #include "Zmaxdef.h"
471 #include "Zcode.h"
472 #include "Ztrack.h"
473 #include "Ztrackv.h"
474 #include "Ztrackp.h"
475 #include "Zstackv.h"
476 #include "Zprivate.h"
477 
478  integer never ! input & output
479 
480  type(coord):: angle
481  type(ptcl):: aptcl
482  type(track):: atrack
483  type(ptcl):: tgt, pj
484  real*8 user
485  real*4 usere(2)
486  integer*2 useri(4)
487  equivalence(user, usere(1)), (user, useri(1))
488  real*8 y, eta
489  integer i, icon
490  logical yes/.false./
491  integer stackpos
492  save
493 
494 ! never < 0 never happen
495  if( bgevent ) then
496 ! just after collision or before 1st col.
497 ! (knockon)
498  yes = ( movedtrack.p.code .eq. knuc .or.
499  * movedtrack.p.code .eq. kgnuc ) .and.
500  * intinfarray(processno).process .eq. 'coll'
501  if(yes) then
502 ! just after collision of nucleon or heavy primary
503 
504 ! copy particle property
505  incip = movedtrack.p
506 ! userE(2) is used to store Xcm of a particle
507 ! but the last bit is set if parent is pi/K
508 ! else it is reset to 0
509 ! userI(1) = eta *1000 userI(2)= y*1000.
510 !
511  bgevent = .false.
512  useri(1)=6
513  usere(2) = 1.
514  movedtrack.user = user
515  call cmkptc(6, 0, 1, tgt)
516  tgt.fm.p(1) = 0.
517  tgt.fm.p(2) = 0.
518  tgt.fm.p(3) = 0.
519  tgt.fm.p(4) = tgt.mass
520  pj = incip
521  pjcm = pj
522  call cirot3vec(1, incip, incip, pj)
523  call cgeqm(pj, tgt, cmsptcl, icon)
524  call cbst1(1, cmsptcl, pj, pjcm)
525 !////////////////
526 ! write(*,*) ' pjcm=',
527 ! * pjcm.fm.p(1), pjcm.fm.p(2), pjcm.fm.p(3)
528 !////////////
529 ! first int. product is in stack
530  call cgetcurrentstackpos(stackpos)
531 
532  do i = stackpos-nstacked+1, stackpos
533  aptcl=stack(i).p
534  call cirot3vec(1, incip, stack(i).p, aptcl)
535  call cbst1(1, cmsptcl, aptcl, aptcl)
536  call cyeta(aptcl, y, eta)
537  useri(1)=eta*1000.
538  useri(2)=y * 1000.
539 ! xcm
540  usere(2)= aptcl.fm.p(3)/pjcm.fm.p(3)
541 !/////////////////
542 ! if(aptcl.code .le. 5 .and. userE(2) .gt. -1.0) then
543 ! write(*,'(a,3i3, 4g11.3)') 'p: ', aptcl.code,
544 ! * aptcl.subcode, aptcl.charge,
545 ! * eta, y, userE(2), Stack(i).p.fm.p(4)
546 ! endif
547 !/////////////////
548 ! set ptcl code by using last bit
549  if(aptcl.code .le. 5) then
550  call ksetbit(usere(2), 1)
551  else
552  call krsetbit(usere(2), 1)
553  endif
554 ! store in stack
555  stack(i).user=user
556 
557  enddo
558  endif
559  endif
560 ! don't make never = 1, if you want to get
561 ! information after a non-e-g particle made interaction
562 ! if this is made non zero, this routine will never be called.
563 !
564 ! MovedTrack is the particle that made interaction
565 ! Pwork contains produced particles.
566 ! Nproduced has the number of particles in Pwork
567 ! IntInfArray(ProcessNo) contains the type of interaction
568 !
569  if(never .eq. 0) then
570  call cmemonode(wdev, 1, 3)
571  endif
subroutine krsetbit(i, bit)
Definition: kmanbit.f:53
subroutine cbst1(init, p1, p2, po)
Definition: cbst1.f:54
nodes i
! parameters for Elemag process(-> ---------------------------------------------- real *8 RecoilKineMinE !2 Recoil Kinetic Min Energy above which the recoil(=knock-on process) ! is treated. Below this energy, the effect is included as continuous ! energy loss. Used only if KnockOnRatio $>$ 1. ! If this is 0 or if KnockOnRatio=1, KEminObs(gamma)=KEminObs(elec) is used. ! See also KnockOnRatio. real *8 KnockOnRatio !2 KnockOnRatio *KEminoObs is used instead of RecoilKineMinE if KnockOnRatio $< $1. real *8 X0 !2 Radiation length in kg/m$^2$ for air. Normally the user should not touch this. real *8 Ecrit !2 Critical energy in GeV. \newline ! Employed only when calculating air shower size in the hybrid ! air shower generation. The value would be dependent on the ! experimental purpose. The default value, 81 MeV, is bit too ! small in many applications(The air shower size is overestimated). ! Comparisons of sizes by the hybrid method and by the full Monte ! Carlo tell that \newline ! $N_e$(full 3-D M.C) $< N_e$(hybrid AS with $E_c=81$ MeV) $< N_e$(full 1-D M.C) ! $ {\ \lower-1.2pt\vbox{\hbox{\rlap{$<$}\lower5pt\vbox{\hbox{$\sim$}}}}\ } ! N_e$(hybrid AS with $E_c={76}$ MeV) at around shower maximum. ! Hybrid AS is always essentially 1-D. logical Knockon !2 Obsolete. Don 't use this. See RecoilKineMinE ! and KnockonRatio. real *8 AnihiE !2 If E(positron) $<$ AnihiE, annihilation is considered. real *8 Es !2 Modified scattering constant. 19.3d-3 GeV real *8 MaxComptonE !2 Above this energy, Compton scattering is neglected. real *8 MaxPhotoE !2 Above this energy, photoelectric effect is neglected. real *8 MinPhotoProdE !1 Below this energy, no photo-prod of hadron. See also PhotoProd. logical PhotoProd !1 Switch. if .false., no photo prod. of hadron is considered at all. ! See also MinPhotoProdE, HowPhotoP real *8 Excom1 !2(GeV). If photon energy is<=Excom1, use XCOM data for ! compton/p.e/coherent scattering(must be< 100 GeV). real *8 Excom2 !2(GeV). If photon energy is<=Excom2, use XCOM data for ! pair creation cross-section.(must be< 100 GeV). integer Moliere !2 2$\rightarrow$ use Moliere scat.\newline ! 0$\rightarrow$ use Gaussian scattrign. \newline ! 1$\rightarrow$ use Moli\`ere scattering for non-electrons \newline ! 2$\rightarrow$ use Moli\`ere scattering for all charged ! particles. But treatment is not so rigorous as case of 3. ! \newline ! 3$\rightarrow$ use rigorus Moliere scattering. Diff. from 2 is verysmall. May be some effect in the ! core region. integer ALateCor !2 1$\rightarrow$ angular and lateral correlation is taken into account when Moliere=0 .\newline ! t$\rightarrow$ Use angular-lateral correlation by Gaussian ! approximation. No effect is seen if path length is short. !<-) ---------------------------------------------- common/Zelemagc/RecoilKineMinE
max ptcl codes in the kgnuc
Definition: Zcode.h:2
Definition: Ztrack.h:44
subroutine cgeqm(p1, p2, q, icon)
Definition: cgeqm.f:2
subroutine cirot3vec(init, p1, p2, po)
Definition: crot3vec.f:97
********************block data cblkHeavy ********************integer j data *HeavyG2symbol p
Definition: cblkHeavy.h:7
subroutine ksetbit(i, bit)
Definition: kmanbit.f:36
logical, save user
Definition: cEfield0.f:32
*Zfirst p fm *Zfirst p Zfirst p code
Definition: ZavoidUnionMap.h:1
subroutine cmemonode(dev, flag)
Definition: chookSkel.f:467
********************block data cblkHeavy ********************integer j data *HeavyG2symbol *data *HeavyG2code knuc
Definition: cblkHeavy.h:7
latitude latitude this system is used *****************************************************************! type coord sequence union map real y
Definition: Zcoord.h:25
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
Definition: cblkElemag.h:7
subroutine cmkptc(code, subcode, charge, p)
Definition: cmkptc.f:15
Definition: Zptcl.h:75
Definition: Zcoord.h:43
*Zfirst p fm *Zfirst p mass
Definition: ZavoidUnionMap.h:1
subroutine cyeta(p, y, eta)
Definition: cyeta.f:5
subroutine cgetcurrentstackpos(stackpos)
Definition: cstack.f:84
Here is the call graph for this function:

◆ chookobs()

subroutine chookobs ( type(track aTrack,
integer  id 
)

Definition at line 170 of file chookSkel.f.

References cerrormsg(), charge, code, coszenith, erg, kneue, kneumu, mass, ng, nth, o, p, r, subcode, t, wgt, x, xyz, and y.

170 !
171 ! Note that every real variable is in double precision so
172 ! that you may output it in sigle precision to save the memory.
173 ! In some cases it is essential to put it in sigle (say,
174 ! for gnuplot).
175 !
176  implicit none
177 #include "Zcode.h"
178 #include "Ztrack.h"
179 #include "Zprivate.h"
180  integer id ! input. 2 ==> reached at an observation level
181 ! 1 ==> aTrack is going out from
182 ! outer boundery.
183 ! 2 ==> reached at an observation level
184 ! 3 ==> reached at inner boundery.
185  type(track):: atrack
186 !
187 ! For id =2, you need not output the z value, because it is always
188 ! 0 (within the computational accuracy).
189 !
190 ! ===================================================
191  common /testcos/sumg, ng(20), nth, eventno
192  real*8 sumg
193  integer ng, nth, eventno
194 
195 ! ===================================================
196  real*8 user
197  real*4 usere(2)
198  integer*2 useri(4)
199  equivalence(user, usere(1)), (user, useri(1))
200  save
201 
202 
203  if( id .eq. 2 .and. atrack.p.code .ne. kneumu .and.
204  * atrack.p.code .ne. kneue) then
205  np = np + 1
206  if( np .gt. npmax) then
207  call cerrormsg(
208  * '# of particles >NpMax in observation', 0)
209  endif
210  o(np).where = atrack.where
211  o(np).code = atrack.p.code
212  o(np).subcode = atrack.p.subcode
213  o(np).charge = atrack.p.charge
214  o(np).atime = atrack.t
215  o(np).erg = atrack.p.fm.p(4)
216  o(np).mass = atrack.p.mass
217  o(np).x = atrack.pos.xyz.r(1)
218  o(np).y = atrack.pos.xyz.r(2)
219  o(np).wx =atrack.vec.w.r(1)
220  o(np).wy =atrack.vec.w.r(2)
221  o(np).wz =atrack.vec.w.r(3)
222  o(np).zenith = atrack.vec.coszenith
223  o(np).wgt = atrack.wgt
224  o(np).user = atrack.user
225 ! ===================================================
226  if(o(np).code .eq. 3) then
227  user=atrack.user
228  write(*, 959)
229 ! * o(Np).where,
230 ! * o(Np).code,
231 ! * o(Np).charge,
232  * ( o(np).erg - o(np).mass ),
233 ! * ( o(Np).x ), ( o(Np).y ) ,
234 ! * ( o(Np).wx ),
235 ! * ( o(Np).wy ),
236 ! * ( o(Np).wz ),
237 ! * ( o(Np).zenith ),
238  * useri(1)/1000., useri(2)/1000., usere(2)
239 
240 ! 959 format(3i3, g14.3,2f16.6,4(1x,f12.8), i3, 1pE11.3)
241  959 format(3g14.3,e11.3)
242  endif
243 
244 ! ===================================================
245  endif
246 ! ===================================================
247 
248 ! ===================================================
subroutine cerrormsg(msg, needrtn)
Definition: cerrorMsg.f:4
others if is ng
Definition: cblkManager.h:9
*Zfirst p fm *Zfirst p Zfirst p Zfirst p *Zfirst p *Zfirst pos xyz r
Definition: ZavoidUnionMap.h:1
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
Definition: Zcoord.h:25
Definition: Ztrack.h:44
max ptcl codes in the kneue
Definition: Zcode.h:2
!onst int nth
Definition: Zprivate.h:2
********************block data cblkHeavy ********************integer j data *HeavyG2symbol p
Definition: cblkHeavy.h:7
logical, save user
Definition: cEfield0.f:32
*Zfirst p fm *Zfirst p Zfirst p code
Definition: ZavoidUnionMap.h:1
struct ob o[NpMax]
Definition: Zprivate.h:34
max ptcl codes in the kneumu
Definition: Zcode.h:2
latitude latitude this system is used *****************************************************************! type coord sequence union map real y
Definition: Zcoord.h:25
*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 coszenith
Definition: ZavoidUnionMap.h:1
float erg[maxp]
Definition: Zprivate.h:7
*Zfirst p fm *Zfirst p Zfirst p Zfirst p *Zfirst p charge
Definition: ZavoidUnionMap.h:1
nodes t
*Zfirst p fm *Zfirst p mass
Definition: ZavoidUnionMap.h:1
*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
Definition: ZavoidUnionMap.h:1
! 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
Definition: Zptcl.h:21
*Zfirst p fm *Zfirst p Zfirst p Zfirst p subcode
Definition: ZavoidUnionMap.h:1
Here is the call graph for this function:

◆ chooktrace()

subroutine chooktrace ( )

Definition at line 344 of file chookSkel.f.

References height.

344  implicit none
345 
346 #include "Ztrack.h"
347 #include "Ztrackv.h"
348 #include "Ztrackp.h"
349 #include "Zobs.h"
350 #include "Zobsv.h"
351 
352  real*4 h1, h2
353 !
354 ! Every time a particle is moved in the atmosphere, this routine is called,
355 ! if trace > 100
356 ! For a one track segment,
357 ! TrackBefMove has track information at the beginning of the segment.
358 ! MoveTrack has track information at the end of the segment.
359 !
360 ! You can know the information a track contains in the
361 ! chookObs routine. (Note however, no conversion of coordinate
362 ! has been done. The values are in the Earth xyz system.)
363 ! Besides quantities explained there, you can use, for a given 'track'
364 !
365 ! atrack.pos.xyz.x, atrack.pos.xyz.y, atrack.pos.xyz.z (x,y.z)
366 ! atrack.pos.radiallen (distance from the center of the earth)
367 ! atrack.pos.depth (vertical depth)
368 ! atrack.pos.height (vertical heigth from sea level)
369 !
370 
371  h1 = trackbefmove.pos.height- obssites(noofsites).pos.height
372  h2 = movedtrack.pos.height - obssites(noofsites).pos.height
373 
*Zfirst p fm *Zfirst p Zfirst p Zfirst p *Zfirst p *Zfirst pos xyz Zfirst pos xyz *Zfirst pos *Zfirst pos Zfirst pos height
Definition: ZavoidUnionMap.h:1

◆ cmemonode()

subroutine cmemonode ( integer  dev,
integer  flag,
integer  neporeg 
)

Definition at line 575 of file chookSkel.f.

References asflag, c, cbst1(), charge, cirot3vec(), code, colheight, coszenith, cyeta(), depth, erg, height, kelec, krsetbit(), ksetbit(), mass, p, r, subcode, t, and xyz.

575  implicit none
576 #include "Zcode.h"
577 #include "Ztrack.h"
578 #include "Ztrackv.h"
579 #include "Ztrackp.h"
580 #include "Zprivate.h"
581 !
582  integer dev ! input. fortran logical dev. number for data write
583  integer flag ! input. If this is -3, high energy particles must
584  ! also be memorized.
585  integer neporeg ! input 1; from g 2 from e; 3 from NEP
586 !
587 !
588 ! memorize nodal information at interaction.
589 !
590 ! \
591 ! \ projectile = MovedTrack
592 ! /|\ produced particles.: Pwork(i), i=1~Nproduced
593 ! / | \
594 !
595 ! From projectile, the track information is extracted
596 ! From produced particles, only those of K.E< KEminObs is
597 ! extracted and information needed for further tracking is
598 ! obtaned and memorized. The position information is common
599 ! to all the children.
600 !
601 ! Track information; pos =
602 ! xyz = r(1~3), sys
603 ! radiallen, depth, height, colheight
604 ! t
605 ! vec =
606 ! w = r(1~3), sys
607 ! coszenith
608 ! wgt
609 ! where
610 ! asflag
611 !
612 ! Among these, we don't memorize
613 ! sys which is always 'xyz'
614 ! radiallen: can be computed from height
615 ! vec; children knows their direction
616 ! wgt: normally not needed, it should be 1 for skeleton making
617 ! So thinsamping must not be used when making skeleton.
618 ! asflag: should be always F, (assume for skeleton making, hybrid
619 ! air shower is not requested)
620 !
621 ! write track info. of projectile
622 !
623  integer i, nlow
624  real*8 ke
625  real*8 y, eta
626  real*8 user
627  real*4 usere(2)
628  integer*2 useri(4)
629  equivalence(user, usere(1)), (user, useri(1))
630  type(ptcl):: aptcl
631  save
632 
633 !
634 !
635  nlow = 0
636  do i = 1, nproduced
637  ke = pwork(i).fm.p(4) - pwork(i).mass
638  if( ( pwork(i).code .le. kelec .and.
639  * ke .ge. cuteg ) .or.
640  * ( pwork(i).code .gt. kelec .and.
641  * ke .ge. cutneg ) ) then
642 ! count low energy ptcls
643  if(flag .ne. -3) then
644  if( ke .lt. keminobs) then
645  nlow = nlow + 1
646  endif
647  else
648 ! all ptcl must be memorized
649  nlow = nlow + 1
650  endif
651  endif
652  enddo
653 ! next is harmful for B-approx air shower
654 ! because, parent is not memorized and cannot
655 ! generate AS at flesh time at proper positon
656 ! asflag == -1 must apear in flesh
657 ! if(nlow .eq. 0 ) return ! *************
658 ! if there is no return here, the size of skeleton data
659 ! becomes 3.2 times larger
660 
661  if(nlow .eq. 0 .and. movedtrack.asflag .ne. -1) return
662 
663 
664  p.posx = movedtrack.pos.xyz.r(1)
665  p.posy = movedtrack.pos.xyz.r(2)
666  p.posz = movedtrack.pos.xyz.r(3)
667  p.depth = movedtrack.pos.depth
668  p.height = movedtrack.pos.height
669  if( movedtrack.pos.colheight .gt. 1.e36) then
670  p.colheight = 1.e36 ! no col. yet.
671  else
672  p.colheight = movedtrack.pos.colheight
673  endif
674  p.atime = movedtrack.t
675  p.where = movedtrack.where
676  p.coszenith = movedtrack.vec.coszenith
677  p.code = movedtrack.p.code
678  p.erg = movedtrack.p.fm.p(4)
679  p.asflag = movedtrack.asflag
680  p.user = movedtrack.user
681 
682 !c
683 !c * p.posx, p.posy, p.posz, p.depth, p.height,
684 !c * p.colHeight, p.atime, p.where
685 !c
686 ! write particle info
687 ! p(1~4)
688 ! mass
689 ! code
690 ! subcode
691 ! charge
692 !
693 
694 
695  write(dev) nlow, p
696 
697  do i = 1, nproduced
698  ke = pwork(i).fm.p(4) - pwork(i).mass
699  if( ( pwork(i).code .le. kelec .and.
700  * ke .ge. cuteg ) .or.
701  * ( pwork(i).code .gt. kelec .and.
702  * ke .ge. cutneg ) ) then
703  if(flag .eq. -3 .or. ke .lt. keminobs) then
704  c.code = pwork(i).code
705  c.subcode = pwork(i).subcode
706  c.charge = pwork(i).charge
707  c.fm(1) = pwork(i).fm.p(1)
708  c.fm(2) = pwork(i).fm.p(2)
709  c.fm(3) = pwork(i).fm.p(3)
710  c.fm(4) = pwork(i).fm.p(4)
711  c.mass = pwork(i).mass
712  if(bgevent .and. neporeg .eq. 3 ) then
713  aptcl = pwork(i)
714  call cirot3vec(1, incip, pwork(i), aptcl)
715  call cbst1(1, cmsptcl, aptcl, aptcl)
716  call cyeta(aptcl, y, eta)
717  useri(1)=eta*1000.
718  useri(2)=y * 1000.
719 ! xcm
720  usere(2)= aptcl.fm.p(3)/pjcm.fm.p(3)
721 ! set ptcl code by using last bit
722  if(pwork(i).code .le. 5) then
723  call ksetbit(usere(2), 1)
724  else
725  call krsetbit(usere(2), 1)
726  endif
727  c.user = user
728 !////////////////////
729 ! if(userE(2) .gt. -1. .and.
730 ! * Pwork(i).code .le. 5) then
731 ! write(*,'(a,3i3, 4g11.3)')
732 ! * 'l: ', Pwork(i).code, Pwork(i).subcode,
733 ! * Pwork(i).charge,
734 ! * eta, y, userE(2), Pwork(i).fm.p(4)
735 ! endif
736 !/////////////////
737  else
738  c.user = p.user
739  endif
740  write(dev) c
741  endif
742  endif
743  enddo
*Zfirst p fm *Zfirst p Zfirst p Zfirst p *Zfirst p *Zfirst pos xyz Zfirst pos xyz *Zfirst pos *Zfirst pos depth
Definition: ZavoidUnionMap.h:1
subroutine krsetbit(i, bit)
Definition: kmanbit.f:53
subroutine cbst1(init, p1, p2, po)
Definition: cbst1.f:54
*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
Definition: ZavoidUnionMap.h:1
*Zfirst p fm *Zfirst p Zfirst p Zfirst p *Zfirst p *Zfirst pos xyz r
Definition: ZavoidUnionMap.h:1
nodes i
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
Definition: Zcoord.h:25
max ptcl codes in the kelec
Definition: Zcode.h:2
subroutine cirot3vec(init, p1, p2, po)
Definition: crot3vec.f:97
********************block data cblkHeavy ********************integer j data *HeavyG2symbol p
Definition: cblkHeavy.h:7
subroutine ksetbit(i, bit)
Definition: kmanbit.f:36
logical, save user
Definition: cEfield0.f:32
*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
Definition: ZavoidUnionMap.h:1
*Zfirst p fm *Zfirst p Zfirst p code
Definition: ZavoidUnionMap.h:1
integer maxn LabEquivE real * ke(maxn) integer indx(maxn) integer nevent integer outzero
*Zfirst p fm *Zfirst p Zfirst p Zfirst p *Zfirst p *Zfirst pos xyz Zfirst pos xyz *Zfirst pos *Zfirst pos Zfirst pos height
Definition: ZavoidUnionMap.h:1
latitude latitude this system is used *****************************************************************! type coord sequence union map real y
Definition: Zcoord.h:25
*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 coszenith
Definition: ZavoidUnionMap.h:1
float erg[maxp]
Definition: Zprivate.h:7
*Zfirst p fm *Zfirst p Zfirst p Zfirst p *Zfirst p charge
Definition: ZavoidUnionMap.h:1
nodes t
Definition: Zptcl.h:75
*Zfirst p fm *Zfirst p mass
Definition: ZavoidUnionMap.h:1
subroutine cyeta(p, y, eta)
Definition: cyeta.f:5
*Zfirst p fm *Zfirst p Zfirst p Zfirst p subcode
Definition: ZavoidUnionMap.h:1
dE dx *! Nuc Int sampling table c
Definition: cblkMuInt.h:130
Here is the call graph for this function:

◆ cmemorize()

subroutine cmemorize ( integer  from,
integer  to 
)

Definition at line 748 of file chookSkel.f.

References cputhes(), cputnodinfo(), cqeventno(), cqinirn(), depth, and height.

748  implicit none
749 #include "Ztrack.h"
750 #include "Ztrackv.h"
751 
752  integer from ! working disk file
753  integer to ! permanent disk file where skeleton is sotered
754 
755 
756 
757 
758  integer num, cumnum, irevent(2)
759 ! type(track):: incident
760 ! type(coord):: angle
761 
762 
763  rewind from
764 ! need not memorize, can be generated at flesh
765 ! call cqIncident(incident, angle)
766 
767  call cqeventno(num, cumnum)
768 
769  call cqinirn(irevent) ! seed of the event
770 
771  write(to) cumnum, num, irevent, zfirst
772  call cputhes(to) ! put high energy showers.
773  write(0,*) ' first Z=',zfirst.pos.depth*0.1, ' g/cm2',
774  * zfirst.pos.height, ' m'
775 
776  call cputnodinfo(from, to) ! put nordal info.
777 
*Zfirst p fm *Zfirst p Zfirst p Zfirst p *Zfirst p *Zfirst pos xyz Zfirst pos xyz *Zfirst pos *Zfirst pos depth
Definition: ZavoidUnionMap.h:1
subroutine cputhes(to)
Definition: chookSkel.f:630
subroutine cputnodinfo(from, to)
Definition: chookSkel.f:647
real(8), dimension(:,:,:,:), allocatable, save num
Definition: chook.f:40
integer maxbin nregion c minsave drx2 ! drawing region real maxdep integer maxpos integer to
Definition: Zfit.h:15
*Zfirst p fm *Zfirst p Zfirst p Zfirst p *Zfirst p *Zfirst pos xyz Zfirst pos xyz *Zfirst pos *Zfirst pos Zfirst pos height
Definition: ZavoidUnionMap.h:1
subroutine cqeventno(num, cumnum)
Definition: cqEventNo.f:3
subroutine cqinirn(ir)
Definition: cwriteSeed.f:4
integer maxbin nregion c minsave drx2 ! drawing region real maxdep integer maxpos integer from
Definition: Zfit.h:15
Here is the call graph for this function:

◆ cputhes()

subroutine cputhes ( integer  to)

Definition at line 781 of file chookSkel.f.

References o.

781  implicit none
782 #include "Ztrack.h"
783 #include "Zprivate.h"
784  integer to
785 !
786 ! write high energy sekeleton data into 'to'
787 !
788  integer i
789 
790  write(to) np
791 
792  do i = 1, np
793  write(to) o(i)
794  enddo
795 
nodes i
integer maxbin nregion c minsave drx2 ! drawing region real maxdep integer maxpos integer to
Definition: Zfit.h:15
struct ob o[NpMax]
Definition: Zprivate.h:34

◆ cputnodinfo()

subroutine cputnodinfo ( integer  from,
integer  to 
)

Definition at line 799 of file chookSkel.f.

References c, and p.

799  implicit none
800 #include "Ztrack.h"
801 #include "Zprivate.h"
802 
803  integer from, to
804 
805  integer i, nlow
806 
807  nlow = 1
808  do while ( nlow .ge. 0 )
809  read(from) nlow, p
810  write(to) nlow, p
811  do i = 1, nlow
812  read(from) c
813  write(to) c
814  enddo
815  enddo
816 
nodes i
********************block data cblkHeavy ********************integer j data *HeavyG2symbol p
Definition: cblkHeavy.h:7
integer maxbin nregion c minsave drx2 ! drawing region real maxdep integer maxpos integer to
Definition: Zfit.h:15
integer maxbin nregion c minsave drx2 ! drawing region real maxdep integer maxpos integer from
Definition: Zfit.h:15
dE dx *! Nuc Int sampling table c
Definition: cblkMuInt.h:130