1 | // $Id: ESimpleDetector.hh 2773 2006-11-17 15:54:35Z moreggia $ |
---|
2 | // Author: Sylvain Moreggia 2006/03/21 |
---|
3 | |
---|
4 | /***************************************************************************** |
---|
5 | * ESAF: Euso Simulation and Analysis Framework * |
---|
6 | * * |
---|
7 | * Id: ESimpleDetector * |
---|
8 | * Package: <packagename> * |
---|
9 | * Coordinator: <coordinator> * |
---|
10 | * * |
---|
11 | *****************************************************************************/ |
---|
12 | |
---|
13 | #ifndef __ESIMPLEDETECTOR_HH__ |
---|
14 | #define __ESIMPLEDETECTOR_HH__ |
---|
15 | |
---|
16 | #include "EFillable.hh" |
---|
17 | #include "TROOT.h" |
---|
18 | #include "TObject.h" |
---|
19 | #include "TRef.h" |
---|
20 | #include "TClonesArray.h" |
---|
21 | #include "TString.h" |
---|
22 | #include "EDetector.hh" |
---|
23 | |
---|
24 | class ESimpDetPhoton; |
---|
25 | class EPhotoElectron; |
---|
26 | |
---|
27 | //////////////////////////////////////////////////////////////////////////////// |
---|
28 | // // |
---|
29 | // ESimpleDetector // |
---|
30 | // // |
---|
31 | // <brief class description> // |
---|
32 | // // |
---|
33 | //////////////////////////////////////////////////////////////////////////////// |
---|
34 | |
---|
35 | class ESimpleDetector : public TObject, public EFillable { |
---|
36 | public: |
---|
37 | |
---|
38 | // ctor |
---|
39 | ESimpleDetector(); |
---|
40 | // cpy ctor |
---|
41 | ESimpleDetector(const ESimpleDetector&); |
---|
42 | |
---|
43 | // dtor |
---|
44 | virtual ~ESimpleDetector(); |
---|
45 | |
---|
46 | |
---|
47 | virtual void Copy( TObject& ) const; |
---|
48 | virtual void Clear( Option_t* =""); |
---|
49 | virtual void ClearAndShrink( Option_t* ="" ); |
---|
50 | |
---|
51 | inline void SetPhotonFillingMode( Int_t mode = EDetector::kNoPhotons ) { fPhotonFillingMode = mode; } |
---|
52 | inline UInt_t GetPhotonFillingMode() { return fPhotonFillingMode; } |
---|
53 | |
---|
54 | // getters |
---|
55 | inline Bool_t EventIsTriggered() const {return fEventIsTriggered;} |
---|
56 | inline Float_t GetMeanBgnd() const {return fMeanBgnd;} |
---|
57 | inline Float_t GetTriggerLevel() const {return fTriggerLevel;} |
---|
58 | inline Float_t GetTriggPersistency() const {return fTriggPersistency;} |
---|
59 | inline UInt_t GetNbPixelOnSide() const {return fNbPixelOnSide;} |
---|
60 | inline Float_t GetPixelSideLength() const {return fPixelSideLength;} |
---|
61 | inline Float_t GetFirstPixelX() {return fFirstPixelX;} |
---|
62 | inline Float_t GetFirstPixelY() {return fFirstPixelY;} |
---|
63 | inline UInt_t GetPixelRowID(UInt_t pixelID) const {return pixelID / fNbPixelOnSide;} |
---|
64 | inline UInt_t GetPixelColumnID(UInt_t pixelID) const {return pixelID % fNbPixelOnSide;} |
---|
65 | inline Float_t GetFirstTime() const {return fFirstTime; } |
---|
66 | inline Float_t GetLastTime() const {return fLastTime; } |
---|
67 | inline Float_t GetFirstGtuTime() const {return fFirstGTUTime; } |
---|
68 | inline Float_t GetGTUlength() const {return fGTUlength;} |
---|
69 | inline UInt_t GetNbGTUs() const {return fNbGTUs;} |
---|
70 | inline Int_t GetNumPhotons() const {return fNumPhotons; } |
---|
71 | inline Int_t GetNumPhotoElectrons() const {return fNumPhotoElectrons; } |
---|
72 | |
---|
73 | |
---|
74 | inline ESimpDetPhoton* GetPhoton(Int_t index) const; |
---|
75 | inline EPhotoElectron* GetPhotoElectron(Int_t index) const; |
---|
76 | |
---|
77 | inline static ESimpleDetector* GetCurrent() { return fgCurrent; } |
---|
78 | inline static void SetCurrent(ESimpleDetector *ev) { fgCurrent=ev; } |
---|
79 | |
---|
80 | |
---|
81 | // setters |
---|
82 | inline void SetEventIsTriggered(Bool_t b) {fEventIsTriggered = b;} |
---|
83 | inline void SetMeanBgnd(Float_t b) {fMeanBgnd = b;} |
---|
84 | inline void SetTriggerLevel(Float_t b) {fTriggerLevel = b;} |
---|
85 | inline void SetTriggPersistency(UInt_t b) {fTriggPersistency = b;} |
---|
86 | inline void SetNbPixelOnSide(UInt_t b) {fNbPixelOnSide = b;} |
---|
87 | inline void SetPixelSideLength(Float_t b) {fPixelSideLength = b;} |
---|
88 | inline void SetFirstPixelXY(Float_t x,Float_t y) {fFirstPixelX = x;fFirstPixelY = y;} |
---|
89 | inline void SetFirstTime(Float_t b) {fFirstTime = b;} |
---|
90 | inline void SetLastTime(Float_t b) {fLastTime = b;} |
---|
91 | inline void SetFirstGTUTime(Float_t b) {fFirstGTUTime = b;} |
---|
92 | inline void SetNbGTUs(UInt_t b) {fNbGTUs = b;} |
---|
93 | inline void SetGTUlength(Float_t l) {fGTUlength = l;} |
---|
94 | |
---|
95 | |
---|
96 | private: |
---|
97 | |
---|
98 | Bool_t fEventIsTriggered; // true if triggered event |
---|
99 | UInt_t fPhotonFillingMode; // true to enable photon adders |
---|
100 | |
---|
101 | // input parameters for detector simu |
---|
102 | Float_t fMeanBgnd; // mean background (Nadir) in pe-/pixel/GTU |
---|
103 | Float_t fTriggerLevel; // nb of background sigma considered for SNR treatment |
---|
104 | UInt_t fTriggPersistency; // nb consecutive GTU with adjacent hitted pixels |
---|
105 | UInt_t fNbPixelOnSide; // nb of pixels on a side of the square FS |
---|
106 | Float_t fPixelSideLength; // pixel side length projected on the MES plane Z=0 |
---|
107 | Float_t fFirstPixelX; // pixel high left corner X-position projected on the MES plane Z=0 |
---|
108 | Float_t fFirstPixelY; // pixel high left corner Y-position projected on the MES plane Z=0 |
---|
109 | |
---|
110 | Int_t fNumPhotons; // number of ESimpDetPhoton in fPhotons array |
---|
111 | Int_t fNumPhotoElectrons; // number of EPhotoElectron in fPhotoElectrons array |
---|
112 | Float_t fFirstTime; // time of the first photon entering pupil |
---|
113 | Float_t fLastTime; // time of the last photon entering pupil |
---|
114 | Float_t fFirstGTUTime; // time of first GTU (raising time) |
---|
115 | UInt_t fNbGTUs; // nb of GTUs event lasts |
---|
116 | Float_t fGTUlength; // GTU length |
---|
117 | |
---|
118 | |
---|
119 | |
---|
120 | TClonesArray* fPhotons; // all photons entering the pupil with history in detector |
---|
121 | TClonesArray* fPhotoElectrons; // photo electrons |
---|
122 | |
---|
123 | static TClonesArray *fgPhotons; |
---|
124 | static TClonesArray *fgPhotoElectrons; |
---|
125 | |
---|
126 | static ESimpleDetector* fgCurrent; |
---|
127 | |
---|
128 | |
---|
129 | SetEVisitable() |
---|
130 | |
---|
131 | ClassDef(ESimpleDetector,2) |
---|
132 | }; |
---|
133 | |
---|
134 | //______________________________________________________________________________ |
---|
135 | inline ESimpDetPhoton* ESimpleDetector::GetPhoton(Int_t index) const { |
---|
136 | return (ESimpDetPhoton*)fPhotons->At(index); |
---|
137 | } |
---|
138 | |
---|
139 | //______________________________________________________________________________ |
---|
140 | inline EPhotoElectron* ESimpleDetector::GetPhotoElectron(Int_t index) const { |
---|
141 | return (EPhotoElectron*)fPhotoElectrons->At(index); |
---|
142 | } |
---|
143 | |
---|
144 | #endif /* __ESIMPLEDETECTOR_HH__ */ |
---|
145 | |
---|