COSMOS v7.655  COSMOSv7655
(AirShowerMC)
cgmf0orig.f
Go to the documentation of this file.
1 c ****************************************************************
2 c * *
3 c * mfgmf0: initialize routine for computing geomagnetic field *
4 c * effect (give gmf constants and 1ry direction) *
5 c * mfgeom: compute deflection and deflection angle of the *
6 c * particle at given path travelled *
7 c * *
8 c ************************ tested 83.11.17 ***********************
9 c
10 c /usage/ call mfgmf0(bh, bv, w01, w02, w03, bt)
11 c this must be called when the 1ry direction is fixed
12 c this must be called when starting the ptcl following
13 c in mf2, may be called at mfcas0 with w1=w1a and w2=w2a
14 c call mfgeom(e, iz, dst, dx, dy, tx, ty)
15 c
16 c coordinate system:
17 c
18 c let y* be geomagnetic north
19 c x* west
20 c z* vertical axis going downwards
21 c
22 c then gmf is // to y*-z* plane
23 c
24 c let the unit vector of 1ry paticle be z#=(w01, w02, w03) in
25 c * system. ( # is for vector)
26 c form x axis by b# x z# where b# is the vector of gmf so
27 c that x# = b# x z# / ! b# x z# ! (if b#//z#, x should be
28 c x* ). y axis is on b#-z# plane, i.e y# = z# x x#.
29 c the angle between b# and z# is alfa. gmf effect is
30 c computed easily in the frame where x axis is rotated
31 c so that z axis coincide with b#. then the deflection etc
32 c is transformed to (x,y,z) system where coordinate of ptcls
33 c are measured.
34 c
35 c
36 c *** mfgmf0 ***
37 c
38 c -- input --
39 c bh: horizontal component of gmf (gauss)
40 c bv: vertical // (may be < 0) //
41 c w01: 1ry ptcle direction cosine to x* axis
42 c w02: 1ry ptcle direction cosine to y* axis
43 c w03: 1ry ptcle direction cosine to z* axis
44 c
45 c -- output --
46 c bt: b*sin(alfa) where b is sqrt(bv**2 + bh**2)
47 c
48 c
49 c
50 c if e-m cascade is treated 1 dimensionally during ptcl following
51 c and 3 dim. sampling is done only at observation plane, the
52 c treatmnet of gmf here is not perfect because ptcl direction is
53 c afected by scattering in the path.
54 c
55 c think 2 segments of path. at 1st segment, ptcl dirction is given
56 c by w1,w2,w3. using this value, gmf deflection is computed at the
57 c end of 1st segment. defelction at the end of 2nd segment must be
58 c computed using new w1,w2,w3 which must be corrected by deflection
59 c angle at the end of 1st segment. the defelction angle by gmf is
60 c correctly included in this routine, but scattering angle cannot
61 c be included because it is not sampled until observation point.
62 c
63 c that is, both effects are so small that they are treated
64 c independently. the net effect is obtained by adding the both
65 c effects.
66 c
67 c
68 c
69 c *** mfgmf ***
70 c
71 c -- input --
72 c e: energy of ptcl in tev
73 c iz: charge of ptcl
74 c dst: distance travelled in cm
75 c
76 c -- output --
77 c dx: deflection of x in (x,y,z) system (change as compared to
78 c the streight movement)
79 c dy: // y
80 c tx: deflection angle (x component)
81 c ty: // y
82 c
83 c
84 c
85 c
86 c
87  subroutine mfgmf0(bh, bv, w01, w02, w03, bt)
88 c
89  dimension tm(3,3)
90  data small /1.e-3/
91  save b, tm, cosa, sina
92  real*8 dst
93 c
94 c mag. of gmf
95  b=sqrt(bh**2 + bv**2)
96 c cos(alfa)
97  cosa=(bh * w02 + bv * w03)/b
98  cosa2=cosa**2
99  sina=sqrt(1. - cosa2)
100  bt=b * sina
101  sb2= w01**2 + (bh/b-w02)**2 + (bv/b-w03)**2
102  if(sb2 .gt. small) then
103  cota=cosa/sina
104  tm(1,1)= ( bh*w03 - bv*w02 ) /bt
105  tm(1,2)= -cota*w01
106  tm(1,3)= w01
107  tm(2,1)= bv*w01/bt
108  tm(2,2)= bh/bt - cota*w02
109  tm(2,3)= w02
110  tm(3,1)= -bh*w01/bt
111  tm(3,2)= bv/bt - cota*w03
112  tm(3,3)= w03
113  else
114  tm(1,1)= 1.
115  tm(1,2)= 0.
116  tm(1,3)= 0.
117  tm(2,1)= 0.
118  tm(2,2)=bv/b
119  tm(2,3)=bh/b
120  tm(3,1)=0.
121  tm(3,2)= -bh/b
122  tm(3,3)= bv/b
123  endif
124  return
125 c
126 c
127 c ************
128  entry mfgeom(p, iz, dst, w1i, w2i, w3i, dx, dy, tx, ty)
129 c ************
130 c
131  if(iz .eq. 0) then
132  dx=0
133  dy=0
134  tx=0
135  ty=0
136  else
137  z=iz
138  wt=z*b*dst*3.e-10/p
139  wt2=wt**2/2
140  ak=wt*dst/2
141 c
142  dx= (cosa*w2i - sina*w3i) *ak
143  dy= - ak*cosa*w1i
144 c
145 c tx= (cosa*w2i - sina*w3i) *wt - wt2 *w1i
146  tx= (cosa*w2i - sina*w3i) *wt
147 c ty= -wt*cosa*w1i - (cosa2*w2i - sina2*w3i)*wt2
148  ty= -wt*cosa*w1i
149 c tz= sina*wt*w1i + (csa *w2i - sina2*w3i)*wt2
150  tz= sina*wt*w1i
151  endif
152  return
153 c
154 c convert (x,y,z) in 1ry system into * system
155 c ************
156  entry mfptos(x, y, z, xs, ys, zs)
157 c ************
158 c
159  tmp1= tm(1,1)*x + tm(1,2)*y + tm(1,3)*z
160  tmp2= tm(2,1)*x + tm(2,2)*y + tm(2,3)*z
161  zs = tm(3,1)*x + tm(3,2)*y + tm(3,3)*z
162  xs = tmp1
163  ys = tmp2
164  return
165 c
166 c convert (x,y,z) in * system into 1ry system
167 c ************
168  entry mfstop(xs, ys, zs, x, y, z)
169 c ************
170 c
171  tmp1= tm(1,1)*xs + tm(2,1)*ys + tm(3,1)*zs
172  tmp2= tm(1,2)*xs + tm(2,2)*ys + tm(3,2)*zs
173  z = tm(1,3)*xs + tm(2,3)*ys + tm(3,3)*zs
174  x = tmp1
175  y = tmp2
176  end
nodes z
dE dx *! Nuc Int sampling table e
Definition: cblkMuInt.h:130
integer npitbl real *nx dx real dx
Definition: Zcinippxc.h:10
! constants thru Cosmos real ! if multiplied to deg radian Torad ! light velocity m sec ! infinty ! kg m2 *Togpcm2 g cm2 ! g cm2 *Tokgpm2 kg m2 ! cm *Tom m ! m *Tocm cm ! g cm3 *Tokgpm3 kg m3 ! kg m3 *Togpcm3 g cm3 ! sec *Tonsec nsec ! Tesla m ! Avogadro *A2deninv ! mfp *n * xs
Definition: Zglobalc.h:18
********************block data cblkHeavy ********************integer j data *HeavyG2symbol p
Definition: cblkHeavy.h:7
latitude latitude this system is used *****************************************************************! type coord sequence union map real y
Definition: Zcoord.h:25
dE dx *! Nuc Int sampling table b
Definition: cblkMuInt.h:130
! 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
subroutine mfgmf0(bh, bv, w01, w02, w03, bt)
Definition: cgmf0orig.f:88