source: JEM-EUSO/esaf_cc_at_lal/packages/common/root/include/EDetPhoton.hh @ 114

Last change on this file since 114 was 114, checked in by moretto, 11 years ago

actual version of ESAF at CCin2p3

File size: 6.9 KB
Line 
1// ESAF : Euso Simulation and Analysis Framework
2// $Id: EDetPhoton.hh 3007 2012-01-11 10:06:56Z fenu $
3//  created May, 18 2004
4
5#ifndef __EDETPHOTON_HH__
6#define __EDETPHOTON_HH__
7
8#include "EPhoton.hh"
9#include "TVector3.h"
10
11#include "EFillable.hh"
12
13
14class EDetPhoton : public EPhoton {
15public:
16    EDetPhoton();
17    EDetPhoton(const EPhoton&);
18    EDetPhoton(const EDetPhoton&);
19   
20    virtual ~EDetPhoton();
21   
22    virtual void Copy( TObject& ) const;
23    virtual void Clear( Option_t* = "");
24
25    // getters
26    inline UShort_t GetStatusBits() const { return fStatusBits; }
27    inline Float_t  GetShowerPos( Int_t ) const;           
28    inline Float_t  GetShowerAge() const { return fAge; }
29    inline UChar_t  GetHistory() { return fHistory; }
30    inline Int_t    GetFate() const { return fFate;}
31    inline Float_t  GetIdealFocalPos( Int_t ) const;
32    inline Int_t    GetFe() const { return fFe;}
33    inline Int_t    GetMacroCell() const { return fMacroCell;}
34    inline Int_t    GetGtu() const { return fGtu;}
35    inline Int_t    GetXCell() const { return fXCell; }
36    inline Int_t    GetYCell() const { return fYCell; }
37    inline Int_t    GetPixelUID() const { return fPixelUID;}
38    inline Int_t    GetSignalId() const { return fSignalId;}
39    inline Float_t  GetCharge() const { return fCharge;}
40    inline Float_t  GetIPeak() const { return fIPeak;}
41    inline Float_t  GetSignalTime() const { return fSignalTime;}
42
43    // setters
44    inline void SetShowerPos( Int_t,  Float_t );                   
45    inline void SetShowerPos( const TVector3& );
46    inline void SetHistory( UChar_t h ) { fHistory = h; }
47    inline void SetFate( Int_t f ) { fFate = f;}
48    inline void SetShowerAge( Int_t f ) { fAge = f;}
49    inline void SetIdealFocalPos( Int_t, Float_t );
50    inline void SetIdealFocalPos( const TVector3& );
51    inline void SetFe( Int_t fe ) { fFe = fe;}
52    inline void SetMacroCell( Int_t mc ) { fMacroCell = mc; }
53    inline void SetXCell( Int_t x ) { fXCell = x; }
54    inline void SetYCell( Int_t y ) { fYCell = y; }
55    inline void SetGtu( Int_t gtu ) { fGtu = gtu; }
56    inline void SetPixelUID( Int_t uid ) { fPixelUID = uid; }
57    inline void SetSignalId( Int_t id ) { fSignalId = id; }
58    inline void SetCharge( Float_t c ) { fCharge = c;}
59    inline void SetIPeak( Float_t ip ) { fIPeak = ip; }
60    inline void SetSignalTime( Float_t t ) { fSignalTime = t;}
61
62    inline Bool_t  CrossedIFS() const { return (fStatusBits & kCrossedIFS) != 0; }
63    inline Bool_t  MadeSignal() const { return (fStatusBits & kMadeSignal) != 0; }
64    inline Bool_t  MadeCount() const { return (fStatusBits & kMadeCount) != 0; }
65    inline Bool_t  MadeFastOR() const { return (fStatusBits & kMadeFastOR) != 0; }
66
67    // photon status
68    inline void SetCrossedIFS() { fStatusBits |= kCrossedIFS; }
69    inline void SetMadeSignal() { fStatusBits |= kMadeSignal; }
70    inline void SetMadeCount() { fStatusBits |= kMadeCount; }
71    inline void SetMadeFastOR() { fStatusBits |= kMadeFastOR; }
72    inline void ClearCrossedIFS() { fStatusBits &= ~kCrossedIFS; }
73    inline void ClearMadeSignal() { fStatusBits &= ~kMadeSignal; }
74    inline void ClearMadeCount() { fStatusBits &= ~kMadeCount; }
75    inline void ClearMadeFastOR() { fStatusBits &= ~kMadeFastOR; }
76
77    enum EStatus { 
78        kCrossedIFS               = BIT(0),
79        kMadeSignal               = BIT(1),
80        kMadeCount                = BIT(2),
81        kMadeFastOR               = BIT(3)
82    };
83
84    inline TVector3 GetShowerPos() const;
85    // position in the Shower
86
87    inline TVector3 GetIdealFocalPos() const;
88    // coord on ideal FS
89   
90     
91private:
92
93       
94    UShort_t  fStatusBits;     // bits holding photon's status
95    Float_t fShowerPosX;       // x position in the Shower
96    Float_t fShowerPosY;       // y position in the Shower
97    Float_t fShowerPosZ;       // z position in the Shower
98    Float_t fAge;
99    // photon's destiny
100    Int_t fHistory;            // code of last position of the photon
101    Int_t fFate;               // return flag of the module in which photon ends
102    Float_t fIdealFocalPosX;   // x coord. on the ideal focal surface
103    Float_t fIdealFocalPosY;   // y coord. on the ideal focal surface
104    Float_t fIdealFocalPosZ;   // z coord. on the ideal focal surface
105
106    // photon's electronic image
107    Int_t fFe;                 // fe chip
108    Int_t fMacroCell;          // macrocell number hit
109
110    Int_t fXCell;              // X coordinate in macrocell
111    Int_t fYCell;              // Y coordinate in macrocell
112   
113    Int_t fGtu;                // gtu number this photon belongs to
114    Int_t fPixelUID;           // unique pixel id
115    Int_t fSignalId;           // identifier of the PmtSignal object
116    Float_t fCharge;           // pmt charge
117    Float_t fIPeak;            // peak current at input
118    Float_t fSignalTime;       // pmt signal time
119
120    SetEVisitable()
121
122    ClassDef(EDetPhoton,1)
123
124};
125
126inline TVector3 EDetPhoton::GetShowerPos() const {
127    // return ShowerPos
128    return TVector3( fShowerPosX, fShowerPosY, fShowerPosZ );
129}
130
131inline TVector3 EDetPhoton::GetIdealFocalPos() const {
132    // return IdealFocalPos
133    return TVector3( fIdealFocalPosX, fIdealFocalPosY, fIdealFocalPosZ );
134}
135
136inline void EDetPhoton::SetShowerPos( const TVector3& v ) {
137    fShowerPosX = v.X();
138    fShowerPosY = v.Y();
139    fShowerPosZ = v.Z();
140}
141
142inline void EDetPhoton::SetIdealFocalPos( const TVector3& v ) {
143    fIdealFocalPosX = v.X();
144    fIdealFocalPosY = v.Y();
145    fIdealFocalPosZ = v.Z();
146}
147
148inline Float_t EDetPhoton::GetShowerPos( Int_t i) const {
149    // return ShowerPos component by index
150
151    switch(i) {
152        case 0:
153            return fShowerPosX;
154        case 1:
155            return fShowerPosY;
156        case 2:
157            return fShowerPosZ;
158        default:
159            Error("GetShowerPos(i)", "bad index (%d) returning 0",i);
160    }
161    return 0.;
162}
163
164inline Float_t EDetPhoton::GetIdealFocalPos( Int_t i) const {
165    // return IdealFocalPos component by index
166
167    switch(i) {
168        case 0:
169            return fIdealFocalPosX;
170        case 1:
171            return fIdealFocalPosY;
172        case 2:
173            return fIdealFocalPosZ;
174        default:
175            Error("GetIdealFocalPos(i)", "bad index (%d) returning 0",i);
176    }
177    return 0.;
178}
179
180inline void EDetPhoton::SetShowerPos( Int_t i, Float_t x ) {
181    // ShowerPos component by index
182
183    switch(i) {
184        case 0:
185            fShowerPosX = x;
186        case 1:
187            fShowerPosY = x;
188        case 2:
189            fShowerPosZ = x;
190        default:
191            Error("SetShowerPos(i)", "bad index (%d)",i);
192    }
193}
194
195inline void EDetPhoton::SetIdealFocalPos( Int_t i, Float_t x ) {
196    // IdealFocalPos component by index
197
198    switch(i) {
199        case 0:
200            fIdealFocalPosX = x;
201        case 1:
202            fIdealFocalPosY = x;
203        case 2:
204            fIdealFocalPosZ = x;
205        default:
206            Error("SetIdealFocalPos(i)", "bad index (%d)",i);
207    }
208}
209
210#endif  /* __EDETPHOTON_HH__ */
211
Note: See TracBrowser for help on using the repository browser.