COSMOS v7.655  COSMOSv7655
(AirShowerMC)
cBrSSamp.f
Go to the documentation of this file.
1  subroutine cbrssampp(Ee, prob)
2 ! brems prob. sampling by Seltzer data.
3  implicit none
4 #include "ZbpCnst.h"
5 #include "ZbpTable.h"
6 
7  real*8 Ee
8  real*8 prob ! output probability of Brems / X0
9 
10  real*8 ale
11 
12 
13  if(ee .le. breemins) then
14  prob= 1.d-40
15  else
16  ale=log10(ee)
17  call kintp3(brtxs,
18  * 1, brtxts, brleemins,
19  * brdetxs, ale, prob)
20  endif
21  end
22 ! ************
23  subroutine cbrssampe( Eein, Eg)
24 ! ************
25 ! brems energy by Seltzer
26  implicit none
27 #include "Zmass.h"
28 #include "ZbpCnst.h"
29 #include "ZbpTable.h"
30 
31  real*8 Eein, Eg
32 
33  real*8 Ee
34  real*8 u, ale, us, ans
35  integer count
36  logical ok
37 
38  count = 0
39  if(eein-masele .le. bregmins ) then
40 ! simply avoid loop; ( Eek < 10 keV)
41  call rndc(u)
42  eg =( eein-masele ) * u
43  return ! ************
44  elseif(eein .lt. breemins) then
45 ! this and above happne when electron loses energy
46 ! after sampling of processes
47  ee = breemins
48  else
49  ee = eein
50  endif
51  ale = log10(ee)
52 
53  10 continue
54  call rndc(u)
55  if(u .gt. bruminsa) then
56 ! region A
57 
58  call k4ptdi(brstsa,
59  * bruszsa,
60  * bres,
61  * bruszsa,
62  * bruminsa,
63  * brleemins,
64  * brdusa,
65  * brdes, u, ale, ans)
66  eg= exp( ans*(1.-u))*bregmins
67  else
68 ! region B
69  us = u**0.25d0
70 
71  call k4ptdi(brstsb,
72  * bruszsb,
73  * bres,
74  * bruszsb,
75  * 0.d0,
76  * brleemins,
77  * brdusb,
78  * brdes, us, ale, ans)
79  eg = exp(-ans*u)*(ee-masele)
80 ! Eg = exp(-ans*u)*Ee
81  endif
82  ok = eein-eg .ge. masele
83  if(.not. ok) then
84  count = count + 1
85  if(count .gt. 100 ) then
86  call rndc(u)
87  eg = (eein-masele)*u
88  return ! ******
89  endif
90  goto 10
91  endif
92  end
93 
subroutine cbrssampe(Eein, Eg)
Definition: cBrSSamp.f:24
subroutine rndc(u)
Definition: rnd.f:91
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
const double masele
Definition: Zmass.h:2
subroutine k4ptdi(f, im, jm, iadj, x0, y0, hx, hy, x, y, ans)
Definition: k4ptdi.f:21
subroutine kintp3(f, intv, n, x1, h, x, ans)
Definition: kintp3.f:19
subroutine cbrssampp(Ee, prob)
Definition: cBrSSamp.f:2