1 | // ESAF : Euso Simulation and Analysis Framework |
---|
2 | // this class is a container for input event |
---|
3 | // it describes raw data both coming from ESAF Root file, ESAF Telemetry |
---|
4 | // or Real EUSO Data |
---|
5 | // $Id: RecoEvent.hh 2957 2011-06-29 06:43:35Z naumov $ |
---|
6 | // Marco Pallavicini created Oct, 16 2003 |
---|
7 | |
---|
8 | #ifndef __RECOEVENT_HH_ |
---|
9 | #define __RECOEVENT_HH_ |
---|
10 | |
---|
11 | #include <vector> |
---|
12 | #include <map> |
---|
13 | #include "euso.hh" |
---|
14 | #include <string> |
---|
15 | #include "EsafMsgSource.hh" |
---|
16 | #include <iostream> |
---|
17 | using namespace std; |
---|
18 | |
---|
19 | class RecoCellInfo; |
---|
20 | class RecoPixelData; |
---|
21 | class RecoAnalogData; |
---|
22 | class RecoPhotoElectronData; |
---|
23 | class RecoPhotonOnPupilData; |
---|
24 | class RecoShowerTrackData; |
---|
25 | class EEvent; |
---|
26 | class ERunParameters; |
---|
27 | class RecoGlobalData; |
---|
28 | |
---|
29 | #include "RecoEventHeader.hh" |
---|
30 | #include "RecoModuleData.hh" |
---|
31 | |
---|
32 | class RecoEvent:public EsafMsgSource { |
---|
33 | public: |
---|
34 | |
---|
35 | // ctor |
---|
36 | RecoEvent(); |
---|
37 | |
---|
38 | // dtor |
---|
39 | virtual ~RecoEvent(); |
---|
40 | |
---|
41 | // get header: general infos about event |
---|
42 | inline const RecoEventHeader &GetHeader() const { return fHeader; } |
---|
43 | |
---|
44 | // get a specified module data |
---|
45 | const RecoModuleData *GetModuleData( const string& ); |
---|
46 | |
---|
47 | // put a module data in the module data map |
---|
48 | void PutRecoModuleData( const string& name, const RecoModuleData* md ); |
---|
49 | |
---|
50 | // number of macrocells with data |
---|
51 | inline Int_t GetNumActiveMacroCells() const { return fCellData.size(); } |
---|
52 | |
---|
53 | // number of triggering macrocells |
---|
54 | Int_t GetNumTriggeringMacroCells() const { return 0; } |
---|
55 | |
---|
56 | // return info object of a given macrocell id |
---|
57 | RecoCellInfo *GetRecoCellInfo( Int_t cell_id ); |
---|
58 | |
---|
59 | // return data of a photoelectron |
---|
60 | RecoPhotoElectronData *GetRecoPhotoElectronData( Int_t ph_id ); |
---|
61 | |
---|
62 | // return data of a front end chip pixel |
---|
63 | RecoPixelData *GetRecoPixelData( Int_t px_id ); |
---|
64 | |
---|
65 | // return data of a front end chip pixels in a vector |
---|
66 | inline const vector<RecoPixelData*> &GetRecoPixels() {return fPixelData;} |
---|
67 | |
---|
68 | // insert an entry in photoelectron data |
---|
69 | inline void PutRecoPhotoElectronData( RecoPhotoElectronData *data) { fPhotoElectronData.push_back(data); } |
---|
70 | |
---|
71 | // insert an entry in macrocell data |
---|
72 | void PutRecoCellInfo( Int_t cell_id, RecoCellInfo *cell_info ); |
---|
73 | |
---|
74 | // insert an entry in front end chip pixel data |
---|
75 | inline void PutRecoPixelData( RecoPixelData *data ) { fPixelData.push_back(data); } |
---|
76 | |
---|
77 | // insert an entry in gtu map of front end chip pixel data |
---|
78 | inline void PutGtuRecoPixelData( Int_t gtu, RecoPixelData *data ) { fPixelsGTU[gtu].push_back(data); } |
---|
79 | // get gtu map |
---|
80 | map< Int_t, vector<RecoPixelData*> > &GetGtuRecoPixelData() {return fPixelsGTU;} |
---|
81 | |
---|
82 | // insert an entry in PDM vs gtu map of front end chip pixel data |
---|
83 | inline void PutCellGtuRecoPixelData( Int_t cellID, Int_t gtu, RecoPixelData *data ) {fCellGTU[cellID][gtu].push_back(data);} |
---|
84 | map< Int_t, map< Int_t, vector<RecoPixelData*> > > &GetCellGtuRecoPixelData() {return fCellGTU;} |
---|
85 | |
---|
86 | // insert an entry in analog data |
---|
87 | inline void PutRecoAnalogData( RecoAnalogData *data ) {fAnalogData.push_back(data); } |
---|
88 | |
---|
89 | // methods of sorting |
---|
90 | void SortPhGtu(); |
---|
91 | |
---|
92 | // find the main macrocell by pixel data |
---|
93 | Int_t GetMainMacroCell(Int_t hits_minimum); |
---|
94 | |
---|
95 | // give the number of photoelectrons in macrocell cell_id |
---|
96 | Int_t GetNumPh( Int_t cell_id ); |
---|
97 | |
---|
98 | // give the number of active pixels in macrocell cell_id |
---|
99 | Int_t GetNumPx( Int_t cell_id, Int_t hits_miminum ); |
---|
100 | |
---|
101 | // find min and max theta of pixel FOV in macrocell cell_id |
---|
102 | Float_t GetThetaMin( Int_t cell_id, Int_t hm ); |
---|
103 | Float_t GetThetaMax( Int_t cell_id, Int_t hm ); |
---|
104 | Float_t GetThetaRange( Int_t cell_id, Int_t hm ); |
---|
105 | |
---|
106 | // find min and max Y pos of photoelectrons in macrocell cell_id |
---|
107 | Float_t GetPhiMin( Int_t cell_id, Int_t hm ); |
---|
108 | Float_t GetPhiMax( Int_t cell_id, Int_t hm ); |
---|
109 | Float_t GetPhiRange( Int_t cell_id, Int_t hm ); |
---|
110 | |
---|
111 | // find first and last gtu of photoelectrons in macrocell cell_id |
---|
112 | Int_t GetFirstGtu( Int_t cell_id, Int_t hm ); |
---|
113 | Int_t GetLastGtu( Int_t cell_id, Int_t hm ); |
---|
114 | Int_t GetGtuRange( Int_t cell_id, Int_t hm ); |
---|
115 | |
---|
116 | //find first and last gtu of entire event |
---|
117 | Int_t GetStartGtu(); |
---|
118 | Int_t GetEndGtu(); |
---|
119 | |
---|
120 | // insert an entry in photons on pupil data |
---|
121 | inline void PutRecoPhotonOnPupilData( RecoPhotonOnPupilData *data) { fPhotonOnPupilData.push_back(data); } |
---|
122 | |
---|
123 | // return data of a photon on pupil |
---|
124 | RecoPhotonOnPupilData *GetRecoPhotonOnPupilData( Int_t ph_id ); |
---|
125 | |
---|
126 | // insert an entry in photons on pupil data |
---|
127 | inline void PutRecoShowerTrackData(RecoShowerTrackData *data) {fRecoShowerTrackData = data;} |
---|
128 | |
---|
129 | // return data of the shower track |
---|
130 | inline RecoShowerTrackData* GetRecoShowerTrackData() {return fRecoShowerTrackData;} |
---|
131 | |
---|
132 | // organize the recopixeldata |
---|
133 | void SortPixelData(); |
---|
134 | |
---|
135 | void SetSimuEvent(EEvent* ev) { fSimuEvent = ev; } |
---|
136 | void SetRunPars(ERunParameters* r) { fRunPars = r; } |
---|
137 | inline EEvent* GetSimuEvent() { return fSimuEvent; } |
---|
138 | inline ERunParameters* GetRunPars() { return fRunPars; } |
---|
139 | |
---|
140 | RecoGlobalData* FindGlobalData( const string& name ) const; |
---|
141 | RecoGlobalData* FindCreateGlobalData( const string& ); |
---|
142 | void CleanGlobalData(); |
---|
143 | |
---|
144 | private: |
---|
145 | RecoEventHeader fHeader; // Reco Header |
---|
146 | map<string,const RecoModuleData*> fModuleData; // map of reco module data |
---|
147 | map<string,RecoGlobalData*> fGlobalData; // map of event global data |
---|
148 | vector<RecoPhotoElectronData*> fPhotoElectronData; // photoelectrons data |
---|
149 | map<Int_t,RecoCellInfo*> fCellData; // macrocell data; one RecoCellInfo object per MacroCell |
---|
150 | vector<RecoPixelData*> fPixelData; // front end chip pixel data (no ghosts, digital info DFEE ) |
---|
151 | vector<RecoAnalogData*> fAnalogData; // analog data (AFEE) |
---|
152 | vector<RecoPhotonOnPupilData*> fPhotonOnPupilData; // photons on pupil data |
---|
153 | RecoShowerTrackData* fRecoShowerTrackData; // shower track data |
---|
154 | EEvent* fSimuEvent; // pointer to the original EEvent |
---|
155 | ERunParameters* fRunPars; // pointer to ERunParameters |
---|
156 | |
---|
157 | Bool_t fAreDataOrganized; // true if the data are organized |
---|
158 | Int_t fGtuMin; Int_t fGtuMax; |
---|
159 | Double_t fThetaMin; Double_t fThetaMax; |
---|
160 | Double_t fPhiMin; Double_t fPhiMax; |
---|
161 | map < Int_t, vector<RecoPixelData*> > fPixelsGTU; // map of pixels in GTU |
---|
162 | map <Int_t, map < Int_t, vector<RecoPixelData*> > > fCellGTU; // map <CellID, map <GTU, vector<RecoPixelData*> > > |
---|
163 | map< Int_t, vector<RecoPixelData*> > gtumap; |
---|
164 | friend class RootInputModule; |
---|
165 | ClassDef(RecoEvent,0) |
---|
166 | }; |
---|
167 | |
---|
168 | #endif /* __RECOEVENT_HH_ */ |
---|
169 | |
---|