COSMOS v7.655  COSMOSv7655
(AirShowerMC)
integratedEdx.f
Go to the documentation of this file.
1 ! Give .hyb datfile. It may or may not contain a blank line as an event separator.
2 ! complile: e.g. ifort integratedEdx.f -L$COSMOSTOP/lib/MacIFC -lcosmos
3 ! usage echo xxx.hyb | ./a.out
4  implicit none
5  integer np, nc, i
6  parameter(np=100, nc=100)
7  real*8 x(np), y(np)
8  real*8 dmy
9  integer npa, idmy, eventno
10  character*130 hybfile, input
11  hybfile = ' '
12  read(*, '(a)') hybfile
13  open(11, file=hybfile)
14  npa = 0
15  eventno= 0
16  do while(.true.)
17  read(11, '(a)', end=999) input
18  if( input(1:1) .eq. 'h' ) then
19  if(npa .gt. 0) then
20  eventno = eventno + 1
21  call integrate(eventno, x, y, npa)
22  npa = 0
23  endif
24  continue
25  elseif( input .eq. ' ' ) then
26  continue
27  else
28  npa = npa + 1
29 ! read(input,
30 ! * '(1x, i4, f7.1, f7.1, 2f6.3,5e11.3,e11.3)')
31 ! * idmy, x(npa), dmy, dmy, dmy, dmy, dmy, dmy, dmy,
32 ! * dmy, y(npa)
33  read(input(2:130),*)
34  * idmy, x(npa), dmy, dmy, dmy, dmy, dmy, dmy, dmy,
35  * dmy, y(npa)
36  endif
37  enddo
38  999 continue
39  if(npa .gt. 0) then
40  eventno = eventno + 1
41  call integrate(eventno, x, y, npa)
42  endif
43  close(11)
44  end
45  subroutine integrate(eventno, x, y, npa)
46  implicit none
47  integer npa, eventno
48  integer np, nc
49  parameter(np=100, nc=100)
50  real*8 x(np), y(np)
51  real*8 ans, coef(nc, 3)
52  real*8 a, b, s
53  integer i
54 
55 
56  a = x(1)
57  b = x(npa)
58  call ktrpzintt2(y, 1, npa, x, 1, a, b, ans)
59  call kcsplcoef(x, y, npa, coef, nc)
60  call kcsplinteg(x, y, npa, coef, nc, a, b, s)
61  write(*,'(i5, 1p 2g14.3, i4)') eventno, ans, s, npa
62  end
63 
subroutine kcsplinteg(x, y, n, coef, nc, a, b, s)
Definition: kcsplInteg.f:2
integer npitbl real *nx parameter(n=101, npitbl=46, nx=n-1) real *8 uconst
subroutine kcsplcoef(x, y, n, coef, nc)
Definition: kcsplCoef.f:2
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 ktrpzintt2(t, intv, n, xt, intvx, a, b, ans)
Definition: ktrpzIntT2.f:5
latitude latitude this system is used *****************************************************************! type coord sequence union map real y
Definition: Zcoord.h:25
subroutine integrate(eventno, x, y, npa)
Definition: integratedEdx.f:46
real cut integer nc
Definition: Zprivate.h:1
! structure defining a particle at production ! Basic idea of what is to be contained in ! the particle structue is that dynamical ones should be included those derivable from the particle code ! is not included ******************************************************type fmom momentum sequence union map real e endmap map real * x
Definition: Zptcl.h:21