1 | // ESAF : Euso Simulation and Analysis Framework |
---|
2 | // $Id: EShower.hh 2669 2006-04-12 11:43:13Z thea $ |
---|
3 | // created May, 23 2004 |
---|
4 | |
---|
5 | #ifndef __ESHOWER_HH_ |
---|
6 | #define __ESHOWER_HH_ |
---|
7 | |
---|
8 | #include "TObject.h" |
---|
9 | #include "TClonesArray.h" |
---|
10 | #include "TVector3.h" |
---|
11 | #include "EFillable.hh" |
---|
12 | |
---|
13 | class EShowerStep; |
---|
14 | |
---|
15 | // Shower infos |
---|
16 | // Shower development infos |
---|
17 | class EShower : public TObject, public EFillable { |
---|
18 | public: |
---|
19 | EShower(); |
---|
20 | EShower(const EShower&); |
---|
21 | |
---|
22 | virtual ~EShower(); |
---|
23 | |
---|
24 | virtual void Copy( TObject& ) const; |
---|
25 | virtual void Clear( Option_t* = "" ); |
---|
26 | virtual void ClearAndShrink( Option_t* ="" ); |
---|
27 | |
---|
28 | // getters |
---|
29 | inline Int_t GetNumSteps() {return fNumSteps;} |
---|
30 | TClonesArray* GetSteps() { return fSteps; }; |
---|
31 | inline EShowerStep* GetStep( Int_t ); |
---|
32 | inline Float_t GetEnergy() const { return fEnergy;} |
---|
33 | inline Float_t GetTheta() const { return fTheta;} |
---|
34 | inline Float_t GetPhi() const { return fPhi;} |
---|
35 | inline Float_t GetX1() const { return fX1;} |
---|
36 | inline Float_t GetElectrEthres() const { return fElectrEthres; } |
---|
37 | inline Float_t GetDir( Int_t i) const; |
---|
38 | inline TVector3 GetDir() const; |
---|
39 | inline Float_t GetInitPos( Int_t i) const; |
---|
40 | inline TVector3 GetInitPos() const; |
---|
41 | inline Bool_t GetHitGround() const { return fHitGround; } |
---|
42 | |
---|
43 | // setters |
---|
44 | inline void SetEnergy( Float_t t ) {fEnergy = t;} |
---|
45 | inline void SetTheta( Float_t t ) {fTheta = t;} |
---|
46 | inline void SetPhi( Float_t t ) {fPhi = t;} |
---|
47 | inline void SetX1( Float_t t ) {fX1 = t;} |
---|
48 | inline void SetElectrEthres( Float_t t ) { fElectrEthres = t; } |
---|
49 | inline void SetDir( Int_t, Float_t ); |
---|
50 | inline void SetDir( const TVector3& ); |
---|
51 | inline void SetInitPos( const TVector3& ); |
---|
52 | inline void SetInitPos( Int_t, Float_t ); |
---|
53 | inline void SetHitGround( Bool_t h ) { fHitGround = h; } |
---|
54 | |
---|
55 | static inline EShower* GetCurrent() { return fgCurrent; } |
---|
56 | static inline void SetCurrent( EShower* sh ) { fgCurrent = sh; } |
---|
57 | |
---|
58 | |
---|
59 | private: |
---|
60 | Float_t fEnergy; // UHECR energy |
---|
61 | Float_t fTheta; // UHECR Theta |
---|
62 | Float_t fPhi; // UHECR Phi |
---|
63 | Float_t fX1; // UHECR first interaction depth |
---|
64 | Float_t fElectrEthres; // Energy Threshold of electrons in GeV |
---|
65 | Float_t fDirX; // Direction versor in MES of the track axis |
---|
66 | Float_t fDirY; // Direction versor in MES of the track axis |
---|
67 | Float_t fDirZ; // Direction versor in MES of the track axis |
---|
68 | Float_t fInitPosX; // first interaction point (3D coord, meters) in MES |
---|
69 | Float_t fInitPosY; // first interaction point (3D coord, meters) in MES |
---|
70 | Float_t fInitPosZ; // first interaction point (3D coord, meters) in MES |
---|
71 | Bool_t fHitGround; // kTRUE is the track can hit the Ground in EUSO FoV, kFALSE otherwise |
---|
72 | |
---|
73 | |
---|
74 | Int_t fNumSteps; // size of fSteps array |
---|
75 | TClonesArray *fSteps; // |
---|
76 | |
---|
77 | Bool_t fCopy; // not necessary any more, kept for compatbility |
---|
78 | |
---|
79 | static EShower* fgCurrent; |
---|
80 | |
---|
81 | SetEVisitable() |
---|
82 | |
---|
83 | ClassDef(EShower,1) |
---|
84 | }; |
---|
85 | |
---|
86 | inline EShowerStep* EShower::GetStep( Int_t i ) { |
---|
87 | return (EShowerStep*)fSteps->At(i); |
---|
88 | } |
---|
89 | |
---|
90 | inline TVector3 EShower::GetDir() const { |
---|
91 | // return Dir |
---|
92 | return TVector3( fDirX, fDirY, fDirZ ); |
---|
93 | } |
---|
94 | |
---|
95 | inline TVector3 EShower::GetInitPos() const { |
---|
96 | // return InitPos |
---|
97 | return TVector3( fInitPosX, fInitPosY, fInitPosZ ); |
---|
98 | } |
---|
99 | |
---|
100 | inline Float_t EShower::GetDir( Int_t i) const { |
---|
101 | // return Dir component by index |
---|
102 | |
---|
103 | switch(i) { |
---|
104 | case 0: |
---|
105 | return fDirX; |
---|
106 | case 1: |
---|
107 | return fDirY; |
---|
108 | case 2: |
---|
109 | return fDirZ; |
---|
110 | default: |
---|
111 | Error("GetDir(i)", "bad index (%d) returning 0",i); |
---|
112 | } |
---|
113 | return 0.; |
---|
114 | } |
---|
115 | |
---|
116 | inline Float_t EShower::GetInitPos( Int_t i) const { |
---|
117 | // return InitPos component by index |
---|
118 | |
---|
119 | switch(i) { |
---|
120 | case 0: |
---|
121 | return fInitPosX; |
---|
122 | case 1: |
---|
123 | return fInitPosY; |
---|
124 | case 2: |
---|
125 | return fInitPosZ; |
---|
126 | default: |
---|
127 | Error("GetInitPos(i)", "bad index (%d) returning 0",i); |
---|
128 | } |
---|
129 | return 0.; |
---|
130 | } |
---|
131 | |
---|
132 | inline void EShower::SetDir( const TVector3& v ) { |
---|
133 | fDirX = v.X(); |
---|
134 | fDirY = v.Y(); |
---|
135 | fDirZ = v.Z(); |
---|
136 | } |
---|
137 | |
---|
138 | inline void EShower::SetInitPos( const TVector3& v ) { |
---|
139 | fInitPosX = v.X(); |
---|
140 | fInitPosY = v.Y(); |
---|
141 | fInitPosZ = v.Z(); |
---|
142 | } |
---|
143 | |
---|
144 | inline void EShower::SetDir( Int_t i, Float_t x ) { |
---|
145 | // Dir component by index |
---|
146 | |
---|
147 | switch(i) { |
---|
148 | case 0: |
---|
149 | fDirX = x; |
---|
150 | case 1: |
---|
151 | fDirY = x; |
---|
152 | case 2: |
---|
153 | fDirZ = x; |
---|
154 | default: |
---|
155 | Error("SetDir(i)", "bad index (%d)",i); |
---|
156 | } |
---|
157 | } |
---|
158 | |
---|
159 | inline void EShower::SetInitPos( Int_t i, Float_t x ) { |
---|
160 | // InitPos component by index |
---|
161 | |
---|
162 | switch(i) { |
---|
163 | case 0: |
---|
164 | fInitPosX = x; |
---|
165 | case 1: |
---|
166 | fInitPosY = x; |
---|
167 | case 2: |
---|
168 | fInitPosZ = x; |
---|
169 | default: |
---|
170 | Error("SetInitPos(i)", "bad index (%d)",i); |
---|
171 | } |
---|
172 | } |
---|
173 | |
---|
174 | #endif /* __ESHOWER_HH_ */ |
---|
175 | |
---|