COSMOS v7.655  COSMOSv7655
(AirShowerMC)
cbhabhaPath.f
Go to the documentation of this file.
1 ! ****************************************************************
2 ! *
3 ! * cbhabhaPath: Bhabha scattering prob. / r.l
4 ! * cbhabhaea: energy of survival posititon and recoil
5 ! electrons and angles
6 !
7  subroutine cbhabhapath(ein, w, prob, path)
8  implicit none
9 #include "Zmass.h"
10  real*8 ein ! input. positron energy in GeV
11  real*8 w ! input. minimum kinetic energy of recoil electron
12  ! to be treated (in GeV). (around 200 kev)
13  real*8 prob ! output. prob. per r%l
14  real*8 path ! output. sampled path in r%l
15 ! --------------------------------
16  real*8 em, t0, g, u
17 
18  real*8 cbhabhatx
19 ! constm=.03*z/a*x0inkgpm2
20  real*8 constm
21  save constm
22  data constm/5.4859d0/
23 
24 !
25 
26  g=ein/masele
27  t0=ein-masele
28  if(t0 .gt. 0.) then
29  em= w/t0
30  else
31  em=1000.
32  endif
33  if(em .ge. 1.0d0) then
34  prob= 1.d-35
35  else
36 ! ( .3*z/a) *x0ing = media.basearea*2; prob /r.l
37  prob =
38 ! * epbhabhatx(g, em)*masele/t0 * media.basearea*2.0
39  * cbhabhatx(g, em)*masele/t0 * constm
40  endif
41  call rndc(u)
42  path = - log(u)/prob
43  end
44 ! ************
45  subroutine cbhabhaea(ein, w, es, er, coss, cosr)
46  implicit none
47 #include "Zmass.h"
48  real*8 ein ! input. positron energy in GeV
49  real*8 w ! input. minimum kinetic energy of recoil electron
50  ! to be treated( in GeV). (around 200 kev)
51  real*8 es ! output. survival positron energy in GeV
52  real*8 er ! output. recoiled electron energy in GeV
53  real*8 coss ! output. cos angle of the survival positron
54  real*8 cosr ! output. cos angle of the recoiled //
55 !
56 ! this is the same as Moller scat. case. except fof
57 ! rejection function. and range of em, ep
58 ! --------------------------------
59 
60  real*8 g, em, t0, u, ep, ge, tr, gr, gs
61  real*8 cbhabharf
62 
63  g = ein/masele
64  t0=ein-masele
65  if(t0 .gt. 0.) then
66  em= w/t0
67  else
68  em=1000.
69  endif
70  if(em .ge. 1.d0) then
71  er=masele
72  es=ein
73  tr=0.
74  else
75 ! rejection method
76 ! *** until loop***
77  do while (.true.)
78  call rndc(u)
79  ep=1.d0/ ( (1.0d0-em)*u/em + 1.0d0 )
80  ge=cbhabharf(w, em, g, ep)
81  call rndc(u)
82  if ( u .lt. ge)
83  * goto 100
84  enddo
85  100 continue
86  tr=ep*t0
87  er= tr + masele
88  endif
89  es = ein - er + masele
90  if(es .lt. masele) then
91  es=masele
92  er=max(ein-es+masele, masele)
93  tr=er-masele
94  endif
95 ! angle part
96  gr = er/masele
97  gs = es/masele
98  if(g .gt. 1.) then
99  cosr =sqrt( (gr-1.0)*(g+1.0)/(gr+1.)/(g-1.0))
100  coss = sqrt( (gs-1.0)*(g+1.)/(gs+1.)/(g-1.0))
101  else
102  cosr = 1.0
103  coss= 1.0
104  endif
105 
106  end
107 
108  real*8 function cbhabhag(g, x)
109  implicit none
110  real*8 g ! input gamma factor of electron
111  real*8 x ! input. w/T0. w is cut-off kinetic energy.
112 ! ds/dx= cbhabhaG / x**2 * 2pir^2mZ/T0
113  real*8 temp
114  real*8 c1, c2, c3, c4, y, gsave, beta2
115  data gsave/0.d0/
116 
117  save c1, c2, c3, c4, y, gsave, beta2
118 
119  if(g .ne. gsave) then
120  gsave = g
121  beta2 = 1.d0 - 1.d0/g**2
122  y=1.d0/(1.0d0 + g)
123  temp = 1.d0-2.0d0*y
124  c4= temp**3
125  c3 = c4 + temp**2
126  c2 = temp*(3.0d0 + y**2)
127  c1 = 2.d0 - y**2
128  endif
129  cbhabhag = (( (c4*x -c3)*x + c2)*x -c1) *x +1./beta2
130  end
131 
132  real*8 function cbhabharf(w, em, g, x)
133  implicit none
134 #include "Zmass.h"
135  real*8 w ! input. cut-off energy in GeV.
136  real*8 em ! input. w/T0
137  real*8 g ! input.
138  real*8 x ! input.
139 
140  real*8 cbhabhaG
141 ! rejection function; G(g, x)/G(g,x)_max
142 
143  real*8 g1, gm
144  real*8 brp
145  parameter(brp=masele*0.999)
146 
147  gm = cbhabhag(g, em)
148 
149  if(w .gt. brp) then
150 ! check if g1 > gm
151  g1 = cbhabhag(g, 1.d0)
152  gm = max(g1, gm)
153  endif
154  cbhabharf= cbhabhag(g,x)/gm
155  end
156 
157  real*8 function cbhabhatx(g, em)
158  implicit none
159 ! a part of the Bhabha scattering total x-section
160 ! if Z* 2pi r^2 m/T0 is
161 ! multiplied, you will get the total x-section for
162 ! a charge Z atom.
163 !
164 ! if 2pir^2 m/T0 *Z Na/A = 0.300*Z/A*m/T0 is
165 ! multiplied, you will get the total cross
166 ! section in 1/(g/cm^2), and its inverse is the m.f.p in g/cm^2.
167 !
168  real*8 g ! input gamma factor
169  real*8 em ! input. w/T0.
170 
171  real*8 beta2, y, c1, c2, c3, c4, temp
172 
173  beta2 = 1.d0 - 1.d0/g**2
174  y=1.d0/(1.0d0 + g)
175  temp = 1.d0-2.0d0*y
176  c4= temp**3
177  c3 = c4 + temp**2
178  c2 = temp*(3.0d0 + y**2)
179  c1 = 2.d0 - y**2
180 
181  cbhabhatx = c1*log(em) +c2*(1.d0-em) - c3*(1.0d0-em**2)/2.0d0
182  * + c4*(1.0d0 -em**3)/3.0d0
183  * + (1.d0-em)/beta2/em
184  end
integer npitbl real *nx parameter(n=101, npitbl=46, nx=n-1) real *8 uconst
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
real *8 function cbhabhatx(g, em)
Definition: cbhabhaPath.f:158
block data cblkEvhnp ! currently usable models data RegMdls ad *special data *Cekaon d0
Definition: cblkEvhnp.h:5
dE dx *! Nuc Int sampling table d
Definition: cblkMuInt.h:130
real *8 function cbhabharf(w, em, g, x)
Definition: cbhabhaPath.f:133
const double masele
Definition: Zmass.h:2
real *8 function cbhabhag(g, x)
Definition: cbhabhaPath.f:109
subroutine cbhabhapath(ein, w, prob, path)
Definition: cbhabhaPath.f:8
subroutine cbhabhaea(ein, w, es, er, coss, cosr)
Definition: cbhabhaPath.f:46