CGEM BOSS 6.6.5.g
BESIII Offline Software System
Loading...
Searching...
No Matches
BesEvent.h
Go to the documentation of this file.
1//
2// BesEvent.h
3//
4
5#ifndef BES_EVENT
6#define BES_EVENT
7
8#include <ctime> //Long Peixun's update: time.h -> ctime
9#include <TObject.h>
10#include <TString.h>
11#include <TDatabasePDG.h>
12
13#include "BesEventHeader.h"
14#include "BesGeoTrack.h"
15#include "BesMcTrack.h"
16
24#include "RootEventData/TRecCgemCluster.h" //Long Peixun's update: for CGEM clusters
26
27class BesEvent : public TObject {
28
29private:
30 Double_t f_Magnetic;
31 BesEventHeader fEventHeader; // Event header
32 TDigiEvent *fDigiEvent;
33 TEvtHeader *fEvtHeader;
34 TTrigEvent *fTrigEvent;
35 TRecEvTime *fRecEvTime;
36 TMcEvent *fMcEvent;
37
38 TObjArray *fCgemClusterCol; //Long Peixun's update: for CGEM clusters
39 TObjArray *fCgemClusterUFCol[3]; //Long Peixun's update: for CGEM clusters in UF view
40 TObjArray *fMdcTrackCol;
41 TObjArray *fIdealTrackCol; // by Wang Liangliang for ideal tracks
42 TObjArray *fTofTrackCol;
43 TObjArray *fEmcTrackCol;
44 TObjArray *fMucTrackCol;
45 TObjArray *fExtTrackCol;
46 TObjArray *fMcParticleCol;
47
48 bool Is_tofBarrel(UInt_t status);
49 bool Is_tofCounter(UInt_t status);
50public:
52 virtual ~BesEvent();
53
54 virtual void Clear(Option_t *option = "");
55 virtual void Delete(Option_t *option = "");
56 virtual void Print(Option_t *option = "");
57
58 //virtual void SetEvent(TDigiEvent *digiEvent, TDisTrack *recEvent, TEvtHeader *evtHeader, TTrigEvent *trigEvent);
59 //virtual void SetEvent(TDigiEvent *digiEvent, TDisTrack *recEvent, TEvtHeader *evtHeader, TRecEvTime *recEvTime);//, TTrigEvent *trigEvent);
60 virtual void SetEvent(TDigiEvent *digiEvent, TDisTrack *recEvent, TEvtHeader *evtHeader, TRecEvTime *recEvTime, Bool_t isRec, TMcEvent *mcEvt = 0);//, TTrigEvent *trigEvent);
61 virtual void SetHits();
62 virtual void ClearHits(); //Long Peixun's update: Clear all hits in detector
63
64 virtual void SetCgemClusters(const TRecCgemCluster* recCluster, int ncluster); //Long Peixun's update: for CGEM clusters
65 virtual void SetTracks(TDisTrack *recEvent);
66 virtual void SetMdcTracks(TDisTrack *recEvent);
67 virtual void SetTofTracks(TDisTrack *recEvent);
68 virtual void SetEmcShowers(TDisTrack *recEvent);
69 virtual void SetMucTracks(TDisTrack *recEvent);
70 virtual void SetExtTracks(TDisTrack *recEvent);
71 virtual void SetMcEvent(TMcEvent *mcEvt);
72 virtual void ConstructMdcTrackFromRec(BesGeoTrack *mdcTrack, const TRecMdcTrack *recTrack,TDisTrack *recEvent);
73 virtual void ConstructMucTrackFromRec(BesGeoTrack *mucTrack, const TRecMucTrack *recTrack);
74 virtual void ConstructEmcTrackFromRec(BesGeoTrack *emcTrack, const TRecEmcShower *recTrack);
75 //virtual void ConstructTofTrackFromRec(BesGeoTrack *tofTrack, const TRecBTofTrack *recBTrack);
76 //virtual void ConstructTofTrackFromRec(BesGeoTrack *tofTrack, const TRecETofTrack *recETrack);
77 virtual void ConstructTofTrackFromRec(BesGeoTrack *tofTrack, const TRecTofTrack *recTrack,TDisTrack *recEvent);
78 virtual void ConstructMcTrack(BesMcTrack *mcTrack, const TMcParticle *mcPart);
79 //virtual void ConstructExtTrackFromRec(BesGeoTrack *extTrack, const TExtTrack *recTrack);
80 virtual void DrawHits(Option_t *option);
81 virtual void DrawTracks(Option_t *option);
82 virtual void DrawMcParticles(Option_t *option);
83 void SetMagnetic(Double_t input) {f_Magnetic = input;}
84
85 virtual void DrawCgem3DHits(Option_t* option); //Long Peixun's update: hits in CGEM 3D display
86 virtual void DrawCgemUFHits(Option_t* option); //Long Peixun's update: hits in CGEM unfolded display
87 virtual void DrawCgemClusters(Option_t* option); //Long Peixun's update: clusters in CGEM display
88 virtual void DrawCgemUFClusters(int layer, Option_t* option); //Long Peixun's update: clusters in CGEM unfolded display
89
90
91 //Long Peixun's update: for CGEM hits array
92 const TObjArray* GetCgemDigiCol() const
93 {
94 if (fDigiEvent) return fDigiEvent->getCgemDigiCol();
95 else return 0;
96 }
97 const Int_t GetCgemDigiNum() const {
98 if (fDigiEvent) return fDigiEvent->getCgemDigiCol()->GetEntries();
99 else return -1;
100 }
101 const TCgemDigi* GetCgemDigi(Int_t i) const {
102 if (fDigiEvent) return fDigiEvent->getCgemDigi(i);
103 else return 0;
104 }
105
106 const TObjArray* GetMdcDigiCol() const {
107 if (fDigiEvent) return fDigiEvent->getMdcDigiCol();
108 else return 0;
109 }
110 const TObjArray* GetTofDigiCol() const {
111 if (fDigiEvent) return fDigiEvent->getTofDigiCol();
112 else return 0;
113 }
114 const TObjArray* GetEmcDigiCol() const {
115 if (fDigiEvent) return fDigiEvent->getEmcDigiCol();
116 else return 0;
117 }
118 const TObjArray* GetMucDigiCol() const {
119 if (fDigiEvent) return fDigiEvent->getMucDigiCol();
120 else return 0;
121 }
122 const Int_t GetMdcDigiNum() const {
123 if (fDigiEvent) return fDigiEvent->getMdcDigiCol()->GetEntries();
124 else return -1;
125 }
126 const Int_t GetTofDigiNum() const {
127 if (fDigiEvent) return fDigiEvent->getTofDigiCol()->GetEntries();
128 else return -1;
129 }
130 const Int_t GetEmcDigiNum() const {
131 if (fDigiEvent) return fDigiEvent->getEmcDigiCol()->GetEntries();
132 else return -1;
133 }
134 const Int_t GetMucDigiNum() const {
135 if (fDigiEvent) return fDigiEvent->getMucDigiCol()->GetEntries();
136 else return -1;
137 }
138 const TMdcDigi* GetMdcDigi(Int_t i) const {
139 if (fDigiEvent) return fDigiEvent->getMdcDigi(i);
140 else return 0;
141 } //Long Peixun's update: Remove semicolon
142 const TTofDigi* GetTofDigi(Int_t i) const {
143 if (fDigiEvent) return fDigiEvent->getTofDigi(i);
144 else return 0;
145 }
146 const TEmcDigi* GetEmcDigi(Int_t i) const {
147 if (fDigiEvent) return fDigiEvent->getEmcDigi(i);
148 else return 0;
149 }
150 const TMucDigi* GetMucDigi(Int_t i) const {
151 if (fDigiEvent) return fDigiEvent->getMucDigi(i);
152 else return 0;
153 }
154
155 //Long Peixun TODO: Add CGEM tracks code
156
157 const TObjArray* GetMdcTrackCol(TDisTrack *recEvent) const {
158 if (recEvent)
159 return recEvent->getRecMdcTrackCol();
160 else return 0;
161 }
162 //const TObjArray* GetBTofTrackCol() const {
163 // if (fRecEvent)
164 // return fRecEvent->getTofTrackCol();
165 // else return 0;
166 //}
167 const TObjArray* GetTofTrackCol(TDisTrack *recEvent) const {
168 if (recEvent)
169 return recEvent->getTofTrackCol();
170 else
171 return 0;
172 }
173 const TObjArray* GetEmcShowerCol(TDisTrack *recEvent) const {
174 // if (recEvent)
175 // return recEvent->getEmcShowerCol();
176 // else
177 return 0;
178 }
179 const TObjArray* GetMucTrackCol(TDisTrack *recEvent) const {
180 if (recEvent)
181 return recEvent->getMucTrackCol();
182 else
183 return 0;
184 }
185 const TObjArray* GetExtTrackCol() const {
186 return 0; // for test
187 //if (fRecEvent)
188 // return fRecEvent->getExtTrackCol();
189 //else return 0;
190 }
191 const TObjArray* GetDedxCol(TDisTrack *recEvent) const {
192 // if (recEvent)
193 // return recEvent->getRecMdcDedxCol();
194 // else
195 return 0;
196 }
197 const Int_t GetMdcTrackNum(TDisTrack *recEvent) const {
198 if (recEvent)
199// return recEvent->getRecMdcTrackCol()->GetEntries();
200 return recEvent->getMdcTrackNum();
201 else
202 return -1;
203 }
204 //const Int_t GetBTofTrackNum() const {
205 // if (fRecEvent)
206 // return fRecEvent->getTofTrackCol()->GetEntries();
207 // else return -1;
208 //};
209 const Int_t GetTofTrackNum(TDisTrack *recEvent) const {
210 if (recEvent)
211 // return recEvent->getTofTrackCol()->GetEntries();
212 return recEvent->getTofTrackNum();
213 else
214 return -1;
215 }
216 const Int_t GetEmcShowerNum(TDisTrack *recEvent) const {
217 if (recEvent)
218 // return recEvent->getEmcShowerCol()->GetEntries();
219 return recEvent->getEmcShowerNum();
220 else
221 return -1;
222 }
223 const Int_t GetMucTrackNum(TDisTrack *recEvent) const {
224 if (recEvent)
225 return recEvent->getMucTrackNum();
226 // return recEvent->getMucTrackCol()->GetEntries();
227 else
228 return -1;
229 }
230 const Int_t GetExtTrackNum() const {
231 return -1;// for test
232 //if (fRecEvent)
233 // return fRecEvent->getExtTrackCol()->GetEntries();
234 //else return -1;
235 }
236 const Int_t GetDedxNum(TDisTrack *recEvent) const {
237 // if (fRecEvent)
238 // return fRecEvent->getRecMdcDedxCol()->GetEntries();
239 // else
240 return -1;
241 }
242 const TRecMdcTrack* GetMdcTrack(Int_t i,TDisTrack *recEvent) const {
243 if (recEvent)
244 return recEvent->getRecMdcTrack(i);
245 else return 0;
246 }
247 //const TRecBTofTrack* GetBTofTrack(Int_t i) const {
248 // if (fRecEvent)
249 // return fRecEvent->getBTofTrack(i);
250 // else return 0;
251 //};
252 const TRecTofTrack* GetTofTrack(Int_t i,TDisTrack *recEvent) const {
253 if (recEvent)
254 return recEvent->getTofTrack(i);
255 else
256 return 0;
257 }
258 const TRecEmcShower* GetEmcShower(Int_t i,TDisTrack *recEvent) const {
259 if (recEvent)
260 return recEvent->getEmcShower(i);
261 else
262 return 0;
263 }
264 const TRecMucTrack* GetMucTrack(Int_t i,TDisTrack *recEvent) const {
265 if (recEvent)
266 return recEvent->getMucTrack(i);
267 else
268 return 0;
269 }
270 //const TExtTrack* GetExtTrack(Int_t i) const {
271 // if (fRecEvent)
272 // return fRecEvent->getExtTrack(i);
273 // else return 0;
274 //};
275 const TRecMdcDedx* GetDedx(Int_t i) const {
276 // if (fRecEvent)
277 // return fRecEvent->getRecMdcDedx(i);
278 // else
279 return 0;
280 }
281
282 // header access functions
283 inline Long64_t GetRun() {
284 return fEventHeader.GetRunNumber();
285 }
286 inline Long64_t GetEvent() {
287 return fEventHeader.GetEventNumber();
288 }
289 inline Int_t GetYear() {
290 return fEventHeader.GetEventYear();
291 }
292 inline Int_t GetMonth() {
293 return fEventHeader.GetEventMonth();
294 }
295 inline Int_t GetDay() {
296 return fEventHeader.GetEventDay();
297 }
298 inline Int_t GetHour() {
299 return fEventHeader.GetEventHour();
300 }
301 inline Int_t GetMin() {
302 return fEventHeader.GetEventMin();
303 }
304 inline Int_t GetSec() {
305 return fEventHeader.GetEventSec();
306 }
307 inline Int_t GetMC() {
308 return fEventHeader.GetEventMC();
309 }
311 return fEventHeader;
312 }
313
314 TDatabasePDG* pdgTable;
315 ClassDef(BesEvent,0) // BesVis Event
316};
317
318R__EXTERN BesEvent *gEvent;
319
320#endif
321
R__EXTERN BesEvent * gEvent
Definition: BesEvent.h:318
Int_t GetEventYear()
Int_t GetEventMonth()
Int_t GetEventMin()
Long64_t GetRunNumber()
Bool_t GetEventMC()
Int_t GetEventDay()
Int_t GetEventSec()
Long64_t GetEventNumber()
Int_t GetEventHour()
const TObjArray * GetMucTrackCol(TDisTrack *recEvent) const
Definition: BesEvent.h:179
const Int_t GetMucTrackNum(TDisTrack *recEvent) const
Definition: BesEvent.h:223
const TObjArray * GetTofTrackCol(TDisTrack *recEvent) const
Definition: BesEvent.h:167
virtual void Delete(Option_t *option="")
Definition: BesEvent.cxx:69
virtual void SetHits()
Definition: BesEvent.cxx:288
virtual void DrawCgem3DHits(Option_t *option)
Definition: BesEvent.cxx:1540
const TRecTofTrack * GetTofTrack(Int_t i, TDisTrack *recEvent) const
Definition: BesEvent.h:252
virtual ~BesEvent()
Definition: BesEvent.cxx:59
Int_t GetSec()
Definition: BesEvent.h:304
const Int_t GetMucDigiNum() const
Definition: BesEvent.h:134
virtual void Clear(Option_t *option="")
Definition: BesEvent.cxx:147
Int_t GetMin()
Definition: BesEvent.h:301
const TObjArray * GetEmcShowerCol(TDisTrack *recEvent) const
Definition: BesEvent.h:173
const Int_t GetTofDigiNum() const
Definition: BesEvent.h:126
virtual void ClearHits()
Definition: BesEvent.cxx:302
virtual void ConstructTofTrackFromRec(BesGeoTrack *tofTrack, const TRecTofTrack *recTrack, TDisTrack *recEvent)
Definition: BesEvent.cxx:1062
virtual void DrawCgemUFHits(Option_t *option)
Definition: BesEvent.cxx:1547
virtual void SetTofTracks(TDisTrack *recEvent)
Definition: BesEvent.cxx:475
const TTofDigi * GetTofDigi(Int_t i) const
Definition: BesEvent.h:142
const TObjArray * GetMdcTrackCol(TDisTrack *recEvent) const
Definition: BesEvent.h:157
const TObjArray * GetMucDigiCol() const
Definition: BesEvent.h:118
const TRecMdcTrack * GetMdcTrack(Int_t i, TDisTrack *recEvent) const
Definition: BesEvent.h:242
const Int_t GetMdcTrackNum(TDisTrack *recEvent) const
Definition: BesEvent.h:197
Int_t GetMonth()
Definition: BesEvent.h:292
Int_t GetMC()
Definition: BesEvent.h:307
const TCgemDigi * GetCgemDigi(Int_t i) const
Definition: BesEvent.h:101
virtual void SetMcEvent(TMcEvent *mcEvt)
Definition: BesEvent.cxx:556
Int_t GetDay()
Definition: BesEvent.h:295
void SetMagnetic(Double_t input)
Definition: BesEvent.h:83
TDatabasePDG * pdgTable
Definition: BesEvent.h:314
Int_t GetHour()
Definition: BesEvent.h:298
virtual void SetCgemClusters(const TRecCgemCluster *recCluster, int ncluster)
Definition: BesEvent.cxx:329
virtual void ConstructEmcTrackFromRec(BesGeoTrack *emcTrack, const TRecEmcShower *recTrack)
Definition: BesEvent.cxx:1216
const Int_t GetTofTrackNum(TDisTrack *recEvent) const
Definition: BesEvent.h:209
virtual void Print(Option_t *option="")
Definition: BesEvent.cxx:1605
const TRecMdcDedx * GetDedx(Int_t i) const
Definition: BesEvent.h:275
const Int_t GetMdcDigiNum() const
Definition: BesEvent.h:122
virtual void SetMucTracks(TDisTrack *recEvent)
Definition: BesEvent.cxx:520
const Int_t GetCgemDigiNum() const
Definition: BesEvent.h:97
virtual void ConstructMcTrack(BesMcTrack *mcTrack, const TMcParticle *mcPart)
Definition: BesEvent.cxx:587
virtual void DrawCgemUFClusters(int layer, Option_t *option)
Definition: BesEvent.cxx:1569
Int_t GetYear()
Definition: BesEvent.h:289
const Int_t GetExtTrackNum() const
Definition: BesEvent.h:230
virtual void DrawCgemClusters(Option_t *option)
Definition: BesEvent.cxx:1554
virtual void SetMdcTracks(TDisTrack *recEvent)
Definition: BesEvent.cxx:439
virtual void SetEmcShowers(TDisTrack *recEvent)
Definition: BesEvent.cxx:498
const Int_t GetEmcShowerNum(TDisTrack *recEvent) const
Definition: BesEvent.h:216
const TMucDigi * GetMucDigi(Int_t i) const
Definition: BesEvent.h:150
BesEventHeader GetHeader()
Definition: BesEvent.h:310
const TObjArray * GetMdcDigiCol() const
Definition: BesEvent.h:106
const TRecEmcShower * GetEmcShower(Int_t i, TDisTrack *recEvent) const
Definition: BesEvent.h:258
const Int_t GetEmcDigiNum() const
Definition: BesEvent.h:130
virtual void ConstructMucTrackFromRec(BesGeoTrack *mucTrack, const TRecMucTrack *recTrack)
Definition: BesEvent.cxx:1294
const TObjArray * GetEmcDigiCol() const
Definition: BesEvent.h:114
const TMdcDigi * GetMdcDigi(Int_t i) const
Definition: BesEvent.h:138
const TObjArray * GetDedxCol(TDisTrack *recEvent) const
Definition: BesEvent.h:191
const TObjArray * GetCgemDigiCol() const
Definition: BesEvent.h:92
Long64_t GetRun()
Definition: BesEvent.h:283
virtual void DrawMcParticles(Option_t *option)
Definition: BesEvent.cxx:1586
const TObjArray * GetTofDigiCol() const
Definition: BesEvent.h:110
const Int_t GetDedxNum(TDisTrack *recEvent) const
Definition: BesEvent.h:236
const TEmcDigi * GetEmcDigi(Int_t i) const
Definition: BesEvent.h:146
const TRecMucTrack * GetMucTrack(Int_t i, TDisTrack *recEvent) const
Definition: BesEvent.h:264
virtual void ConstructMdcTrackFromRec(BesGeoTrack *mdcTrack, const TRecMdcTrack *recTrack, TDisTrack *recEvent)
Definition: BesEvent.cxx:742
const TObjArray * GetExtTrackCol() const
Definition: BesEvent.h:185
virtual void SetEvent(TDigiEvent *digiEvent, TDisTrack *recEvent, TEvtHeader *evtHeader, TRecEvTime *recEvTime, Bool_t isRec, TMcEvent *mcEvt=0)
Definition: BesEvent.cxx:158
virtual void DrawHits(Option_t *option)
Definition: BesEvent.cxx:1459
virtual void DrawTracks(Option_t *option)
Definition: BesEvent.cxx:1473
virtual void SetTracks(TDisTrack *recEvent)
Definition: BesEvent.cxx:315
virtual void SetExtTracks(TDisTrack *recEvent)
Definition: BesEvent.cxx:541
Long64_t GetEvent()
Definition: BesEvent.h:286
const TObjArray * getMucDigiCol() const
retrieve the whole TObjArray of MucDigi Data
Definition: TDigiEvent.h:81
const TMucDigi * getMucDigi(Int_t i) const
retrieve a MucDigi From the collection, using the index into the array
Definition: TDigiEvent.cxx:184
const TObjArray * getMdcDigiCol() const
retrieve the whole TObjArray of TkrDigi Data
Definition: TDigiEvent.h:32
const TMdcDigi * getMdcDigi(Int_t i) const
retrieve a TkrDigi from the collection, using the index into the array
Definition: TDigiEvent.cxx:140
const TEmcDigi * getEmcDigi(Int_t i) const
retrieve a EmcDigi from the collection, using the index into the array
Definition: TDigiEvent.cxx:160
const TCgemDigi * getCgemDigi(Int_t i) const
retrieve a TkrDigi from the collection, using the index into the array
Definition: TDigiEvent.cxx:150
const TTofDigi * getTofDigi(Int_t i) const
retrieve a TofDigi From the collection, using the index into the array
Definition: TDigiEvent.cxx:172
const TObjArray * getTofDigiCol() const
retrieve the whole TObjArray of TofDigi Data
Definition: TDigiEvent.h:69
const TObjArray * getEmcDigiCol() const
retrieve the whole TObjArray of TkrDigi Data
Definition: TDigiEvent.h:57
const TObjArray * getCgemDigiCol() const
retrieve the whole TObjArray of TkrDigi Data
Definition: TDigiEvent.h:44
const TRecTofTrack * getTofTrack(Int_t i) const
retrieve a TofTrack From the collection, using the index into the array
Definition: TDisTrack.cxx:204
const TRecMucTrack * getMucTrack(Int_t i) const
retrieve a MucTrack From the collection, using the index into the array
Definition: TDisTrack.cxx:215
const TObjArray * getRecMdcTrackCol() const
retrieve the whole TObjArray of RecMdcTrack Data
Definition: TDisTrack.h:34
const TRecEmcShower * getEmcShower(Int_t i) const
retrieve a EmcShower from the collection, using the index into the array
Definition: TDisTrack.cxx:227
int getMdcTrackNum()
Definition: TDisTrack.cxx:233
const TObjArray * getTofTrackCol() const
retrieve the whole TObjArray of TofTrack Data
Definition: TDisTrack.h:88
int getMucTrackNum()
Definition: TDisTrack.cxx:283
int getEmcShowerNum()
Definition: TDisTrack.cxx:273
int getTofTrackNum()
Definition: TDisTrack.cxx:263
const TObjArray * getMucTrackCol() const
retrieve the whole TObjArray of MucTrack Data
Definition: TDisTrack.h:99
const TRecMdcTrack * getRecMdcTrack(Int_t i) const
retrieve a MdcTrack from the collection, using the index into the array
Definition: TDisTrack.cxx:151