COSMOS v7.655  COSMOSv7655
(AirShowerMC)
test2.f
Go to the documentation of this file.
1  program main
2 ! use modHistogram
3  use modhistogram1
4  use modhistogram2
5  implicit none
6  integer ns, nrbin, nebin, fno
7  parameter(ns=3, nrbin=10)
8  type(histogram2) h(ns)
9  type(histogram2) he(ns) ! this is for energy spectrum
10  save h, he
11  real*8 x, y, z, fx, R, tm
12  integer i, j
13 ! assume Energy spectrum E**-adE
14 ! R spectrum R**-bdR
15 ! T spectrum Texp(-T/c)dT
16 ! where
17 ! a=2log(R)-(s-1). ( E>1 )
18 ! b=1-(s-1) R<30 ( R>1 )
19 ! 3+(s-1) R>30
20 ! c= 0.1 + 10.0/E + R**2/300.+(s-1)
21 !
22 ! We take T-spectrum, regarding R and E as parameters.
23 ! for s=0.8, 1.0, 1.2
24 ! Let's see T for R= 1 to 500 with log10 step 0.5 (bin=6)
25 ! E= 1 to 30 with log10 step 0.5 (bin=3)
26 !
27  real*8 coef(2), pw(2), node(3), xp(1), ca(2)
28  real*8 a, b, c, u, E, s(ns)
29  character*24 dirstr, key
30  data s/0.8, 1.0, 1.2/
31 
32  call kwhistso(1) ! ascii output
33 
34  fno=-6 ! to stdout
35 
36  do i = 1, ns
37  call kwhisti2(h(i),
38  * 1.0, 0.2, nrbin, b'00001', ! R
39  * 0.1, 0.1, 50, b'00011' ) ! T
40  call kwhistai2(h(i),
41  * "Time spectrum",
42  * "rt", "ptcls", .true., 0.,
43  * "r", "m", "T", "ns")
44  call kwhistc2(h(i))
45 !
46  call kwhisti2(he(i),
47  * 1.0, 0.2, nrbin, b'01001', ! R
48  * 1.0, 0.1, 30, b'00001' ) ! E
49  call kwhistai2(he(i),
50  * "Energy spectrum at diff. r",
51  * "re", "ptcls", .true., 2.,
52  * "r", "m", "E", "GeV")
53  call kwhistc2(he(i))
54 
55  pw(1) = 1.d0+(s(i)-1.)
56  pw(2) = 3.d0+ (s(i)-1.)
57  node(1) = 1.d0
58  node(2) = 30.d0
59  node(3) = 1.d5
60  coef(1) = 1.d0
61  coef(2) = 1./30.d0
62 
63  write(dirstr,'("s",i1,"/")') i
64  call kwhistdir2(h(i), dirstr)
65  call kwhistdir2(he(i), dirstr)
66  write(key, '("s=",f5.2," r:")') s(i)
67  call kwhistid2(h(i), key)
68  call kwhistid2(he(i), key)
69  call ksamppwx(coef, pw, node, 2, xp, ca)
70  do j = 1, 300000
71  call ksamppw(j, ca, pw, node, 2, r, fx)
72  a = -2.0 - log(r) + (s(i)-1.0)
73  call rndc(u)
74  e = u**(1./(a+1.))
75  c = 0.1 + 10./e + r**2/300. + (s(i)-1.)
76  call ksgmis(1, c, tm)
77  call kwhist2(h(i), sngl(r), sngl(tm), 1.0)
78  call kwhist2(he(i), sngl(r), sngl(e), 1.0)
79  enddo
80  call kwhists2( h(i), 0. )
81  call kwhists2( he(i), 0. )
82  call kwhiststep2(h(i), 2)
83  call kwhiststep2(he(i), 2)
84  call kwhistp2( h(i), fno)
85  call kwhistp2( he(i), fno)
86  enddo
87  end program main
88 
integer npitbl real *nx parameter(n=101, npitbl=46, nx=n-1) real *8 uconst
subroutine ksgmis(n, a, x)
Definition: ksgamd.f:140
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
void kwhistso(int binw)
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
program main
Definition: ascii2bin.f:1
subroutine ksamppw(ini, coef, power, node, n, x, fx)
Definition: ksampPw.f:95