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