COSMOS v7.655  COSMOSv7655
(AirShowerMC)
chookSkel.f
Go to the documentation of this file.
1 ! This one is for getting
2 ! Xcm, eta, y and ptcl code, at the first collision,
3 ! which generated observed muons.c
4 !
5 #include "cmain.f"
6 #include "chookHybAS.f"
7 #include "ctemplCeren.f"
8 !
9 ! *************************************** hook for Beginning of a Run
10 ! * At this moment, all (system-level) initialization for this run
11 ! * has been ended. After this routine is executed, the system goes into the
12 ! * event creation loop.
13 ! *
14  subroutine chookbgrun
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 !
93  end
94 
95 
96 ! *********************************** hook for Beginning of 1 event
97 ! * All system-level initialization for 1 event generation has been
98 ! * eneded at this moment.
99 ! * After this is executed, event generation starts.
100 ! *
101  subroutine chookbgevent
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 ! ===================================================
162  end
163 
164 
165 ! ************************************ hook for observation
166 ! * One particel information is brought here by the system.
167 ! * All information of the particle is in aTrack
168 ! *
169  subroutine chookobs(aTrack, id)
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 ! ===================================================
249  end
250 
251 ! *********************************** hook for end of 1 vent
252 ! * At this moment, 1 event generation has been ended.
253 ! *
254  subroutine chookenevent
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
312  end
313 
314 
315 ! ********************************* hook for end of a run
316 ! * all events have been created or time lacks
317 ! *
318  subroutine chookenrun
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
334  end
335 ! ********************************* hook for trace
336 ! * This is called only when trace > 100
337 ! * User should manage the trace information here.
338 ! * If you use this, you may need some output for trace
339 ! * at the beginning of 1 event generatio and at the end of 1 event
340 ! * generation so that you can identfy each event.
341 ! *
342 ! *
343  subroutine chooktrace
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 
374  end
375 ! ********************* this is the hook called when
376 ! an electron made an interaction.
377 !
378  subroutine chookeint(never)
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
436  end
437 
438 ! ********************* this is the hook called when
439 ! a gamma ray made an interaction.
440 !
441  subroutine chookgint(never)
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
463  end
464 
465 ! ********************* this is the hook called when
466 ! non e-g particle made an interaction.
467 !
468  subroutine chooknepint(never)
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
572  end
573 
574  subroutine cmemonode(dev, flag, neporeg)
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
744  end
745 
746 !
747  subroutine cmemorize(from, to)
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 
778  end
779 
780  subroutine cputhes(to)
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 
796  end
797 
798  subroutine cputnodinfo(from, to)
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 
817  end
818 
819 
subroutine cgetfname(fnin, fn)
Definition: copenf.f:275
*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 cerrormsg(msg, needrtn)
Definition: cerrorMsg.f:4
subroutine cprintobs(io)
Definition: cprintObs.f:2
subroutine cqincident(incident, AngleAtObs)
Definition: cmkIncident.f:486
subroutine krsetbit(i, bit)
Definition: kmanbit.f:53
subroutine cbst1(init, p1, p2, po)
Definition: cbst1.f:54
subroutine chookgint(never)
Definition: chook.f:191
subroutine cputhes(to)
Definition: chookSkel.f:630
subroutine cputnodinfo(from, to)
Definition: chookSkel.f:647
dE dx *! Nuc Int sampling table e
Definition: cblkMuInt.h:130
others if is ng
Definition: cblkManager.h:9
*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
! 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
subroutine cmemorize(from, to)
Definition: chookSkel.f:599
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
subroutine chookenrun
Definition: chook.f:147
Definition: Ztrack.h:44
max ptcl codes in the kelec
Definition: Zcode.h:2
subroutine chooknepint(never)
Definition: chook.f:219
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
max ptcl codes in the kneue
Definition: Zcode.h:2
!onst int nth
Definition: Zprivate.h:2
subroutine chookenevent
Definition: chook.f:116
subroutine cgeqm(p1, p2, q, icon)
Definition: cgeqm.f:2
subroutine cwriteparam(io, force)
Definition: cwriteParam.f:4
subroutine cirot3vec(init, p1, p2, po)
Definition: crot3vec.f:97
subroutine csetemin(gen, eminob, emin, emCas)
Definition: ciniTracking.f:242
********************block data cblkHeavy ********************integer j data *HeavyG2symbol p
Definition: cblkHeavy.h:7
subroutine ksetbit(i, bit)
Definition: kmanbit.f:36
subroutine cwriteseed
Definition: cwriteSeed.f:15
subroutine cquhookr(i, rv)
Definition: cqUHookr.f:2
*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 chooktrace
Definition: chook.f:275
subroutine cmemonode(dev, flag)
Definition: chookSkel.f:467
********************block data cblkHeavy ********************integer j data *HeavyG2symbol *data *HeavyG2code knuc
Definition: cblkHeavy.h:7
struct ob o[NpMax]
Definition: Zprivate.h:34
max ptcl codes in the kneumu
Definition: Zcode.h:2
*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
subroutine cqeventno(num, cumnum)
Definition: cqEventNo.f:3
*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
subroutine chookobs(aTrack, id)
Definition: chook.f:59
subroutine chookbgevent
Definition: chook.f:39
subroutine cquhooki(i, iv)
Definition: cqUHookr.f:15
subroutine cmkptc(code, subcode, charge, p)
Definition: cmkptc.f:15
subroutine cqinirn(ir)
Definition: cwriteSeed.f:4
nodes t
*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
Definition: Zptcl.h:75
Definition: Zcoord.h:43
*Zfirst p fm *Zfirst p mass
Definition: ZavoidUnionMap.h:1
subroutine cprintstatus
Definition: cendRun.f:35
subroutine chookbgrun
Definition: chook.f:15
max ptcl codes in the kpion
Definition: Zcode.h:2
subroutine cyeta(p, y, eta)
Definition: cyeta.f:5
*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
subroutine cgetcurrentstackpos(stackpos)
Definition: cstack.f:84
subroutine chookeint(never)
Definition: chook.f:162
! 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
dE dx *! Nuc Int sampling table c
Definition: cblkMuInt.h:130