COSMOS v7.655  COSMOSv7655
(AirShowerMC)
translate.f
Go to the documentation of this file.
1  program atmncobptcl
2  implicit doubleprecision(a-h,o-z)
3 #include "Zcoord.h"
4 #include "Zcode.h"
5 
6  include '../src3/include/atmnc-particle-code.inc'
7  logical,save::onlyfor1ry=.true.
8  logical,save::onlyhadron=.true.
9  integer:: lread(9)
10  integer:: k1, k100
11  real(8):: r1(5) ! rx, ry, rz, t, r: r1(1:3)=same as comsmos
12  real(8):: p1(5) ! px,py,pz, E, m
13  real(8):: w(3) ! direction cos.
14  integer:: code, subc, charge
15  integer:: sel
16  type(coord):: a, b
17  real(8):: p, r, cosz
18  character(len=10) input
19 
20  if( iargc() == 1 ) then
21  call getarg(1,input)
22  read(input,*) sel
23  else
24  write(0,*)
25  * 'Basic usage: ./translate$ARCH arg < Atmnc3-output '
26  write(0,*) 'arg:'
27  write(0,*)
28  * ' 1==>selecting only hadronic particls suited for Cosmos'
29  write(0,*)
30  * ' 1ry. The content is sufficient for cmkInc2'
31  write(0,*)
32  * ' 2==>same as 1 but include e and g, if any'
33  write(0,*)
34  * ' 3==>show all particles; content is more than above'
35  stop
36  endif
37 
38  if(sel == 1 ) then
39  ! default
40  elseif(sel == 2) then
41  onlyhadron = .false.
42  elseif(sel == 3) then
43  onlyfor1ry = .false.
44  onlyhadron = .false.
45  else
46  write(0,*) ' arg=', sel, ' invalid'
47  stop
48  endif
49 
50  if(onlyfor1ry) then
51  write(0,*)
52  * 'code subc charge Wxyz Et Rxyz llh cosz'
53  write(0,*)
54  * ' 1 2 3 4-6 7 8-10 11-13 14'
55  else
56  write(0,*)
57  * 'code subc charge k100 Pxyz KE Rxyz t R llh cosz'
58  write(0,*)
59  * ' 1 2 3 4 5 6 7 8 9-11 12 13 14-16 17'
60  endif
61 
62  do while(.true.)
63  read(*,'(I4,5I9,3I11)',end=9999, err=1999) ! new file
64  & (lread(i),i=1,9)
65  call translate_aline(lread, k1, r1, p1, k100)
66  call catmnctcos(k1, code, subc, charge)
67  a%sys = 'xyz'
68  a%r(1:3) = r1(1:3)
69  call ctranscoord2('llh', a, b)
70  p = sqrt( dot_product(p1(1:3), p1(1:3)))
71  r = r1(5) ! =sqrt( dot_product(r1(1:3), r1(1:3)))
72  cosz = dot_product(p1(1:3), r1(1:3))/p/r
73 
74  if(onlyfor1ry) then
75  if( k100 < 3 .and. cosz < 0. .and.
76  * (code /= kneue .or. code /= kneumu) ) then
77  if( (onlyhadron .and. code > kelec) .or.
78  * .not. onlyhadron ) then
79  w(1:3)= p1(1:3)/p
80  write(*, '(i3, i4, i3, 1p, 11g14.6)')
81  * code, subc, charge, w(1:3), p1(4), r1(1:3),
82  * b%r(1:3), cosz
83  endif
84  endif
85  else
86  write(*,'(i3, i4, i3, i5, 1p, 13g14.6)')
87  * code, subc, charge, k100, p1(1:3), p1(4)-p1(5),
88  * r1(1:5), b%r(1:3), cosz
89  endif
90  if(k100.ge.3) then ! primary, record here for all
91 ! call app_1ryratio(ik, ek, pickup)
92 ! crsamp = crsamp + 1
93 ! crsim = crsim + 1
94  else
95  if((k1 >= knue) .and. (k1 <= knumubar)) then
96  ! nutrino
97  else
98  ! r1(5) is the crossing radius
99  end if
100  end if ! neutrino or primary
101  1999 continue ! anyway move to next file
102  enddo
103 
104  9999 continue
105  end program atmncobptcl
106 
107  subroutine translate_aline(lread, k1, r1, p1, k100)
108  implicit doubleprecision (a-h, o-z)
109 ! masses of particles
110  include '../src3/include/atmnc-particle-mass2.inc'
111 
112  dimension r1(5), p1(5)
113  dimension lread(9)
114 
115  kk = lread(1)
116  k100 = int(kk/100)
117  k1 = kk - 100 * k100
118 ! write(*,*) lread(1), k100, k1
119 
120  pp = 10.d0**(1.d-6*lread(2))
121  rr = 0.
122  do k = 1, 3
123  r1(k) = lread(2+k)
124  p1(k) = 1.d-9 * lread(6+k)*pp
125  rr = rr + r1(k)**2
126  enddo
127  rr = sqrt(rr)
128 
129  r1(4) = 10.d0**(1.d-6*real(lread(6)))
130  r1(5) = rr
131 
132  p1(5) = am(k1)
133  p1(4) = sqrt(pp**2 + p1(5)**2)
134  end subroutine translate_aline
nodes z
nodes i
subroutine translate_aline(lread, k1, r1, p1, k100)
Definition: translate.f:108
subroutine catmnctcos(katmnc, code, subc, charge)
Definition: catmncTcos.f:2
program atmncobptcl
Definition: translate.f:1
max ptcl codes in the kelec
Definition: Zcode.h: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
max ptcl codes in the kneue
Definition: Zcode.h:2
subroutine ctranscoord2(sys, a, b)
Definition: ctransCoord2.f:2
block data cblkEvhnp ! currently usable models data RegMdls ad *special data *Cekaon d0
Definition: cblkEvhnp.h:5
struct ob o[NpMax]
Definition: Zprivate.h:34
max ptcl codes in the kneumu
Definition: Zcode.h:2
dE dx *! Nuc Int sampling table d
Definition: cblkMuInt.h:130
nodes a
dE dx *! Nuc Int sampling table b
Definition: cblkMuInt.h:130
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
dE dx *! Nuc Int sampling table h
Definition: cblkMuInt.h:130
Definition: Zcoord.h:43