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

Go to the source code of this file.

Functions/Subroutines

subroutine cmkincident (incident, fin)
 
subroutine cresetposang (incident)
 
subroutine cresetprim (incidentp, angle)
 
subroutine cresetprim2 (incident)
 
subroutine cmkinc (incident, angle)
 
subroutine cmkinc2 (incident)
 
subroutine csetmintime (from)
 
subroutine cqincident (incident, AngleAtObs)
 
subroutine cuonsphere (ini, rin, teta, phi, oa1, oa2, pos)
 
subroutine cifcutoff (icon)
 

Function/Subroutine Documentation

◆ cifcutoff()

subroutine cifcutoff ( integer  icon)

Definition at line 556 of file cmkIncident.f.

References cerrormsg(), cos, cqincident(), crigcut(), d0, kdir2deg(), pi, and rndc().

Referenced by __testsampprim.f__(), and cmkincident().

556  implicit none
557 #include "Zglobalc.h"
558 #include "Zobs.h"
559 #include "Zobsp.h"
560 #include "Zcode.h"
561 #include "Ztrack.h"
562 #include "ZrigCut.h"
563 
564  integer icon ! output. 0 ==> not cut. 1 ==> cut.
565 
566  type(coord)::angleatob
567  type(track)::inc
568 
569  real*8 p, rig, zen, azm, theta, prob, u
570 
571  call cqincident(inc, angleatob)
572 
573  if(inc%p%charge .eq. 0) then
574  icon = 0
575  else
576  if(rdatafmt .le. 4) then
577 ! angleatOb is down going ptcl's one, change sign
578  angleatob%r(1) = - angleatob%r(1)
579  angleatob%r(2) = - angleatob%r(2)
580  angleatob%r(3) = - angleatob%r(3)
581 ! convert to theta fai in deg
582  call kdir2deg(angleatob%r(1), angleatob%r(2),
583  * angleatob%r(3), theta, azm)
584 !
585 ! azm is given from the current x-axis (+ is counter
586 ! clock wise) The x-axis is XaxisFromSouth
587 ! degrees from the south in counter clockwise.
588 ! convert azm so that measured from the south
589 !
590  azm = mod(azm+ xaxisfromsouth, 360.d0)
591  if(zenvalue .eq. 'cos') then
592 ! table zenith is in cos
593  zen = angleatob%r(3)
594  else
595  zen = theta
596  endif
597  elseif(rdatafmt .eq. 5) then
598 ! in this case, azm is longitude; zen is latitude or cos(lati)
599 !
600 ! zen = atan2( inc.pos.xyz.z,
601 ! * sqrt(inc.pos.xyz.x**2+inc.pos.xyz.y**2) )
602  zen = atan2( inc%pos%xyz%r(3),
603  * sqrt(inc%pos%xyz%r(1)**2+inc%pos%xyz%r(2)**2) )
604  if(zenvalue .eq. 'cos') then
605  zen = cos( zen-pi/2.0d0 )
606  else
607  zen = zen*todeg
608  endif
609 ! azm = atan2(inc.pos.xyz.y, inc.pos.xyz.x)*Todeg
610  azm = atan2(inc%pos%xyz%r(2), inc%pos%xyz%r(1))*todeg
611  else
612  call cerrormsg('dataformat for cut off invalid',0)
613  endif
614 
615  p = sqrt(inc%p%fm%p(4)**2 - inc%p%mass**2)
616  rig = p/abs(inc%p%charge)
617  call crigcut(azm, zen, rig, prob)
618  call rndc(u)
619  if(u .lt. prob) then
620  icon = 0
621  else
622  icon = 1
623  endif
624  endif
subroutine cerrormsg(msg, needrtn)
Definition: cerrorMsg.f:4
subroutine cqincident(incident, AngleAtObs)
Definition: cmkIncident.f:486
! for length to thickness conversion or v v ! integer maxnodes real Hinf ! This is used when making table for dim simulation ! The slant length for vertical height to km is ! divided by LenStep m steps ! It can cover the slant length of about km for cos
Definition: Zatmos.h:8
subroutine crigcut(azmin, zen, rig, prob)
Definition: crigCut.f:6
Definition: Ztrack.h:44
subroutine rndc(u)
Definition: rnd.f:91
********************block data cblkHeavy ********************integer j data *HeavyG2symbol p
Definition: cblkHeavy.h:7
block data cblkEvhnp ! currently usable models data RegMdls ad *special data *Cekaon d0
Definition: cblkEvhnp.h:5
! constants thru Cosmos real * pi
Definition: Zglobalc.h:2
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 * theta
Definition: Zcoord.h:25
Definition: Zcoord.h:43
real zen
Definition: Zflux.h:1
subroutine kdir2deg(dx, dy, dz, theta, fai)
Definition: kdir2deg.f:19
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cmkinc()

