COSMOS v7.655  COSMOSv7655
(AirShowerMC)
test3.f
Go to the documentation of this file.
1  program main
2  use modhistogram
3  use modhistogram1
4  use modhistogram3
5  implicit none
6  integer ns, nrbin, nebin, fno
7  parameter(ns=3, nrbin=10, nebin=8)
8  type(histogram3) h(ns)
9  save h
10  real*8 x, y, z, fx, R, tm
11  integer i, j
12 ! assume Energy spectrum E**-adE
13 ! R spectrum R**-bdR
14 ! T spectrum Texp(-T/c)dT
15 ! where
16 ! a=2log(R)-(s-1). ( E>1 )
17 ! b=1-(s-1) R<30 ( R>1 )
18 ! 3+(s-1) R>30
19 ! c= 0.1 + 10.0/E + R**2/300.+(s-1)
20 !
21 ! We take T-spectrum, regarding R and E as parameters.
22 ! for s=0.8, 1.0, 1.2
23 ! Let's see T for R= 1 to 500 with log10 step 0.5 (bin=6)
24 ! E= 1 to 30 with log10 step 0.5 (bin=3)
25 !
26  real*8 coef(2), pw(2), node(3), xp(1), ca(2)
27  real*8 a, b, c, u, E, s(ns)
28  character*24 dirstr, key
29  data s/0.8, 1.0, 1.2/
30 
31  call kwhistso(1)
32  fno=-6
33  do i = 1, ns
34  call kwhisti3(h(i),
35  * 1.0, 0.2, nrbin, b'00001', ! R
36  * 1.0, 0.2, nebin, b'01001', ! E count overflow
37  * 0.1, 0.1, 50, b'00011' ) ! T
38  call kwhistai3(h(i),
39  * "Time spectrum",
40  * "ret", "ptcls", .true., 0.,
41  * "r", "m", "E", "GeV", "T", "ns")
42  call kwhistc3(h(i))
43  pw(1) = 1.d0+(s(i)-1.)
44  pw(2) = 3.d0+ (s(i)-1.)
45  node(1) = 1.d0
46  node(2) = 30.d0
47  node(3) = 1.d5
48  coef(1) = 1.d0
49  coef(2) = 1./30.d0
50 
51  write(dirstr,'("s",i1,"/")') i
52  call kwhistdir3(h(i), dirstr)
53  write(key, '("s=",f5.2," r:")') s(i)
54  call kwhistid3(h(i), key)
55  call ksamppwx(coef, pw, node, 2, xp, ca)
56  do j = 1, 300000
57  call ksamppw(j, ca, pw, node, 2, r, fx)
58  a = -2.0 - log(r) + (s(i)-1.0)
59  call rndc(u)
60  e = u**(1./(a+1.))
61  c = 0.1 + 10./e + r**2/300. + (s(i)-1.)
62  call ksgmis(1, c, tm)
63  call kwhist3(h(i), sngl(r), sngl(e), sngl(tm), 1.0)
64  enddo
65  call kwhists3( h(i), 0. )
66  call kwhiststep3(h(i), 2, 2)
67  call kwhistp3( h(i), fno)
68  enddo
69  end program main
70 
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