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

Go to the source code of this file.

Functions/Subroutines

subroutine cbrssampp (Ee, prob)
 
subroutine cbrssampe (Eein, Eg)
 

Function/Subroutine Documentation

◆ cbrssampe()

subroutine cbrssampe ( real*8  Eein,
real*8  Eg 
)

Definition at line 24 of file cBrSSamp.f.

References d0, k4ptdi(), masele, and rndc().

Referenced by cbremsenergy().

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
atmos%rho(atmos%nodes) **exp(-(z-atmos%z(atmos%nodes))/Hinf) elseif(z .lt. atmos%z(1)) then ans=atmos%rho(1) **exp((atmos%z(1) -z)/atmos%H(1)) else call kdwhereis(z, atmos%nodes, atmos%z, 1, i) a=atmos%a(i) if(a .ne. 0.d0) then ans=atmos%rho(i) **(1+a *(z-atmos%z(i))/atmos%H(i)) **(-1.0d0-1.d0/a) else ans=*atmos%rho(i) *exp(-(z-atmos%z(i))/atmos%H(i)) endif endif ! zsave=z ! endif cvh2den=ans end ! ---------------------------------- real *8 function cvh2temp(z) implicit none ! vettical height to temperatur(Kelvin) real *8 z ! input. vertical height in m ! output is temperature of the atmospher in Kelvin real *8 ans integer i if(z .gt. atmos%z(atmos%nodes)) then ans=atmos%T(atmos%nodes) elseif(z .lt. atmos%z(1)) then ans=atmos%T(1)+atmos%b(1) *(z - atmos%z(1)) else call kdwhereis(z, atmos%nodes, atmos%z, 1, i) ans=atmos%T(i)+atmos%b(i) *(z-atmos%z(i)) endif cvh2temp=ans end !--------------------------------------------- real *8 function cthick2h(t) implicit none real *8 t ! input. air thickness in kg/m^2 real *8 logt, ans integer i real *8 dod0, fd, a logt=log(t) if(t .ge. atmos%cumd(1)) then ans=atmos%z(1) - *(logt - atmos%logcumd(1)) *atmos%H(1) elseif(t .le. atmos%cumd(atmos%nodes)) then ans=atmos%z(atmos%nodes) - *Hinf *log(t/atmos%cumd(atmos%nodes)) else call kdwhereis(t, atmos%nodes, atmos%cumd, 1, i) ! i is such that X(i) > x >=x(i+1) ans
subroutine rndc(u)
Definition: rnd.f:91
block data cblkEvhnp ! currently usable models data RegMdls ad *special data *Cekaon d0
Definition: cblkEvhnp.h:5
const double masele
Definition: Zmass.h:2
subroutine k4ptdi(f, im, jm, iadj, x0, y0, hx, hy, x, y, ans)
Definition: k4ptdi.f:21
Here is the call graph for this function:
Here is the caller graph for this function:

◆ cbrssampp()

subroutine cbrssampp ( real*8  Ee,
real*8  prob 
)

Definition at line 2 of file cBrSSamp.f.

References d, and kintp3().

Referenced by cbremspath().

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
dE dx *! Nuc Int sampling table d
Definition: cblkMuInt.h:130
subroutine kintp3(f, intv, n, x1, h, x, ans)
Definition: kintp3.f:19
Here is the call graph for this function:
Here is the caller graph for this function: