COSMOS v7.655  COSMOSv7655
(AirShowerMC)
cputTrInfo.f
Go to the documentation of this file.
1 ! ready made tracer
2 ! put trace info.
3 ! The output x,y,z values will be those defined as follows
4 ! depending on the value of "Trace"
5 !
6 ! 0 This routine is not called.
7 !
8 !
9 ! <10 x, y, z in the primary sytem
10 ! <20 x, y, in the primary system. z in kg/m2
11 !
12 ! <30 x, y, z in the detector system
13 ! <40 x, y, in the detector system. z in kg/m2
14 !
15 ! <50 x, y, z in 'xyz' system
16 ! <60 x, y in 'xyz' , z in kg/m2
17 !
18 ! Primary system: origin is the deepest detector.
19 ! Z-axis is the primary direction
20 ! X-aixs is Z x Vertical axis
21 ! X-Y plane is orthgonal to the primary
22 ! Detector system: origin is the deepest detector.
23 ! Z-axis is the vertical one
24 ! X-axis is directed to the magnetic east.
25 ! X-Y palne is horizontal.
26 ! z in kg/m2 : Vertical depth in kg/m2 above the
27 ! deepest detector to the particle.
28 !
29 ! 60< < 100 ready made Cerenkov output.
30 ! 100< <160 chookTrace is called.
31 ! 160< <200 chookCeren is called with Cerenkov mode.
32 !
33 !
34  subroutine cputtrinfo
35  implicit none
36 
37 #include "Ztrack.h"
38 #include "Ztrackp.h"
39 ! #include "Ztrackv.h"
40 
41 
42  type(coord)::f
43  type(coord)::t
44 
45  if(trace .ge. 100 .and. trace .lt. 160) then
46  call chooktrace
47  return ! ******************
48  endif
49  if(trace .gt. 60 .or. trace .gt. 160) then
50  call cputcerenkov ! Cerenkov output
51  return ! *****************
52  else
53 ! convert coord.
54  call ccoordfortr(trace, f, t)
55  call cwrttrinfo(f, t)
56  endif
57  end
58  subroutine cwrttrinfo(f, t)
59  implicit none
60 
61 #include "Ztrack.h"
62 #include "Ztrackp.h"
63 #include "Ztrackv.h"
64 #include "Zobs.h"
65 #include "Zobsv.h"
66 
67  type(coord)::f
68  type(coord)::t
69 
70  real*8 xxx/-1.d37/, yyy/-1.d36/, zzz/1.d34/
71  integer kkk/-1000/, chg/-1000/
72  save xxx, yyy, zzz, kkk, chg
73 
74  if(kkk .ne. movedtrack%p%code .or. f%r(1) .ne. xxx
75  * .or. f%r(2) .ne. yyy .or. f%r(3) .ne. zzz .or.
76  * chg .ne. movedtrack%p%charge ) then
77  if(xxx .ne. -1.d37) then
78  write(tracedev, *)
79  write(tracedev, *)
80  endif
81  if(timestructure) then
82 !! write(TraceDev, '(3g16.8, i4, g11.4, i4, g16.8)')
83  write(tracedev,
84  * '(1p,3g24.16,0p, i4,1p, g24.16,0p, i4, 1p, g24.16)')
85  * f%r(1), f%r(2), f%r(3), trackbefmove%p%code,
86  * trackbefmove%p%fm%p(4)-trackbefmove%p%mass,
87  * trackbefmove%p%charge, trackbefmove%t
88  else
89  write(tracedev, '(3g16.8, i4, g11.4, i4)')
90  * f%r(1), f%r(2), f%r(3), trackbefmove%p%code,
91  * trackbefmove%p%fm%p(4)-trackbefmove%p%mass,
92  * trackbefmove%p%charge
93  endif
94  endif
95  if(timestructure) then
96 !!! write(TraceDev, '(3g16.8, i4, g11.4, i4, g16.8)')
97  write(tracedev,
98  * '(1p,3g24.16,0p, i4,1p, g24.16,0p, i4, 1p, g24.16)')
99  * t%r(1), t%r(2), t%r(3), movedtrack%p%code,
100  * movedtrack%p%fm%p(4)-movedtrack%p%mass,
101  * movedtrack%p%charge, movedtrack%t
102  else
103  write(tracedev, '(3g16.8, i4, g11.4, i4)')
104  * t%r(1), t%r(2), t%r(3), movedtrack%p%code,
105  * movedtrack%p%fm%p(4)-movedtrack%p%mass,
106  * movedtrack%p%charge
107  endif
108  xxx = t%r(1)
109  yyy = t%r(2)
110  zzz = t%r(3)
111  kkk = movedtrack%p%code
112  chg = movedtrack%p%charge
113  end
114 ! ***************************************
115 ! convert coord for tracing. This is called by
116 ! cputTrInfo and cputCerenkov
117 
118  subroutine ccoordfortr(how, f, t)
120  implicit none
121 ! ***************************************
122 #include "Ztrack.h"
123 #include "Ztrackp.h"
124 #include "Ztrackv.h"
125 #include "Zobs.h"
126 #include "Zobsv.h"
127 
128  integer how ! input. see Trace in cputTrInfo.
129  type(coord)::f
130  type(coord)::t ! output. transformed 'from to' coord
131 
132  if(how .le. 20) then
133 ! to 1ry system
134  call cxyz2prim(obssites(noofsites)%pos%xyz,
135  * trackbefmove%pos%xyz, f)
136  call cxyz2prim(obssites(noofsites)%pos%xyz,
137  * movedtrack%pos%xyz, t)
138  if(how .ge. 10) then
139  f%r(3) = obssites(noofsites)%pos%depth
140  * - trackbefmove%pos%depth
141  t%r(3) = obssites(noofsites)%pos%depth
142  * - movedtrack%pos%depth
143  endif
144  elseif(how .le. 40) then
145 ! to detector system
146  call cxyz2det(obssites(noofsites)%pos%xyz,
147  * trackbefmove%pos%xyz, f)
148  call cxyz2det(obssites(noofsites)%pos%xyz,
149  * movedtrack%pos%xyz, t)
150  if(how .ge. 30) then
151  f%r(3) = obssites(noofsites)%pos%depth
152  * - trackbefmove%pos%depth
153  t%r(3) = obssites(noofsites)%pos%depth
154  * - movedtrack%pos%depth
155  endif
156  elseif(how .le. 60) then
157  f = trackbefmove%pos%xyz
158  t = movedtrack%pos%xyz
159  if(how .ge. 50) then
160  f%r(3) = obssites(noofsites)%pos%depth
161  * - trackbefmove%pos%depth
162  t%r(3) = obssites(noofsites)%pos%depth
163  * - movedtrack%pos%depth
164  endif
165  else
166  call cerrormsg('100>= how > 60 for ccoordForTr ', 0)
167  endif
168  end
subroutine cerrormsg(msg, needrtn)
Definition: cerrorMsg.f:4
subroutine ccoordfortr(how, f, t)
Definition: cputTrInfo.f:119
subroutine cxyz2prim(base, a, b)
Definition: cxyz2prim.f:5
subroutine chooktrace
Definition: chook.f:275
subroutine cputcerenkov
Definition: cputCerenkov.f:6
subroutine cputtrinfo
Definition: cputTrInfo.f:35
Definition: Zcoord.h:43
subroutine cxyz2det(det, a, b)
Definition: cxyz2det.f:7
subroutine cwrttrinfo(f, t)
Definition: cputTrInfo.f:59