subroutine cmkinc ( type(track incident,
type(coord angle 
)

Definition at line 246 of file cmkIncident.f.

References ce2p(), cerrormsg(), csetdircos(), csetmintime(), csetpos(), ctransvectzx(), kgnuc, notused, perpendicular, and spherical.

Referenced by __testsampprim.f__(), cmkincident(), and cresetprim().

246  implicit none
247 !
248 #include "Zglobalc.h"
249 #include "Ztrack.h"
250 #include "Ztrackv.h"
251 #include "Ztrackp.h"
252 #include "Zobs.h"
253 #include "Zobsp.h"
254 #include "Zobsv.h"
255 #include "Zincidentp.h"
256 #include "Zincidentv.h"
257 #include "Zearth.h"
258 #include "Zcode.h"
259  type(track)::incident ! input/outut.
260 ! must have E, m, code, subcode, charge
261  type(coord)::angle ! input. must have direction cos in the det. sys.
262  type(coord)::xyz
263 !
264 !
265  real*8 to100km, clenbetween2h, zenithcos, len
266  integer i, j
267 
268  angleatobscopy = angle
269  if(reverse .ne. 0 ) then
270 ! to see cut off or to see if go out of Earth
271  do i = 1, 3
272  angleatobscopy%r(i) = - angleatobscopy%r(i)
273  enddo
274 ! charge conjugate
275  incident%p%charge = -incident%p%charge
276  if(incident%p%code .ne. kgnuc) then
277  incident%p%subcode = -incident%p%subcode
278  endif
279  endif
280 ! convert it to 'xyz' system
281  call ctransvectzx(1, detzaxis, detxaxis, angleatobscopy,
282  * dcatobsxyz)
283 !
284  incident%pos%xyz%sys = 'xyz' ! Exyz system
285 ! --- fix injection point ---
286 ! get length from the deepest obs. place + OffsetHeight to
287 ! HeightOfInj (=100 km); Normally OffsetHeight is 0.
288 ! if the primary is to be directed to different height
289 ! than the detector, make it non zero.
290  zenithcos = - angleatobscopy%r(3)
291  if(obsplane .ne. spherical) then
292  to100km = clenbetween2h(
293  * obssites(noofsites)%pos%radiallen + offsetheight,
294  * eradius + heightofinj, zenithcos ) ! we need zenith angle here
295  else
296 ! dummy
297  to100km = 10000.
298  endif
299 
300 ! primary is going upward even if Reverse = 0.
301  upgoing = reverse .eq. 0 .and. zenithcos .lt. 0.
302  * .and. heightofinj .lt. obssites(noofsites)%pos%height
303 
304  if(( reverse .eq. 0 .and. zenithcos .lt. 0.
305  * .and. heightofinj .gt. obssites(noofsites)%pos%height)
306  * .or. ( reverse .ne. 0 .and. zenithcos .gt. 0.)) then
307  if(obsplane .ne. spherical) then
308 ! distance to the conjugate point
309  to100km = to100km -
310  * 2*(obssites(noofsites)%pos%radiallen + offsetheight)*
311  * zenithcos
312 ! we should go reversed direction
313  to100km = - to100km
314  endif
315  endif
316 ! injection point
317  do i = 1, 3
318  incident%pos%xyz%r(i) = obssites(noofsites)%pos%xyz%r(i)
319  * + offset%r(i) + to100km * dcatobsxyz%r(i)
320  enddo
321  call csetpos(incident%pos)
322  call csetdircos(dcatobsxyz, incident) ! set dc and coszenith in incident
323 ! momentum business
324  call ce2p(incident) ! px, py, pz from direction cos
325 
326 ! set time 0
327  incident%t = 0.
328  incident%wgt = 1. ! weight is 1.
329 
330 
331  do i = 1, noofsites
332 ! correction for Perpendicular : 2004/07/19
333  if( obsplane .eq. perpendicular ) then
334 ! fixing incident.where later.
335  elseif( obsplane .ne. notused ) then
336  if( heightofinj .gt. obssites(i)%pos%height ) then
337  incident%where = i
338  goto 222
339  endif
340  endif
341  enddo
342  if(heightofinj .lt. borderheightl) then
343  call cerrormsg('Injection height is < BorderHeightL',0)
344  endif
345  incident%where = noofsites + 1
346  222 continue
347  if(heightofinj .gt. borderheighth) then
348  call cerrormsg('Injection height is > BorderHeightH',0)
349  endif
350 
351 
352  incident%asflag = 0
353  incident%pos%colheight = infty ! latest nuc. collision height
354  incidentcopy = incident
355 
356 ! shift the origin of detectors to be on the primary track
357 ! if OffsetHight=0
358  if(offsetheight .eq. 0. .and. obsplane .ne. spherical) then
359  if(zenithcos .ge. 0. .or. upgoing) then
360  do i = 1, noofsites-1
361  len = clenbetween2h(
362  * obssites(noofsites)%pos%radiallen,
363  * obssites(i)%pos%radiallen,
364  * zenithcos )
365 
366  do j = 1, 3
367  obssites(i)%pos%xyz%r(j) =
368  * obssites(noofsites)%pos%xyz%r(j)
369  * + len * dcatobsxyz%r(j)
370 
371  enddo
372  enddo
373  do i = 1, noofassites-1
374  len = clenbetween2h(
375  * asobssites(noofassites)%pos%radiallen,
376  * asobssites(i)%pos%radiallen,
377  * zenithcos )
378  do j =1 , 3
379  asobssites(i)%pos%xyz%r(j) =
380  * asobssites(noofsites)%pos%xyz%r(j)
381  * + len * dcatobsxyz%r(j)
382  enddo
383  enddo
384  endif
385  endif
386 ! compute min time from the injection point to each
387 ! obs level.
388  if(obsplane .ne. spherical) then
389  call csetmintime(incident)
390  if(heightofinj .lt. borderheightl) then
391  call cerrormsg('Injection height is < BorderHeightL',0)
392  endif
393  endif
subroutine cerrormsg(msg, needrtn)
Definition: cerrorMsg.f:4
subroutine csetmintime(from)
Definition: cmkIncident.f:448
nodes i
max ptcl codes in the kgnuc
Definition: Zcode.h:2
subroutine ce2p(aTrack)
Definition: ce2p.f:5
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
real *8 function clenbetween2h(h1, h2, cost)
Definition: catmosutil.f:138
const int notused
Definition: Zobs.h:16
Definition: Ztrack.h:44
********************block data cblkHeavy ********************integer j data *HeavyG2symbol *data *HeavyG2code kiron data j
Definition: cblkHeavy.h:36
subroutine ctransvectzx(init, zax, xax, dir1, dir2)
Definition: ctransVectZx.f:36
subroutine csetdircos(dc, aTrack)
Definition: cgetZenith.f:4
Definition: Zcoord.h:43
! Zobs h header file for observation sites definition ! integer * perpendicular
Definition: Zobs.h:4
subroutine csetpos(location)
Definition: csetPos.f:8
const int spherical
Definition: Zobs.h:19
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cmkinc2()

subroutine cmkinc2 ( type(track incident)

Definition at line 398 of file cmkIncident.f.

References ce2p(), cgetzenith(), csetpos(), and false.

Referenced by cresetprim2().

398 ! this may be used when incident is ready (
399 ! even when ObsPlane==spherical)
400 ! incident must have:
401 ! incident.p: code, subcode, mass, energy
402 ! incident.pos: xyz.r(1), xyz.r(2), xyz.r(3) in E-xyz
403 ! incident.vec: w.r(1), w.r(2), w.r(3) in E-xyz
404 ! incident.where: from which height the incident particle
405 ! crosses ?
406 ! Otheres are set here.
407 
408  implicit none
409 !
410 #include "Zglobalc.h"
411 #include "Ztrack.h"
412 #include "Ztrackv.h"
413 #include "Ztrackp.h"
414 #include "Zobs.h"
415 #include "Zobsp.h"
416 #include "Zobsv.h"
417 #include "Zincidentp.h"
418 #include "Zincidentv.h"
419 #include "Zearth.h"
420 
421  type(track)::incident ! input
422 !
423 !
424  incident%pos%xyz%sys = 'xyz' ! Exyz system
425 !
426  upgoing = .false.
427 
428  call csetpos(incident%pos)
429  call cgetzenith(incident, incident%vec%coszenith)
430 ! call csetDirCos(DcAtObsXyz, incident) ! above is o.k
431 ! momentum business
432  call ce2p(incident) ! px, py, pz from direction cos
433 
434 ! set time 0
435  incident%t = 0.
436  incident%wgt = 1. ! weight is 1.
437 
438 
439  incident%asflag = 0
440  incident%pos%colheight = infty ! latest nuc. collision height
441  incidentcopy = incident
subroutine ce2p(aTrack)
Definition: ce2p.f:5
Definition: Ztrack.h:44
subroutine cgetzenith(aTrack, cosz)
Definition: cgetZenith.f:20
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 csetpos(location)
Definition: csetPos.f:8
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cmkincident()

subroutine cmkincident ( type(track incident,
integer  fin 
)

Definition at line 5 of file cmkIncident.f.

References cifcutoff(), cmkinc(), cresetposang(), csampprimary(), csprimang(), cupdtprimc(), and spherical.

Referenced by __det2prim.f__(), __det2prim2.f__(), cbegin1ev(), and ceventloop().

5  implicit none
6 !
7 ! incident: /track/. output. incident particl with track information.
8 ! copy of it is saved as 'IncidentCopy', and can be
9 ! inquired by call cqIncident(...)
10 !
11 #include "Ztrack.h"
12 #include "Ztrackv.h"
13 #include "Zmanagerp.h"
14 #include "Zobs.h"
15 #include "Zobsp.h"
16 
17  type(track)::incident
18  integer fin ! output. if 1, no more simulation
19  type(coord)::angle
20 
21  integer icon
22 !
23 
24  icon = 1
25 
26 
27 
28  do while (icon .ne. 0)
29 ! sample energy, mass, code (mometum is not given)
30  call csampprimary(incident%p, fin)
31 ! DestEventNo is < 0; and cutoffed 1ry is counted, too
32 ! fin==1--> all events generated
33  if(fin .eq. 1) goto 10
34 
35 ! If ObsPlane != spherical, fix angle at observation level
36 ! in detector system.
37 ! If ObsPlane = spherical, do the same tentatively.
38 ! (in this case Za1ry == 'is' or 'cos' guaranteed).
39 
40  call csprimang(angle) ! angle is in det sys
41  call cmkinc(incident, angle)
42 #if LABELING > 0
43  incident%info = 0
44  incident%label = 0
45 #endif
46 !
47  if(obsplane .eq. spherical) then
48 ! reset position and angle.
49 
50  call cresetposang(incident)
51  endif
52  if(cutofffile .ne. ' ') then
53  call cifcutoff(icon)
54  else
55  icon =0
56  endif
57  if(icon .eq. 0) then
58  if(job .ne. 'newflesh') then
59 !
60 ! for newflesh, next is managed by chookBgEvent
61 !
62  eventsintherun = eventsintherun + 1
63  if(job .ne. 'flesh') then
64  eventno = eventno + 1
65  endif
66  endif
67  call cupdtprimc ! update counter for each comp.
68  ! which is not rejected.
69  elseif( desteventno(2) .lt. 0 ) then
70  if(job .ne. 'newflesh') then
71  eventsintherun = eventsintherun + 1
72  if(job .ne. 'flesh') then
73  eventno = eventno + 1
74  endif
75  endif
76  endif
77  enddo
78 
79  10 continue
Definition: Ztrack.h:44
subroutine cresetposang(incident)
Definition: cmkIncident.f:90
subroutine csprimang(dir)
Definition: csPrimAng.f:14
subroutine cmkinc(incident, angle)
Definition: cmkIncident.f:246
subroutine cupdtprimc
Definition: csampPrimary.f:48
Definition: Zcoord.h:43
subroutine csampprimary(p, fin)
Definition: csampPrimary.f:13
subroutine cifcutoff(icon)
Definition: cmkIncident.f:556
const int spherical
Definition: Zobs.h:19
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cqincident()

subroutine cqincident ( type(track incident,
type(coord AngleAtObs 
)

Definition at line 486 of file cmkIncident.f.

Referenced by cbegin1ev(), chookbgevent(), chookenevent(), chookobs(), cifcutoff(), cmintime2websec(), cqptclden(), csetmolunit(), and xbgrun().

486 ! ***************************
487  implicit none
488 #include "Ztrack.h"
489 #include "Zincidentv.h"
490  type(track)::incident
491  type(coord)::angleatobs
492  incident = incidentcopy
493  angleatobs = angleatobscopy
Definition: Ztrack.h:44
Definition: Zcoord.h:43
Here is the caller graph for this function:

◆ cresetposang()

subroutine cresetposang ( type(track incident)

Definition at line 90 of file cmkIncident.f.

References c3dv2ddcos(), cerrormsg(), coszenith, cresetprim2(), cscalerprod(), ctranscoord2(), ctransvectz(), cuonsphere(), d0, false, kcossn(), ksamplin(), rndc(), and true.

Referenced by cmkincident().

90  implicit none
91 ! After doing tentative business for energy, angle and
92 ! incident position for ObsPlnae != spherical, this is
93 ! is used to reset incident position and angle for
94 ! spherical case.
95 !
96 ! The incident position is uniform around a point given by the
97 ! (Latit, Longit, HeightOfInj)=PolarInjPos. It will be distributed
98 ! within the half opnenig angle range given by Azimuth.
99 ! (if it is > 180, regarded as 180. Hence, if Azimuth=(45,90),
100 ! incident position will be a ring like region on a
101 ! sphere.)
102 ! As to the zenith angle at the incident position,
103 ! it is determined isotropically from CosZenith. Azimuth is
104 ! not used for this purpose. Therefore, if zenith angle >= 90,
105 ! we will discard such particles. Hence, Imag(CosZenith)
106 ! must be > 0.
107 !
108 !
109 #include "Zglobalc.h"
110 #include "Ztrack.h"
111 #include "Ztrackp.h"
112 #include "Zobs.h"
113 #include "Zobsv.h"
114 #include "Zincidentp.h"
115 
116 !
117  type(track)::incident ! input/output.
118  type(coord)::incipos
119  type(coord)::dir1
120  type(coord)::dir2
121  logical first
122  real*8 len, cs, sn, sint, u, oa1, oa2
123 
124 ! @@@@@@@@@@@@@For bug correction to ObsPlane=3
125  real*8 cosx, ux
126 ! @@@@@@@@@@@@@@
127 
128  data first/.true./
129  save first
130 
131 ! fix position
132  oa1 = real(azimuth)
133  oa2 = imag_p(azimuth)
134 ! if we don't use oa1, oa2 but use real(..) directly in
135 ! the subroutine call, Absoft compiler give always 0 for
136 ! oa1
137 !
138  cosx = 2. ! @@@@@@@@@
139  ux = 0. ! @@@@@@@@@
140  do while (cosx .gt. -ux) !@@@@@@@@@
141  if(first) then
142  call cuonsphere(1, polarinjpos%r(3), polarinjpos%r(1),
143  * polarinjpos%r(2), oa1, oa2, incident%pos%xyz)
144  first =.false.
145  else
146 ! this is quicker a bit
147  call cuonsphere(2, polarinjpos%r(3), polarinjpos%r(1),
148  * polarinjpos%r(2), oa1, oa2, incident%pos%xyz)
149  endif
150 ! fix angle around zenith at incident.pos.xyz
151 ! convert PolarInjPos to xyz vector
152  call ctranscoord2('xyz', incident%pos%xyz, incipos)
153 ! convert its direction to direction cos
154  call c3dv2ddcos(incipos, dir1, len)
155 ! sample angle around dir1 (x,y axes arbitrary)
156  call rndc(u)
157  if(za1ry .eq. 'is') then
158  dir2%r(3) = -( (imag_p(coszenith)- real(CosZenith) )*u +
159  * real(CosZenith) ) ! going down is negative
160  elseif(za1ry .eq. 'cos') then
161 ! cos dcos
162  call ksamplin(1.0d0, 0.0d0,
163  * real(CosZenith), imag_p(coszenith), dir2%r(3))
164  dir2%r(3) = -dir2%r(3) ! going down is negative
165  else
166  call cerrormsg('Za1ry =', 1)
167  call cerrormsg(za1ry, 1)
168  call cerrormsg(
169  * ' for ObsPlane=3 is invalid; must be: "is" or "cos"',0)
170  endif
171  call rndc(u)
172  call kcossn(cs, sn)
173  sint = sqrt(1.d0-dir2%r(3)**2)
174  dir2%r(1) = - sint*cs ! - is needed for going down ptcl.
175  dir2%r(2) = - sint*sn
176 ! convert it to xyz system
177  call ctransvectz(dir1, dir2, incident%vec%w)
178 ! @@@@@@@@@@@@@@@
179  call cscalerprod(incident%vec%w, dir1, cosx)
180  call rndc(ux)
181  enddo
182 ! @@@@@@@@@@@@@@@
183 ! uv 5.51
184  if(reverse .ne. 0) then
185 ! we must revert the angle
186  dir2%r(1) = -dir2%r(1)
187  dir2%r(2) = -dir2%r(2)
188  dir2%r(3) = -dir2%r(3)
189  call ctransvectz(dir1, dir2, incident%vec%w)
190  endif
191 
192 ! reset others
193  call cresetprim2(incident)
subroutine cerrormsg(msg, needrtn)
Definition: cerrorMsg.f:4
*Zfirst p fm *Zfirst p Zfirst p Zfirst p *Zfirst p *Zfirst pos xyz r
Definition: ZavoidUnionMap.h:1
logical, save first
Definition: cNRLAtmos.f:8
subroutine cuonsphere(ini, rin, teta, phi, oa1, oa2, pos)
Definition: cmkIncident.f:497
Definition: Ztrack.h:44
subroutine cresetprim2(incident)
Definition: cmkIncident.f:223
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 rndc(u)
Definition: rnd.f:91
subroutine ctranscoord2(sys, a, b)
Definition: ctransCoord2.f:2
block data cblkEvhnp ! currently usable models data RegMdls ad *special data *Cekaon d0
Definition: cblkEvhnp.h:5
subroutine ctransvectz(zax, dir1, dir2)
Definition: ctransVectZ.f:21
subroutine c3dv2ddcos(a, b, len)
Definition: c3DV2DDCos.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
subroutine kcossn(cs, sn)
Definition: kcossn.f:13
subroutine ksamplin(a, b, alpha, beta, x)
Definition: ksampLin.f:15
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
Definition: Zcoord.h:43
subroutine cscalerprod(a, b, c)
Definition: cscalerProd.f:4
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cresetprim()

subroutine cresetprim ( type(ptcl incidentp,
type(coord angle 
)

Definition at line 197 of file cmkIncident.f.

References cinitracking(), cinitstack(), cmkinc(), and cpush().

197  implicit none
198 ! reset primary. This is typically used by the user,
199 ! at chookBgEvent to reset the primary which has been
200 ! set by the sytem so that the user can set own primray.
201 !
202 #include "Ztrack.h"
203  type(ptcl)::incidentp ! input. must have E, mass, charge,subcode
204  type(coord)::angle ! input. direction cos at 'det' system
205 !
206  type(track)::inc2
207 #if defined (KEKA) || defined (KEKB)
208 ! for IBM, we must write as follows.
209  inc2%p%charge=incidentp%charge
210  inc2%p%subcode=incidentp%subcode
211  inc2%p%fm%p(4) = incidentp%fm%p(4)
212  inc2%p%mass = incidentp%mass
213 #else
214  inc2%p = incidentp
215 #endif
216  call cmkinc(inc2, angle)
217  call cinitracking( inc2 )
218  call cinitstack
219  call cpush(inc2)
Definition: Ztrack.h:44
subroutine cinitstack
Definition: cstack.f:76
subroutine cmkinc(incident, angle)
Definition: cmkIncident.f:246
subroutine cinitracking(incident)
Definition: ciniTracking.f:2
Definition: Zptcl.h:75
Definition: Zcoord.h:43
subroutine cpush(a)
Definition: cstack.f:4
Here is the call graph for this function:

◆ cresetprim2()

subroutine cresetprim2 ( type(track incident)

Definition at line 223 of file cmkIncident.f.

References cinitracking(), cinitstack(), cmkinc2(), and cpush().

Referenced by cresetposang().

223  implicit none
224 ! reset primary. This is typically used by the user,
225 ! at chookBgEvent to reset the primary which has been
226 ! set by the sytem so that the user can set own primray.
227 ! The difference from cresetPrim is that the parameter is
228 ! track, and this is for
229 ! ObsPlane==spherical case where you can put very arbitrary
230 ! incdint injection point.
231 ! See cmkInc2 for what you must set for incident.
232 !
233 #include "Ztrack.h"
234 !
235  type(track)::incident ! input. you must give everything
236 ! about primary
237 
238  call cmkinc2(incident)
239  call cinitracking( incident )
240  call cinitstack
241  call cpush(incident)
subroutine cmkinc2(incident)
Definition: cmkIncident.f:398
Definition: Ztrack.h:44
subroutine cinitstack
Definition: cstack.f:76
subroutine cinitracking(incident)
Definition: ciniTracking.f:2
subroutine cpush(a)
Definition: cstack.f:4
Here is the call graph for this function:
Here is the caller graph for this function:

◆ csetmintime()

subroutine csetmintime ( type(track from)

Definition at line 448 of file cmkIncident.f.

References clenbetw2h().

Referenced by cmkinc(), and cresettimer().

448  implicit none
449 !
450 !
451 #include "Ztrack.h"
452 #include "Ztrackv.h"
453 #include "Zobs.h"
454 #include "Zobsp.h"
455 #include "Zobsv.h"
456 #include "Zincidentp.h"
457 #include "Zincidentv.h"
458 !#include "Zearth.h"
459 
460  type(track)::from ! input. track to be origin
461 
462  real*8 leng
463 ! clenbetween2h, leng
464  integer i, icon
465 
466  do i = 1, noofsites
467 ! ObsSites(i).minitime =
468 ! * clenbetween2h(from.pos.radiallen,
469 ! * ObsSites(i).pos.radiallen,
470 ! * from.vec.coszenith) ! actually this is in m.
471  call clenbetw2h(from%pos%radiallen,
472  * obssites(i)%pos%radiallen, from%vec%coszenith,
473  * leng, icon) ! actually leng is in m.
474  if(icon .eq. 0) then
475  obssites(i)%minitime = leng
476  else
477 ! icon !=0 ==> light cannot come with this angle
478  obssites(i)%minitime = 1.d10
479  endif
480  enddo
481 
482  from%t = 0. ! reset time of incident track.
nodes i
Definition: Ztrack.h:44
integer leng
Definition: interface2.h:1
subroutine clenbetw2h(h1, h2, cost, leng, icon)
Definition: catmosutil.f:176
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:
Here is the caller graph for this function:

◆ cuonsphere()

subroutine cuonsphere ( integer  ini,
real*8  rin,
real*8  teta,
real*8  phi,
real*8  oa1,
real*8  oa2,
type(coord pos 
)

Definition at line 497 of file cmkIncident.f.

References capplyrot4(), cgetrotmat4(), cmultrotmat4(), cos, d0, pi, and rndc().

Referenced by cresetposang().

497  implicit none
498 #include "Zglobalc.h"
499 #include "Zptcl.h"
500 #include "Zcoord.h"
501 ! This is a modified version of epuonSphere in Epics
502 ! generate a random point uniformly distributed on the
503 ! surface of a sphere. Points are distributed around
504 ! given polar angles (teta, phi) within a given opening angle
505 ! (oa1~oa2).
506 ! By uniform is meant that the points are uniformly distributed on
507 ! the surface of the sphere but not on a projected plane.
508 !
509  integer ini ! input
510  ! 1--> teta and phi are different from
511  ! previous call or this is the first call.
512  ! != 1 --> teta, and phi are the same as
513  ! the previous call.
514  real*8 rin ! input. radius of the sphere
515  real*8 teta ! input. polar angle in degree
516  real*8 phi ! input. azimutal angle in degree
517  real*8 oa1 ! input. starting half opnening angle in degree
518  real*8 oa2 ! input. ending half opnening angle in degree
519  type(coord)::pos ! output. an obtained random point in Exyz
520 
521  type(fmom)::xyz
522  type(fmom)::xyz2
523  real*8 a(4, 4), b(4, 4), ba(4, 4)
524  real*8 u, r
525  real*8 fcos, fsin
526  save ba
527 
528  r = rin *0.999999999d0
529  if(ini .eq. 1) then
530  call cgetrotmat4(2, -teta*torad, a)
531  call cgetrotmat4(3, -phi*torad, b)
532  call cmultrotmat4(b, a, ba)
533  endif
534 
535  call rndc(u)
536  fcos = cos( min(oa2,180.d0) * torad)
537  fcos = ( cos( min(oa1,180.d0)*torad ) - fcos) * u + fcos
538  fsin = sqrt(1.d0- fcos**2)
539  call rndc(u)
540  u = u*pi*2
541  xyz%p(1) = r * (fsin * cos(u))
542  xyz%p(2) = r * (fsin * sin(u))
543  xyz%p(3) = r * fcos
544 
545  xyz%p(4) = 1. ! dummy
546  call capplyrot4(ba, xyz, xyz2)
547  pos%r(1) = xyz2%p(1)
548  pos%r(2) = xyz2%p(2)
549  pos%r(3) = xyz2%p(3)
550 
551 
552  pos%sys = 'xyz'
subroutine cmultrotmat4(a, b, c)
Definition: cgetRotMat4.f:131
*Zfirst p fm *Zfirst p Zfirst p Zfirst p *Zfirst p *Zfirst pos xyz r
Definition: ZavoidUnionMap.h:1
! for length to thickness conversion or v v ! integer maxnodes real Hinf ! This is used when making table for dim simulation ! The slant length for vertical height to km is ! divided by LenStep m steps ! It can cover the slant length of about km for cos
Definition: Zatmos.h:8
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 cgetrotmat4(m, ang, rm)
Definition: cgetRotMat4.f:79
subroutine rndc(u)
Definition: rnd.f:91
Definition: Zptcl.h:72
block data cblkEvhnp ! currently usable models data RegMdls ad *special data *Cekaon d0
Definition: cblkEvhnp.h:5
subroutine capplyrot4(a, v, vn)
Definition: cgetRotMat4.f:148
! constants thru Cosmos real * pi
Definition: Zglobalc.h:2
real(4), save a
Definition: cNRLAtmos.f:20
real(4), save b
Definition: cNRLAtmos.f:21
Definition: Zcoord.h:43
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 * phi
Definition: Zcoord.h:25
Here is the call graph for this function:
Here is the caller graph for this function: