COSMOS v7.655  COSMOSv7655
(AirShowerMC)
cmudEdx.f
Go to the documentation of this file.
1  subroutine cmudedx(flagN, flagBr, flagPr, Emu, dEdx, dEdxF)
2  implicit none
3 
4 ! gives muon sum of the energy loss due to direct pair creation,
5 ! bremsstrahlung and nuclear interaction.
6 ! dE/dx by ionization is not included here.
7 !
8  integer flagN ! input. specifies how to treate nuclear interaction.
9  ! 0--> n.i is neglected always.
10  ! 1-->int(v0:vmax) of Emu* v*dsigma/dv is
11  ! put in dEdx.v0~0, vmax~1.0.
12  ! (v=E_loss/Emu)
13  ! I.e., n.i is treated as a continuous process.
14  ! 2/3-->int(0:vmin) of Emu* v*dsigma/dv is
15  ! put in dEdx. vmin=cnst.muNVmin(=10^-3)
16  ! (discrete process by v>vmin is sampled
17  ! for each case; 2--> no n.i is followed.
18  ! 3--> n.i is followed)
19  !
20  integer flagBr ! input. The same meaning for bremsstrahlung as flagN.
21  integer flagPr ! input // direct pair creation.
22  real*8 Emu ! input. muon total energy
23  real*8 dEdx ! output. dE/dx GeV/(g/cm^2). sum of loss due to
24  ! the three process. restricted one
25  ! if frag is 2/3
26  real*8 dEdxF ! output Full dE/dx. if flag =1, same as dEdx
27 !
28  real*8 dEdx1, dEdx2, dEdx3
29  real*8 dEdx1F, dEdx2F, dEdx3F
30 !
31  call cmundedx(flagn, emu, dedx1)
32  if(flagn .ne. 1) then
33  call cmundedx(1, emu, dedx1f)
34  else
35  dedx1f = dedx1
36  endif
37 
38  call cmubrdedx(flagbr, emu, dedx2)
39  if(flagbr .ne. 1) then
40  call cmubrdedx(1, emu, dedx2f)
41  else
42  dedx2f = dedx2
43  endif
44  call cmuprdedx(flagpr, emu, dedx3)
45  if(flagpr .ne. 1) then
46  call cmuprdedx(1, emu, dedx3f)
47  else
48  dedx3f = dedx3
49  endif
50  dedx = dedx1 + dedx2 + dedx3
51  dedxf = dedx1f + dedx2f + dedx3f
52  end
53 ! ********************
54  subroutine cmundedx(flag, Emu, dEdx)
55 ! ********************
56  implicit none
57 #include "Zcmuint.h"
58 ! compute dE/dx of muon by nuclear interaction
59  integer flag ! input. 0--> dEdx is always 0.
60  ! 1--> dEdx is for all v
61  ! 2--> dEdx is for v<vmin
62  ! nuclear interaction is
63  ! not followed
64  ! 3--> dEdx is for v<vmin
65  ! n.i is followed
66  real*8 Emu ! input. muon total energy in GeV.
67  real*8 dEdx ! output. dE/dx GeV/(g/cm2)
68 
69 
70  real*8 ale, pw
71 
72  if(flag .eq.0 .or. (emu .lt. munemin)) then
73  dedx = 0.
74  else
75  if(emu .gt. munemax1) then
76  ale = log10(munemax1)
77  else
78  ale = log10(emu)
79  endif
80  if(flag .eq. 1) then
81 ! all is continuous loss
82  call kintp3(mundedxt, 1, muntxt, munlemin,
83  * mundetx, ale, dedx)
84  pw = munpwdedxt
85  elseif(flag .eq. 2 .or. flag .eq. 3) then
86 ! v<vmin is regarded as continuous loss
87  call kintp3(mundedx0, 1, muntxt, munlemin,
88  * mundetx, ale, dedx)
89  pw = munpwdedx0
90  else
91  call cerrormsg('flag is invalid for cmuNdEdx',0)
92  endif
93  if(emu .gt. munemax1) then
94  dedx = dedx*(emu/munemax1)**pw
95  endif
96  dedx = dedx * emu
97  endif
98  end
99 ! *******************
100  subroutine cmubrdedx(flag, Emu, dEdx)
101 ! *******************
102  implicit none
103 #include "Zcmuint.h"
104 ! compute dE/dx of muon by brems
105  integer flag ! input. 0--> dEdx is always 0.
106  ! 1--> dEdx is for all v
107  ! 2/3--> dEdx is for v<vmin
108  real*8 Emu ! input. muon total energy in GeV.
109  real*8 dEdx ! output. dE/dx GeV/(g/cm2)
110 
111 
112  real*8 ale
113 
114  if(flag .eq.0 .or. (emu .lt. mubremin)) then
115  dedx = 0.
116  else
117  if(emu .gt. mubremax1) then
118  ale = log10(mubremax1)
119  else
120  ale = log10(emu)
121  endif
122  if(flag .eq. 1) then
123 ! all is continuous loss
124  call kintp3(mubrdedxt, 1, mubrtxt, mubrlemin,
125  * mubrdetx, ale, dedx)
126  elseif(flag .eq. 2 .or. flag .eq. 3) then
127 ! v<vmin is regarded as continuous loss
128  call kintp3(mubrdedx0, 1, mubrtxt, mubrlemin,
129  * mubrdetx, ale, dedx)
130  else
131  call cerrormsg('flag is invalid for cmuBrdEdx',0)
132  endif
133  dedx = dedx * emu
134  endif
135  end
136 
137 ! *******************
138  subroutine cmuprdedx(flag, Emu, dEdx)
139 ! *******************
140  implicit none
141 #include "Zcmuint.h"
142 ! compute dE/dx of muon by pair creation
143  integer flag ! input. 0--> dEdx is always 0.
144  ! 1--> dEdx is for all v
145  ! 2/3--> dEdx is for v<vmin
146  real*8 Emu ! input. muon total energy in GeV.
147  real*8 dEdx ! output. dE/dx GeV/(g/cm2)
148 
149 
150  real*8 ale
151 
152  if(flag .eq.0 .or. (emu .lt. mupremin)) then
153  dedx = 0.
154  else
155  if(emu .gt. mupremax1) then
156  ale = log10(mupremax1)
157  else
158  ale = log10(emu)
159  endif
160  if(flag .eq. 1) then
161 ! all is continuous loss
162  call kintp3(muprdedxt, 1, muprtxt, muprlemin,
163  * muprdetx, ale, dedx)
164  elseif(flag .eq. 2 .or. flag .eq. 3) then
165 ! v<vmin is regarded as continuous loss
166  call kintp3(muprdedx0, 1, muprtxt, muprlemin,
167  * muprdetx, ale, dedx)
168  else
169  write(0,*) ' flag = ', flag
170  call cerrormsg('flag is invalid for cmuPrdEdx',0)
171  endif
172  dedx = dedx * emu
173  endif
174  end
subroutine cerrormsg(msg, needrtn)
Definition: cerrorMsg.f:4
subroutine cmuprdedx(flag, Emu, dEdx)
Definition: cmudEdx.f:139
subroutine cmudedx(flagN, flagBr, flagPr, Emu, dEdx, dEdxF)
Definition: cmudEdx.f:2
subroutine cmundedx(flag, Emu, dEdx)
Definition: cmudEdx.f:55
subroutine cmubrdedx(flag, Emu, dEdx)
Definition: cmudEdx.f:101
subroutine kintp3(f, intv, n, x1, h, x, ans)
Definition: kintp3.f:19