1 | // $Id: RecoTruth.cc 1356 2005-01-05 13:08:21Z pesce $ |
---|
2 | // Author: R.Pesce 2005/01/04 |
---|
3 | |
---|
4 | /***************************************************************************** |
---|
5 | * ESAF: Euso Simulation and Analysis Framework * |
---|
6 | * * |
---|
7 | * Id: RecoTruth * |
---|
8 | * Package: <packagename> * |
---|
9 | * Coordinator: <coordinator> * |
---|
10 | * * |
---|
11 | *****************************************************************************/ |
---|
12 | |
---|
13 | //_____________________________________________________________________________ |
---|
14 | // |
---|
15 | // RecoTruth |
---|
16 | // |
---|
17 | // <extensive class description> |
---|
18 | // |
---|
19 | // Config file parameters |
---|
20 | // ====================== |
---|
21 | // |
---|
22 | // <parameter name>: <parameter description> |
---|
23 | // -Valid options: <available options> |
---|
24 | // |
---|
25 | |
---|
26 | #include "RecoTruth.hh" |
---|
27 | |
---|
28 | ClassImp(RecoTruth) |
---|
29 | |
---|
30 | //_____________________________________________________________________________ |
---|
31 | RecoTruth::RecoTruth() { |
---|
32 | // |
---|
33 | // Constructor |
---|
34 | // |
---|
35 | Clear(); |
---|
36 | } |
---|
37 | |
---|
38 | //_____________________________________________________________________________ |
---|
39 | RecoTruth::~RecoTruth() { |
---|
40 | // |
---|
41 | // Destructor |
---|
42 | // |
---|
43 | Clear(); |
---|
44 | } |
---|
45 | |
---|
46 | //_____________________________________________________________________________ |
---|
47 | RecoTruth::RecoTruth( const RecoTruth& other ) { |
---|
48 | // |
---|
49 | // Copy Constructor |
---|
50 | // |
---|
51 | other.Copy( *this ); |
---|
52 | } |
---|
53 | |
---|
54 | //_____________________________________________________________________________ |
---|
55 | void RecoTruth::Copy( TObject& other ) const { |
---|
56 | // |
---|
57 | // Copy to a new object |
---|
58 | // |
---|
59 | TObject::Copy( other ); |
---|
60 | |
---|
61 | ((RecoTruth&)other).fEnergy = fEnergy; |
---|
62 | ((RecoTruth&)other).fTheta = fTheta; |
---|
63 | ((RecoTruth&)other).fPhi = fPhi; |
---|
64 | ((RecoTruth&)other).fX1 = fX1; |
---|
65 | ((RecoTruth&)other).fXMax = fXMax; |
---|
66 | ((RecoTruth&)other).fEarthAge = fEarthAge; |
---|
67 | ((RecoTruth&)other).fInitPosX = fInitPosX; |
---|
68 | ((RecoTruth&)other).fInitPosY = fInitPosY; |
---|
69 | ((RecoTruth&)other).fInitPosZ = fInitPosZ; |
---|
70 | ((RecoTruth&)other).fMaxPosX = fMaxPosX; |
---|
71 | ((RecoTruth&)other).fMaxPosY = fMaxPosY; |
---|
72 | ((RecoTruth&)other).fMaxPosZ = fMaxPosZ; |
---|
73 | ((RecoTruth&)other).fEarthImpactX = fEarthImpactX; |
---|
74 | ((RecoTruth&)other).fEarthImpactY = fEarthImpactY; |
---|
75 | ((RecoTruth&)other).fEarthImpactZ = fEarthImpactZ; |
---|
76 | } |
---|
77 | |
---|
78 | //_____________________________________________________________________________ |
---|
79 | void RecoTruth::Clear() { |
---|
80 | // |
---|
81 | // Clear method |
---|
82 | // |
---|
83 | fEnergy = -1; |
---|
84 | fTheta = -1; |
---|
85 | fPhi = -1; |
---|
86 | fX1 = -1; |
---|
87 | fInitPosX = -1; |
---|
88 | fInitPosY = -1; |
---|
89 | fInitPosZ = -1; |
---|
90 | fMaxPosX = -1; |
---|
91 | fMaxPosY = -1; |
---|
92 | fMaxPosZ = -1; |
---|
93 | fXMax = -1; |
---|
94 | fEarthImpactX = -1; |
---|
95 | fEarthImpactY = -1; |
---|
96 | fEarthImpactZ = -1; |
---|
97 | fEarthAge = -1; |
---|
98 | } |
---|
99 | |
---|
100 | //_____________________________________________________________________________ |
---|
101 | Double_t RecoTruth::GetInitPos( Int_t i ) const { |
---|
102 | // |
---|
103 | // Return true init position by component: 0 for X, 1 for Y, 2 for Z |
---|
104 | // |
---|
105 | switch(i) { |
---|
106 | case 0: |
---|
107 | return fInitPosX; |
---|
108 | case 1: |
---|
109 | return fInitPosY; |
---|
110 | case 2: |
---|
111 | return fInitPosZ; |
---|
112 | default: |
---|
113 | Error("GetInitPos(i)","bad index (%d) returning 0",i); |
---|
114 | } |
---|
115 | return 0.; |
---|
116 | } |
---|
117 | |
---|
118 | //_____________________________________________________________________________ |
---|
119 | Double_t RecoTruth::GetMaxPos( Int_t i ) const { |
---|
120 | // |
---|
121 | // Return true max position by component: 0 for X, 1 for Y, 2 for Z |
---|
122 | // |
---|
123 | switch(i) { |
---|
124 | case 0: |
---|
125 | return fMaxPosX; |
---|
126 | case 1: |
---|
127 | return fMaxPosY; |
---|
128 | case 2: |
---|
129 | return fMaxPosZ; |
---|
130 | default: |
---|
131 | Error("GetMaxPos(i)","bad index (%d) returning 0",i); |
---|
132 | } |
---|
133 | return 0.; |
---|
134 | } |
---|
135 | |
---|
136 | //_____________________________________________________________________________ |
---|
137 | Double_t RecoTruth::GetEarthImpact( Int_t i ) const { |
---|
138 | // |
---|
139 | // Return true earth impact position by component: 0 for X, 1 for Y, 2 for Z |
---|
140 | // |
---|
141 | switch(i) { |
---|
142 | case 0: |
---|
143 | return fEarthImpactX; |
---|
144 | case 1: |
---|
145 | return fEarthImpactY; |
---|
146 | case 2: |
---|
147 | return fEarthImpactZ; |
---|
148 | default: |
---|
149 | Error("GetEarthImpact(i)","bad index (%d) returning 0",i); |
---|
150 | } |
---|
151 | return 0.; |
---|
152 | } |
---|
153 | |
---|