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

Go to the source code of this file.

Functions/Subroutines

subroutine cmulscat (theta)
 
subroutine cmulscat2 (theta)
 
subroutine cmulscat1 (theta)
 
subroutine celsepacondense (sgr, theta)
 

Function/Subroutine Documentation

◆ celsepacondense()

subroutine celsepacondense ( real(8), intent(in)  sgr,
real(8), intent(out)  theta 
)

Definition at line 134 of file cmulScat.f.

References d, and d0.

Referenced by cmulscat().

134  use modmcscontrol
135  use modsoftmcs
136  use modcmcs
137  use modxsecmedia
138  implicit none
139 
140  real(8),intent(in):: sgr ! path length in kg/m2
141  real(8),intent(out):: theta ! sampled angle
142 
143  real(8)::cm2topgrm,s0,s1, s2, ls1, ls2
144  real(8):: mu, cosa, sina
145 !!! call ciniFsoft(KEeV, sgr) is for integration
146 !!! from 0 to muc. We need here from 0 to 1. so
147 !!! do below
148 ! 1 is to get s in cm2
149  call ctpxs(tpxsnow, 1, keev, s0, s1, s2)
150 ! not 0.1 (/(kg/m2))-->(/g/cm2)
151  cm2topgrm = media(1)%mbtoPkgrm/ 1d-27
152  ls1 =1.0/(s1*cm2topgrm)
153  ls2 =1.0/(s2*cm2topgrm)
154 
155  avemu = (1.0d0 - exp(-sgr/ls1))/2
156  avemu2 = avemu - (1- exp(-sgr/ls2) )/6.d0
157  if( avemu > 0.49999999d0 ) then
158  ! mu is uniform (asoft =1 bsoft =1 is also ok)
159  bsoft = 0.5d0
160  asoft = 0.5d0
161  else
162  bsoft =( 2*avemu - 3*avemu2 )/(1-2*avemu)
163  asoft = (1-2*avemu) + bsoft
164  endif
165  call csampsoftmcsang(mu, cosa)
166  theta = acos(cosa)
block data cblkEvhnp ! currently usable models data RegMdls ad *special data *Cekaon d0
Definition: cblkEvhnp.h: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 * theta
Definition: Zcoord.h:25
dE dx *! Nuc Int sampling table d
Definition: cblkMuInt.h:130
Here is the caller graph for this function:

◆ cmulscat()

subroutine cmulscat ( real*8  theta)

Definition at line 9 of file cmulScat.f.

References celsepacondense(), cmulscat1(), cmulscat2(), and csampmol().

Referenced by celecdef().

9  use modxsecmedia
10  use modmcscontrol
11  implicit none
12 ! Using cTrack and Move, compute scattering angle
13 !
14 #include "Zglobalc.h"
15 #include "Zcode.h"
16 #include "Ztrack.h"
17 #include "Ztrackv.h"
18 #include "Zelemagp.h"
19 
20  real*8 theta ! output. sampled angle in radian.
21 !
22 !
23 !
24  integer cond
25  real(8):: sgr
26  integer ic
27 
28 ! sample theta
29  if(intinfarray(processno)%length .gt. 0.) then
30  if(activemcs == "El_con") then
31  ! total length in kg/m2; sample theta
32  sgr =intinfarray(processno)%thickness
33  call celsepacondense(sgr, theta)
34  elseif(abs(moliere) >= 2) then ! abs is historical reason
35  call csampmol(media(1), theta, cond) ! rigorous Moliere
36  if(cond /= 0 ) then
37  call cmulscat2(theta) ! Gauss
38  endif
39  elseif(abs(moliere) == 1) then
40  call cmulscat1(theta) ! simplified Moliere
41  elseif( moliere == 0 ) then
42  call cmulscat2(theta) ! Gauss
43  endif
44  else
45  theta = 0.
46  endif
subroutine cmulscat1(theta)
Definition: cmulScat.f:98
subroutine cmulscat2(theta)
Definition: cmulScat.f:50
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
subroutine celsepacondense(sgr, theta)
Definition: cmulScat.f:134
subroutine csampmol(mediax, teta, cond)
Definition: cSampMol.f:7
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cmulscat1()

subroutine cmulscat1 ( real*8  theta)

Definition at line 98 of file cmulScat.f.

References cmoliere(), cmulscat2(), and d0.

Referenced by cmulscat().

98  implicit none
99 #include "Zcode.h"
100 #include "Ztrack.h"
101 #include "Ztrackv.h"
102 #include "Zelemagp.h"
103 ! by Moliere thoery
104 
105  real*8 theta
106 
107  real*8 g1, g2, leng
108  integer cond
109 
110  real*8 t, tmp, avx, avy, disp, cs, sn, e1, e2, d1, d2
111  real*8 rho, cvh2den
112  integer chg
113 
114  e1 = trackbefmove%p%fm%p(4)
115  g1 = e1/trackbefmove%p%mass
116  e2 = movedtrack%p%fm%p(4)
117  g2 = e2/movedtrack%p%mass
118  rho = cvh2den(
119  * (trackbefmove%pos%height+movedtrack%pos%height)/2.d0
120  * )
121 
122  leng = intinfarray(processno)%length ! in m
123 
124  chg = movedtrack%p%charge
125  call cmoliere(rho, chg, movedtrack%p%mass, g1, g2,
126  * leng, theta, cond)
127  if(cond .ne. 0) then
128 ! Moliere theory cannot be applied
129  call cmulscat2(theta)
130  endif
integer leng
Definition: interface2.h:1
block data cblkEvhnp ! currently usable models data RegMdls ad *special data *Cekaon d0
Definition: cblkEvhnp.h:5
subroutine cmoliere(rhoin, z, mass, g1, g2, leng, teta, cond)
Definition: cmoliere.f:3
subroutine cmulscat2(theta)
Definition: cmulScat.f:50
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
real *8 function cvh2den(z)
Definition: ciniSegAtoms.f:54
nodes t
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cmulscat2()

subroutine cmulscat2 ( real*8  theta)

Definition at line 50 of file cmulScat.f.

References d, d0, parameter(), pi, and rndc().

Referenced by cmulscat(), and cmulscat1().

50  implicit none
51 ! Gaussian scattring
52 !
53 #include "Zglobalc.h"
54 #include "Ztrack.h"
55 #include "Ztrackv.h"
56 #include "Zelemagp.h"
57 
58 
59 
60  real*8 theta ! output. sampled spatial angle in radain.
61 
62  real*8 tetarms, g1, g2, u, beta2, dt
63  integer nc
64 
65  real*8 hpi
66  parameter(hpi = pi/2.)
67 
68  g1 = trackbefmove%p%fm%p(4)/movedtrack%p%mass
69  g2 = movedtrack%p%fm%p(4)/movedtrack%p%mass
70  beta2 = 1.d0 - 1.d0/g1/g2
71  if(beta2 .le. 0.) then
72  tetarms = 0.
73  else
74  dt = intinfarray(processno)%thickness/ x0 ! r%l
75  if(dt .gt. 1.d-3) then
76  tetarms = es/trackbefmove%p%fm%p(4)*
77  * abs(movedtrack%p%charge) *
78  * sqrt(dt/beta2)*(1.0 + 0.038*log(dt))
79  else
80  tetarms = es/trackbefmove%p%fm%p(4)*
81  * abs(movedtrack%p%charge) * sqrt(dt/beta2)
82  endif
83  endif
84  theta = pi
85  nc = 0
86  do while(theta .gt. hpi)
87  if(nc .gt. 10) then
88 ! tetarms seems too large
89  theta = u**0.1 * hpi ! give some value
90  else
91  call rndc(u)
92  theta = sqrt(-log(u))* tetarms
93  nc = nc +1
94  endif
95  enddo
integer npitbl real *nx parameter(n=101, npitbl=46, nx=n-1) real *8 uconst
subroutine rndc(u)
Definition: rnd.f:91
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
dE dx *! Nuc Int sampling table d
Definition: cblkMuInt.h:130
real cut integer nc
Definition: Zprivate.h:1
Here is the call graph for this function:
Here is the caller graph for this function: