COSMOS v7.655  COSMOSv7655
(AirShowerMC)
cmBremE2.f
Go to the documentation of this file.
1 ! test cmBremE2: second term of mag. brem.
2 ! implicit none
3 ! real*8 v, up
4 ! integer j, i
5 !
6 ! read(*,*) up
7 !
8 ! do i = 1, 50000
9 ! call cmBremE2(up, v, j)
10 ! write(*, *) sngl(v), j
11 ! enddo
12 ! end
13 !
14 ! samples fractional gamma ray energy from
15 ! v phai(2zeta)dv which is the 2nd term of the
16 ! syncroton emission, where phai(x) = x K2/3(x).
17 ! This can be rewritten as
18 ! 18Uz
19 ! ------------ z K2/3(z). Here U is upsilon.
20 ! (2+3Uz)^3
21 !
22 ! z^2 K2/3(z) and (2+3Uz)^(-3) are approximated by
23 ! a number of power functions.
24 !
25 ! z^2 K2/3(x) by 5
26 ! nOte: --> 1.0747764 z^(4/3) z-->0
27 ! --> sqrt(pi/2) z^(3/2) exp(-z) z-->inf.
28 ! The latter func. has peak value, 0.513 at z=3/2
29 ! and the slope at z is 3/2 - z.
30 !
31 ! 1/(2+3Uz)^3 ---> 1/8. z-->0
32 ! 1/z^1.5 with a value of 1/64 at z = 2/(3U).
33 ! 1/(3Uz)^3 z--> inf.
34 !
35 !
36  subroutine cmbreme2(up, v, nc)
37  implicit none
38  real*8 up ! input Upsilon value
39  real*8 v ! output. sampled fractional value
40  integer nc ! output. number of rejections. average trial
41 ! number is 1.16 for up=0.01 and 1.26 for
42 ! up=10.
43 !
44  integer n1, n2, n, i, na
45  parameter(n1 = 3, n2 = 5, n= 12)
46  real*8 c1(n1), x10(n1), p1(n1), x1p(n1+1), coef1(n1) ! for 1/(2+3Uz)^3
47 !
48  real*8 c2(n2), x20(n2), p2(n2), x2p(n2+1), coef2(n2) ! for z^2K2/3(z)
49 !
50  real*8 coef(n), p(n), xp(n+1)
51  real*8 z, fz, ft, ck23, u
52  logical first
53 
54  data p1/0.04433d0, 1.5d0, 2.8125d0/
55  data c1/0.1195d0, 1.5625d-2, 3.05175d-5/
56 
57 !
58  data x20/0.01d0, 1.d0, 2.511886d0, 7.4131d0,
59  * 19.95d0/
60  data c2/2.3096d-3, 4.9463d-1, 0.41808d0,
61  * 1.5448d-2, 2.427d-7/
62  data p2/-1.3298d0, -0.446d0, 1.04103, 5.92368d0,
63  * 18.007d0/
64 
65 
66  data first/.true./
67  save first, x1p, coef1, x2p, coef2, x10, x20
68 
69 !
70 
71  x10(1) = 0.01d0/up
72  x10(2) = 2.d0/3.d0/up
73  x10(3) = 10.d0/up
74 !
75 
76  call ksamppwx(c1, p1, x10, n1, x1p(2), coef1 )
77  x1p(1) = 0.
78  x1p(n1+1) = 30./up
79 ! write(*,*)' x1p, coef1=', x1p, coef1
80 !
81  if(first) then
82  call ksamppwx(c2, p2, x20, n2, x2p(2), coef2 )
83  first = .false.
84  x2p(1) = 0.
85  x2p(n2+1) = 30.
86 ! write(*,*) ' x2p, coef2=', x2p, coef2
87  endif
88  call ksamppwmrg(coef1, p1, x1p, n1,
89  * coef2, p2, x2p, n2,
90  * coef, p, xp, na)
91 ! write(*,*)'n, coef, p, xp=', na, coef, p, xp
92  do i =1, 1000
93  call ksamppw(i, coef, p, xp, na, z, fz)
94 ! write(*,*) ' z, fz=', z, fz
95  ft = z*z * ck23(z) / (2.+ 3.* up*z)**3
96  call rndc(u)
97  if(u .lt. ft/fz) goto 10
98  enddo
99  10 continue
100  nc = i
101  v = 3.*up*z/(2.+ 3.*up*z)
102  end
103 
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
block data cblkEvhnp ! currently usable models data RegMdls ad *special data *Cekaon d0
Definition: cblkEvhnp.h:5
subroutine ksamppwx(c, p, x0, n, xp, c2)
Definition: ksampPw.f:240
dE dx *! Nuc Int sampling table d
Definition: cblkMuInt.h:130
subroutine ksamppwmrg(c1, p1, x1, n1, c2, p2, x2, n2, c, p, x, n)
Definition: ksampPw.f:273
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 ! knockon is considered Obsolete *PhotoProd false
Definition: cblkElemag.h:7
subroutine ksamppw(ini, coef, power, node, n, x, fx)
Definition: ksampPw.f:95
subroutine cmbreme2(up, v, nc)
Definition: cmBremE2.f:38