1 | // $Id: ETruth.hh 2917 2011-06-10 11:01:18Z mabl $ |
---|
2 | // A.Thea created May, 23 2004 |
---|
3 | |
---|
4 | /***************************************************************************** |
---|
5 | * ESAF: Euso Simulation and Analysis Framework * |
---|
6 | * * |
---|
7 | * Id: ETruth * |
---|
8 | * Package: SimuEvent * |
---|
9 | * Coordinator: Alessandro.Thea * |
---|
10 | * * |
---|
11 | *****************************************************************************/ |
---|
12 | |
---|
13 | #ifndef __ETRUTH_HH__ |
---|
14 | #define __ETRUTH_HH__ |
---|
15 | |
---|
16 | #include "TObject.h" |
---|
17 | #include "TString.h" |
---|
18 | #include "TVector3.h" |
---|
19 | |
---|
20 | #include "EFillable.hh" |
---|
21 | |
---|
22 | //////////////////////////////////////////////////////////////////////////////// |
---|
23 | // // |
---|
24 | // ETruth // |
---|
25 | // // |
---|
26 | // MonteCarlo truth object // |
---|
27 | // // |
---|
28 | //////////////////////////////////////////////////////////////////////////////// |
---|
29 | |
---|
30 | class ETruth : public TObject, public EFillable { |
---|
31 | public: |
---|
32 | ETruth(); |
---|
33 | ETruth( const ETruth& ); |
---|
34 | |
---|
35 | virtual ~ETruth(); |
---|
36 | |
---|
37 | virtual void Clear( Option_t* = "" ); |
---|
38 | virtual void Copy( TObject& ) const; |
---|
39 | |
---|
40 | // getters |
---|
41 | inline Float_t GetTrueEnergy() const { return fTrueEnergy; } |
---|
42 | inline Float_t GetTrueTheta() const { return fTrueTheta; } |
---|
43 | Float_t GetTrueThetaLocal() const; // in frame defined at TOAimpact |
---|
44 | inline Float_t GetTruePhi() const { return fTruePhi; } |
---|
45 | Float_t GetTruePhiLocal() const; // in frame defined at TOAimpact |
---|
46 | inline const char* GetTrueParticleName() { return fTrueParticleName.Data();} |
---|
47 | inline Int_t GetTrueParticleCode() const { return fTrueParticleCode;} |
---|
48 | inline Float_t GetTrueInitPos( Int_t ) const; |
---|
49 | inline Float_t GetTrueX1() const { return fTrueX1; } |
---|
50 | inline Float_t GetTrueEarthImpact( Int_t ) const; |
---|
51 | inline Float_t GetTrueEarthAge() const { return fTrueEarthAge;} |
---|
52 | inline Float_t GetTrueShowerMaxPos( Int_t ) const; |
---|
53 | inline Float_t GetTrueShowerXMax() const { return fTrueShowerXMax;} |
---|
54 | inline Float_t GetTrueTOAImpact( Int_t ) const; |
---|
55 | inline Float_t GetTrueHclouds() const { return fTrueHclouds; } |
---|
56 | inline Float_t GetTrueCloudsthick() const { return fTrueCloudsthick; } |
---|
57 | inline Float_t GetTrueCloudsOD() const { return fTrueCloudsOD; } |
---|
58 | inline Float_t GetTrueLatitude() const { return fTrueLatitude; } |
---|
59 | inline Float_t GetTrueLongitude() const { return fTrueLongitude; } |
---|
60 | inline Float_t GetTrueDate() const { return fTrueDate; } |
---|
61 | inline Float_t GetTrueHGround() const { return fTrueHGround; } |
---|
62 | inline Float_t GetTrueGroundAlbedo() const { return fTrueGroundAlbedo; } |
---|
63 | inline Float_t GetTrueGroundSpecular() const { return fTrueGroundSpecular; } |
---|
64 | |
---|
65 | inline TVector3 GetTrueInitPos() const; |
---|
66 | inline TVector3 GetTrueEarthImpact() const; |
---|
67 | inline TVector3 GetTrueShowerMaxPos() const; |
---|
68 | inline TVector3 GetTrueTOAImpact() const; |
---|
69 | |
---|
70 | |
---|
71 | inline void SetTrueEnergy( Float_t e ) { fTrueEnergy = e; } |
---|
72 | inline void SetTrueTheta( Float_t theta ) { fTrueTheta = theta; } |
---|
73 | inline void SetTruePhi( Float_t phi ) { fTruePhi = phi; } |
---|
74 | inline void SetTrueParticleCode( Int_t code ) { fTrueParticleCode = code; } |
---|
75 | inline void SetTrueInitPos( Int_t i, Float_t x ); |
---|
76 | inline void SetTrueX1( Float_t x1 ) { fTrueX1 = x1; } |
---|
77 | inline void SetTrueEarthImpact( Int_t i, Float_t x ); |
---|
78 | inline void SetTrueEarthAge( Float_t ea ) { fTrueEarthAge = ea; } |
---|
79 | inline void SetTrueShowerMaxPos( Int_t i, Float_t x ) ; |
---|
80 | inline void SetTrueShowerXMax( Float_t xmax ) { fTrueShowerXMax = xmax; } |
---|
81 | inline void SetTrueTOAImpact( Int_t i, Float_t x ); |
---|
82 | inline void SetTrueHclouds( Float_t h ) { fTrueHclouds = h; } |
---|
83 | inline void SetTrueCloudsthick( Float_t t ) { fTrueCloudsthick = t; } |
---|
84 | inline void SetTrueCloudsOD( Float_t od ) { fTrueCloudsOD = od; } |
---|
85 | inline void SetTrueLatitude( Float_t lat ) { fTrueLatitude = lat; } |
---|
86 | inline void SetTrueLongitude( Float_t longi ) { fTrueLongitude = longi; } |
---|
87 | inline void SetTrueDate( Float_t dat ) { fTrueDate = dat; } |
---|
88 | inline void SetTrueHGround( Float_t h ) { fTrueHGround = h; } |
---|
89 | inline void SetTrueGroundAlbedo( Float_t alb ) { fTrueGroundAlbedo = alb; } |
---|
90 | inline void SetTrueGroundSpecular( Float_t spec ) { fTrueGroundSpecular = spec; } |
---|
91 | |
---|
92 | inline void SetTrueInitPos( const TVector3& v ); |
---|
93 | inline void SetTrueEarthImpact( const TVector3& v ); |
---|
94 | inline void SetTrueShowerMaxPos( const TVector3& v ) ; |
---|
95 | inline void SetTrueTOAImpact( const TVector3& v ); |
---|
96 | |
---|
97 | |
---|
98 | |
---|
99 | private: |
---|
100 | Float_t fTrueEnergy; // primary EECR energy (eV) |
---|
101 | Float_t fTrueTheta; // incidence angle (rad) |
---|
102 | Float_t fTruePhi; // azimuth; Phi=0 corresponds Y=0 |
---|
103 | TString fTrueParticleName; // particle name (see above) |
---|
104 | Int_t fTrueParticleCode; // same as name with code instead of strings |
---|
105 | Float_t fTrueInitPosX; // first interaction point (3D coord, Km) |
---|
106 | Float_t fTrueInitPosY; // first interaction point (3D coord, Km) |
---|
107 | Float_t fTrueInitPosZ; // first interaction point (3D coord, Km) |
---|
108 | Float_t fTrueX1; // interaction depth in g/cm^2 |
---|
109 | Float_t fTrueEarthImpactX; // impact of shower on earth (clouds ignored) |
---|
110 | Float_t fTrueEarthImpactY; // impact of shower on earth (clouds ignored) |
---|
111 | Float_t fTrueEarthImpactZ; // impact of shower on earth (clouds ignored) |
---|
112 | Float_t fTrueTOAImpactX; // impact of shower on top of the atmosphere |
---|
113 | Float_t fTrueTOAImpactY; // impact of shower on top of the atmosphere |
---|
114 | Float_t fTrueTOAImpactZ; // impact of shower on top of the atmosphere |
---|
115 | Float_t fTrueEarthAge; // age of the shower at impact |
---|
116 | Float_t fTrueShowerMaxPosX; // shower max position (3D coord, Km) |
---|
117 | Float_t fTrueShowerMaxPosY; // shower max position (3D coord, Km) |
---|
118 | Float_t fTrueShowerMaxPosZ; // shower max position (3D coord, Km) |
---|
119 | Float_t fTrueShowerXMax; // shower max depth (g/cm^2) |
---|
120 | Float_t fTrueHclouds; // altitude of the clouds. smaller than 0 means no clouds |
---|
121 | Float_t fTrueCloudsthick; // clouds thickness |
---|
122 | Float_t fTrueCloudsOD; // clouds OD |
---|
123 | Float_t fTrueLatitude; // geodetic latitude (also used to identify std atmospheres) |
---|
124 | // USStd : 100 |
---|
125 | // Tropical : 101 |
---|
126 | // MidLat Summer : 102 |
---|
127 | // MidLat Winter : 103 |
---|
128 | // LinsleyAtmo : 104 |
---|
129 | Float_t fTrueLongitude; // geodetic longitude |
---|
130 | Float_t fTrueDate; // event date |
---|
131 | Float_t fTrueHGround; // ground altitude |
---|
132 | Float_t fTrueGroundAlbedo; // ground albedo |
---|
133 | Float_t fTrueGroundSpecular; // ground specular component intensity |
---|
134 | |
---|
135 | SetEVisitable() |
---|
136 | |
---|
137 | ClassDef(ETruth,3) |
---|
138 | |
---|
139 | }; |
---|
140 | |
---|
141 | inline TVector3 ETruth::GetTrueInitPos() const { |
---|
142 | return TVector3(fTrueInitPosX, fTrueInitPosY, fTrueInitPosZ); |
---|
143 | } |
---|
144 | |
---|
145 | inline void ETruth::SetTrueInitPos( const TVector3& v ){ |
---|
146 | fTrueInitPosX = v.X(); |
---|
147 | fTrueInitPosY = v.Y(); |
---|
148 | fTrueInitPosZ = v.Z(); |
---|
149 | } |
---|
150 | |
---|
151 | inline Float_t ETruth::GetTrueInitPos( Int_t i ) const { |
---|
152 | // return TrueInitPos component by index |
---|
153 | |
---|
154 | switch(i) { |
---|
155 | case 0: |
---|
156 | return fTrueInitPosX; |
---|
157 | case 1: |
---|
158 | return fTrueInitPosY; |
---|
159 | case 2: |
---|
160 | return fTrueInitPosZ; |
---|
161 | default: |
---|
162 | Error("GetTrueInitPos(i)", "bad index (%d) returning 0",i); |
---|
163 | } |
---|
164 | return 0.; |
---|
165 | } |
---|
166 | |
---|
167 | inline void ETruth::SetTrueInitPos( Int_t i, Float_t x ) { |
---|
168 | // TrueInitPos component by index |
---|
169 | |
---|
170 | switch(i) { |
---|
171 | case 0: |
---|
172 | fTrueInitPosX = x; |
---|
173 | break; |
---|
174 | case 1: |
---|
175 | fTrueInitPosY = x; |
---|
176 | break; |
---|
177 | case 2: |
---|
178 | fTrueInitPosZ = x; |
---|
179 | break; |
---|
180 | default: |
---|
181 | Error("SetTrueInitPos(i)", "bad index (%d)",i); |
---|
182 | } |
---|
183 | } |
---|
184 | |
---|
185 | inline TVector3 ETruth::GetTrueEarthImpact() const { |
---|
186 | return TVector3(fTrueEarthImpactX, fTrueEarthImpactY, fTrueEarthImpactZ); |
---|
187 | } |
---|
188 | |
---|
189 | inline void ETruth::SetTrueEarthImpact( const TVector3& v ){ |
---|
190 | fTrueEarthImpactX = v.X(); |
---|
191 | fTrueEarthImpactY = v.Y(); |
---|
192 | fTrueEarthImpactZ = v.Z(); |
---|
193 | } |
---|
194 | |
---|
195 | inline Float_t ETruth::GetTrueEarthImpact( Int_t i) const { |
---|
196 | // return TrueEarthImpact component by index |
---|
197 | |
---|
198 | switch(i) { |
---|
199 | case 0: |
---|
200 | return fTrueEarthImpactX; |
---|
201 | case 1: |
---|
202 | return fTrueEarthImpactY; |
---|
203 | case 2: |
---|
204 | return fTrueEarthImpactZ; |
---|
205 | default: |
---|
206 | Error("GetTrueEarthImpact(i)", "bad index (%d) returning 0",i); |
---|
207 | } |
---|
208 | return 0.; |
---|
209 | } |
---|
210 | |
---|
211 | inline void ETruth::SetTrueEarthImpact( Int_t i, Float_t x ) { |
---|
212 | // TrueEarthImpact component by index |
---|
213 | |
---|
214 | switch(i) { |
---|
215 | case 0: |
---|
216 | fTrueEarthImpactX = x; |
---|
217 | break; |
---|
218 | case 1: |
---|
219 | fTrueEarthImpactY = x; |
---|
220 | break; |
---|
221 | case 2: |
---|
222 | fTrueEarthImpactZ = x; |
---|
223 | break; |
---|
224 | default: |
---|
225 | Error("SetTrueEarthImpact(i)", "bad index (%d)",i); |
---|
226 | } |
---|
227 | } |
---|
228 | |
---|
229 | inline TVector3 ETruth::GetTrueTOAImpact() const { |
---|
230 | return TVector3(fTrueTOAImpactX, fTrueTOAImpactY, fTrueTOAImpactZ); |
---|
231 | } |
---|
232 | |
---|
233 | inline void ETruth::SetTrueTOAImpact( const TVector3& v ){ |
---|
234 | fTrueTOAImpactX = v.X(); |
---|
235 | fTrueTOAImpactY = v.Y(); |
---|
236 | fTrueTOAImpactZ = v.Z(); |
---|
237 | } |
---|
238 | |
---|
239 | inline Float_t ETruth::GetTrueTOAImpact( Int_t i) const { |
---|
240 | // return TrueTOAImpact component by index |
---|
241 | |
---|
242 | switch(i) { |
---|
243 | case 0: |
---|
244 | return fTrueTOAImpactX; |
---|
245 | case 1: |
---|
246 | return fTrueTOAImpactY; |
---|
247 | case 2: |
---|
248 | return fTrueTOAImpactZ; |
---|
249 | default: |
---|
250 | Error("GetTrueTOAImpact(i)", "bad index (%d) returning 0",i); |
---|
251 | break; |
---|
252 | } |
---|
253 | return 0.; |
---|
254 | } |
---|
255 | |
---|
256 | inline void ETruth::SetTrueTOAImpact( Int_t i, Float_t x ) { |
---|
257 | // TrueTOAImpact component by index |
---|
258 | |
---|
259 | switch(i) { |
---|
260 | case 0: |
---|
261 | fTrueTOAImpactX = x; |
---|
262 | break; |
---|
263 | case 1: |
---|
264 | fTrueTOAImpactY = x; |
---|
265 | break; |
---|
266 | case 2: |
---|
267 | fTrueTOAImpactZ = x; |
---|
268 | break; |
---|
269 | default: |
---|
270 | Error("SetTrueTOAImpact(i)", "bad index (%d)",i); |
---|
271 | break; |
---|
272 | } |
---|
273 | } |
---|
274 | |
---|
275 | inline TVector3 ETruth::GetTrueShowerMaxPos() const { |
---|
276 | return TVector3(fTrueShowerMaxPosX, fTrueShowerMaxPosY, fTrueShowerMaxPosZ); |
---|
277 | } |
---|
278 | |
---|
279 | inline void ETruth::SetTrueShowerMaxPos( const TVector3& v ){ |
---|
280 | fTrueShowerMaxPosX = v.X(); |
---|
281 | fTrueShowerMaxPosY = v.Y(); |
---|
282 | fTrueShowerMaxPosZ = v.Z(); |
---|
283 | } |
---|
284 | |
---|
285 | inline Float_t ETruth::GetTrueShowerMaxPos( Int_t i) const { |
---|
286 | // return TrueShowerMaxPos component by index |
---|
287 | |
---|
288 | switch(i) { |
---|
289 | case 0: |
---|
290 | return fTrueShowerMaxPosX; |
---|
291 | case 1: |
---|
292 | return fTrueShowerMaxPosY; |
---|
293 | case 2: |
---|
294 | return fTrueShowerMaxPosZ; |
---|
295 | default: |
---|
296 | Error("GetTrueShowerMaxPos(i)", "bad index (%d) returning 0",i); |
---|
297 | } |
---|
298 | return 0.; |
---|
299 | } |
---|
300 | |
---|
301 | inline void ETruth::SetTrueShowerMaxPos( Int_t i, Float_t x ) { |
---|
302 | // TrueShowerMaxPos component by index |
---|
303 | |
---|
304 | switch(i) { |
---|
305 | case 0: |
---|
306 | fTrueShowerMaxPosX = x; |
---|
307 | break; |
---|
308 | case 1: |
---|
309 | fTrueShowerMaxPosY = x; |
---|
310 | break; |
---|
311 | case 2: |
---|
312 | fTrueShowerMaxPosZ = x; |
---|
313 | break; |
---|
314 | default: |
---|
315 | Error("SetTrueShowerMaxPos(i)", "bad index (%d)",i); |
---|
316 | } |
---|
317 | } |
---|
318 | |
---|
319 | #endif /* __ETRUTH_HH__ */ |
---|
320 | |
---|