COSMOS v7.655  COSMOSv7655
(AirShowerMC)
det2prim.f
Go to the documentation of this file.
1 !
2 ! get transformation matrix for converting detector system vector
3 ! into primary system vector.
4 ! Since primary system depends on each sampled primary, the
5 ! random number by param file must be fixed.
6 ! This program gets the conversion matrix for the 1 st event
7 ! specified in the param
8 !
9 
10 #include "BlockData/cblkGene.h"
11  implicit none
12 
13 #include "Zglobalc.h"
14 #include "Ztrack.h"
15 #include "Ztrackp.h"
16 #include "Ztrackv.h"
17 #include "Zobs.h"
18 #include "Zobsv.h"
19 
20 
21 
22 
23  type(coord):: aa, bb, cc, det, detyaxis
24  integer fin
25  type(track):: inci
26 
27  open(10, file="param")
28 
29  call creadparam(10)
30  call cbeginrun
31  call cmkincident(inci, fin)
32  call cinitracking(inci)
33 
34  det = obssites(noofsites)%pos%xyz
35 
36  write(0, *) ' detector base pos in Exyz'
37  write(0,'(3g17.9)') det%x, det%y, det%z
38  write(0,*) 'incident position in Exyz'
39  write(0,*) inci%pos%xyz%x, inci%pos%xyz%y,
40  * inci%pos%xyz%z
41  call cxyz2det(det, inci%pos%xyz, cc)
42  write(0,*) 'incident position in Det'
43  write(0,*) cc%x, cc%y, cc%z
44 
45  call cvecprod(detzaxis, detxaxis, detyaxis)
46  write(0,*) ' '
47  write(0,*) ' detector X,Y,Z axis vecgor in Exyz'
48  write(0,'(3g17.9)') detxaxis%x, detxaxis%y, detxaxis%z
49  write(0,'(3g17.9)') detyaxis%x, detyaxis%y, detyaxis%z
50  write(0,'(3g17.9)') detzaxis%x, detzaxis%y, detzaxis%z
51 ! we try to convert {X,Y,Z}primary into the one in
52 ! detector system-->a,b,c.
53  call citransvectzx(1, detzaxis, detxaxis, xprimary, aa)
54  call citransvectzx(2, detzaxis, detxaxis, yprimary, bb)
55  call citransvectzx(2, detzaxis, detxaxis, zprimary, cc)
56 ! primary etc is the vector representing the primary system axes
57 ! in the Detector system. Then, a given vector R in Detector system,
58 ! its component to the a,b,c is Rx, Ry, Rz in the Primary is primary
59 ! system.
60 !
61  write(0,*) ' Primary systrem X,Y,Z axis vector in Exyz'
62  write(0,'(3g17.9)') xprimary%x, xprimary%y, xprimary%z
63  write(0,'(3g17.9)') yprimary%x, yprimary%y, yprimary%z
64  write(0,'(3g17.9)') zprimary%x, zprimary%y, zprimary%z
65 
66  write(0,*) ' For a given vector in the Detector system'
67  write(0,*) ' take scaler product of the following vector to get'
68  write(0,*) ' its x value in the primary system. For y, z, use '
69  write(0,*) ' 2nd, 3rd row'
70  write(*,'(3g17.9)') aa%x, aa%y, aa%z
71  write(*,'(3g17.9)') bb%x, bb%y, bb%z
72  write(*,'(3g17.9)') cc%x, cc%y, cc%z
73 
74  end
75  subroutine chooktrace
76  end
77  subroutine chookceren
78  end
79  subroutine chookcerens
80  end
81  subroutine chookcerene
82  end
83  subroutine chookbgrun
84  end
85 
86 
87 
Definition: Ztrack.h:44
subroutine cmkincident(incident, fin)
Definition: cmkIncident.f:5
subroutine cvecprod(a, b, c)
Definition: cvecProd.f:4
subroutine chookceren
Definition: det2Exyz.f:63
subroutine creadparam(io)
Definition: creadParam.f:5
subroutine chooktrace
Definition: chook.f:275
subroutine chookcerene
Definition: det2Exyz.f:67
subroutine cinitracking(incident)
Definition: ciniTracking.f:2
subroutine chookcerens(no, primary, angle)
Definition: ctemplCeren.f:19
subroutine citransvectzx(init, zax, xax, dir1, dir2)
Definition: ctransVectZx.f:102
Definition: Zcoord.h:43
subroutine cbeginrun
Definition: cbeginRun.f:7
subroutine cxyz2det(det, a, b)
Definition: cxyz2det.f:7
subroutine chookbgrun
Definition: chook.f:15