BOSS 7.0.1
BESIII Offline Software System
Loading...
Searching...
No Matches
InstallArea/include/BesVisLib/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 <time.h>
9#include <TObject.h>
10#include <TString.h>
11
12#include "BesEventHeader.h"
13#include "BesGeoTrack.h"
14
15#include "RootEventData/TDigiEvent.h"
16#include "RootEventData/TRecTrackEvent.h"
17#include "RootEventData/TEvtHeader.h"
18#include "RootEventData/TDisTrack.h"
19#include "RootEventData/TTrigEvent.h"
20#include "RootEventData/TTrigData.h"
21#include "RootEventData/TRecEvTime.h"
22
23class BesEvent : public TObject {
24
25private:
26 Double_t f_Magnetic;
27 BesEventHeader fEventHeader; // Event header
28 TDigiEvent *fDigiEvent;
29 TEvtHeader *fEvtHeader;
30 TTrigEvent *fTrigEvent;
31 TRecEvTime *fRecEvTime;
32
33 TObjArray *fMdcTrackCol;
34 TObjArray *fTofTrackCol;
35 TObjArray *fEmcTrackCol;
36 TObjArray *fMucTrackCol;
37 TObjArray *fExtTrackCol;
38
39 bool Is_tofBarrel(UInt_t status);
40 bool Is_tofCounter(UInt_t status);
41public:
43 virtual ~BesEvent();
44
45 virtual void Clear(Option_t *option = "");
46 virtual void Delete(Option_t *option = "");
47 virtual void Print(Option_t *option = "");
48
49 //virtual void SetEvent(TDigiEvent *digiEvent, TDisTrack *recEvent, TEvtHeader *evtHeader, TTrigEvent *trigEvent);
50 virtual void SetEvent(TDigiEvent *digiEvent, TDisTrack *recEvent, TEvtHeader *evtHeader, TRecEvTime *recEvTime);//, TTrigEvent *trigEvent);
51 virtual void SetHits();
52 virtual void SetTracks(TDisTrack *recEvent);
53 virtual void SetMdcTracks(TDisTrack *recEvent);
54 virtual void SetTofTracks(TDisTrack *recEvent);
55 virtual void SetEmcShowers(TDisTrack *recEvent);
56 virtual void SetMucTracks(TDisTrack *recEvent);
57 virtual void SetExtTracks(TDisTrack *recEvent);
58 virtual void ConstructMdcTrackFromRec(BesGeoTrack *mdcTrack, const TRecMdcTrack *recTrack,TDisTrack *recEvent);
59 virtual void ConstructMucTrackFromRec(BesGeoTrack *mucTrack, const TRecMucTrack *recTrack);
60 virtual void ConstructEmcTrackFromRec(BesGeoTrack *emcTrack, const TRecEmcShower *recTrack);
61 //virtual void ConstructTofTrackFromRec(BesGeoTrack *tofTrack, const TRecBTofTrack *recBTrack);
62 //virtual void ConstructTofTrackFromRec(BesGeoTrack *tofTrack, const TRecETofTrack *recETrack);
63 virtual void ConstructTofTrackFromRec(BesGeoTrack *tofTrack, const TRecTofTrack *recTrack,TDisTrack *recEvent);
64 //virtual void ConstructExtTrackFromRec(BesGeoTrack *extTrack, const TExtTrack *recTrack);
65 virtual void DrawHits(Option_t *option);
66 virtual void DrawTracks(Option_t *option);
67
68
69 void SetMagnetic(Double_t input){f_Magnetic = input;};
70 const TObjArray* GetMdcDigiCol() const {
71 if (fDigiEvent) return fDigiEvent->getMdcDigiCol();
72 else return 0;
73 };
74 const TObjArray* GetTofDigiCol() const {
75 if (fDigiEvent) return fDigiEvent->getTofDigiCol();
76 else return 0;
77 };
78 const TObjArray* GetEmcDigiCol() const {
79 if (fDigiEvent) return fDigiEvent->getEmcDigiCol();
80 else return 0;
81 };
82 const TObjArray* GetMucDigiCol() const {
83 if (fDigiEvent) return fDigiEvent->getMucDigiCol();
84 else return 0;
85 };
86 const Int_t GetMdcDigiNum() const {
87 if (fDigiEvent) return fDigiEvent->getMdcDigiCol()->GetEntries();
88 else return -1;
89 };
90 const Int_t GetTofDigiNum() const {
91 if (fDigiEvent) return fDigiEvent->getTofDigiCol()->GetEntries();
92 else return -1;
93 };
94 const Int_t GetEmcDigiNum() const {
95 if (fDigiEvent) return fDigiEvent->getEmcDigiCol()->GetEntries();
96 else return -1;
97 };
98 const Int_t GetMucDigiNum() const {
99 if (fDigiEvent) return fDigiEvent->getMucDigiCol()->GetEntries();
100 else return -1;
101 };
102 const TMdcDigi* GetMdcDigi(Int_t i) const {
103 if (fDigiEvent) return fDigiEvent->getMdcDigi(i);
104 else return 0;
105 };
106 const TTofDigi* GetTofDigi(Int_t i) const {
107 if (fDigiEvent) return fDigiEvent->getTofDigi(i);
108 else return 0;
109 };
110 const TEmcDigi* GetEmcDigi(Int_t i) const {
111 if (fDigiEvent) return fDigiEvent->getEmcDigi(i);
112 else return 0;
113 };
114 const TMucDigi* GetMucDigi(Int_t i) const {
115 if (fDigiEvent) return fDigiEvent->getMucDigi(i);
116 else return 0;
117 };
118 const TObjArray* GetMdcTrackCol(TDisTrack *recEvent) const {
119 if (recEvent)
120 return recEvent->getRecMdcTrackCol();
121 else return 0;
122 };
123 //const TObjArray* GetBTofTrackCol() const {
124 // if (fRecEvent)
125 // return fRecEvent->getTofTrackCol();
126 // else return 0;
127 //};
128 const TObjArray* GetTofTrackCol(TDisTrack *recEvent) const {
129 if (recEvent)
130 return recEvent->getTofTrackCol();
131 else
132 return 0;
133 };
134 const TObjArray* GetEmcShowerCol(TDisTrack *recEvent) const {
135 // if (recEvent)
136 // return recEvent->getEmcShowerCol();
137 // else
138 return 0;
139 };
140 const TObjArray* GetMucTrackCol(TDisTrack *recEvent) const {
141 if (recEvent)
142 return recEvent->getMucTrackCol();
143 else
144 return 0;
145 };
146 const TObjArray* GetExtTrackCol() const {
147 return 0; // for test
148 //if (fRecEvent)
149 // return fRecEvent->getExtTrackCol();
150 //else return 0;
151 };
152 const TObjArray* GetDedxCol(TDisTrack *recEvent) const {
153 // if (recEvent)
154 // return recEvent->getRecMdcDedxCol();
155 // else
156 return 0;
157 };
158 const Int_t GetMdcTrackNum(TDisTrack *recEvent) const {
159 if (recEvent)
160// return recEvent->getRecMdcTrackCol()->GetEntries();
161 return recEvent->getMdcTrackNum();
162 else
163 return -1;
164 };
165 //const Int_t GetBTofTrackNum() const {
166 // if (fRecEvent)
167 // return fRecEvent->getTofTrackCol()->GetEntries();
168 // else return -1;
169 //};
170 const Int_t GetTofTrackNum(TDisTrack *recEvent) const {
171 if (recEvent)
172 // return recEvent->getTofTrackCol()->GetEntries();
173 return recEvent->getTofTrackNum();
174 else
175 return -1;
176 };
177 const Int_t GetEmcShowerNum(TDisTrack *recEvent) const {
178 if (recEvent)
179 // return recEvent->getEmcShowerCol()->GetEntries();
180 return recEvent->getEmcShowerNum();
181 else
182 return -1;
183 };
184 const Int_t GetMucTrackNum(TDisTrack *recEvent) const {
185 if (recEvent)
186 return recEvent->getMucTrackNum();
187 // return recEvent->getMucTrackCol()->GetEntries();
188 else
189 return -1;
190 };
191 const Int_t GetExtTrackNum() const {
192 return -1;// for test
193 //if (fRecEvent)
194 // return fRecEvent->getExtTrackCol()->GetEntries();
195 //else return -1;
196 };
197 const Int_t GetDedxNum(TDisTrack *recEvent) const {
198 // if (fRecEvent)
199 // return fRecEvent->getRecMdcDedxCol()->GetEntries();
200 // else
201 return -1;
202 };
203 const TRecMdcTrack* GetMdcTrack(Int_t i,TDisTrack *recEvent) const {
204 if (recEvent)
205 return recEvent->getRecMdcTrack(i);
206 else return 0;
207 };
208 //const TRecBTofTrack* GetBTofTrack(Int_t i) const {
209 // if (fRecEvent)
210 // return fRecEvent->getBTofTrack(i);
211 // else return 0;
212 //};
213 const TRecTofTrack* GetTofTrack(Int_t i,TDisTrack *recEvent) const {
214 if (recEvent)
215 return recEvent->getTofTrack(i);
216 else
217 return 0;
218 };
219 const TRecEmcShower* GetEmcShower(Int_t i,TDisTrack *recEvent) const {
220 if (recEvent)
221 return recEvent->getEmcShower(i);
222 else
223 return 0;
224 };
225 const TRecMucTrack* GetMucTrack(Int_t i,TDisTrack *recEvent) const {
226 if (recEvent)
227 return recEvent->getMucTrack(i);
228 else
229 return 0;
230 };
231 //const TExtTrack* GetExtTrack(Int_t i) const {
232 // if (fRecEvent)
233 // return fRecEvent->getExtTrack(i);
234 // else return 0;
235 //};
236 const TRecMdcDedx* GetDedx(Int_t i) const {
237 // if (fRecEvent)
238 // return fRecEvent->getRecMdcDedx(i);
239 // else
240 return 0;
241 };
242
243 // header access functions
244 inline Long64_t GetRun() {
245 return fEventHeader.GetRunNumber();
246 }
247 inline Long64_t GetEvent() {
248 return fEventHeader.GetEventNumber();
249 }
250 inline Int_t GetYear() {
251 return fEventHeader.GetEventYear();
252 }
253 inline Int_t GetMonth() {
254 return fEventHeader.GetEventMonth();
255 }
256 inline Int_t GetDay() {
257 return fEventHeader.GetEventDay();
258 }
259 inline Int_t GetHour() {
260 return fEventHeader.GetEventHour();
261 }
262 inline Int_t GetMin() {
263 return fEventHeader.GetEventMin();
264 }
265 inline Int_t GetSec() {
266 return fEventHeader.GetEventSec();
267 }
268 inline Int_t GetMC() {
269 return fEventHeader.GetEventMC();
270 }
272 return fEventHeader;
273 }
274
275 ClassDef(BesEvent,0) // BesVis Event
276};
277
278R__EXTERN BesEvent *gEvent;
279
280#endif
281
const TObjArray * GetMucTrackCol(TDisTrack *recEvent) const
virtual void SetMdcTracks(TDisTrack *recEvent)
const Int_t GetMucTrackNum(TDisTrack *recEvent) const
virtual void SetEmcShowers(TDisTrack *recEvent)
const TObjArray * GetTofTrackCol(TDisTrack *recEvent) const
const TRecTofTrack * GetTofTrack(Int_t i, TDisTrack *recEvent) const
const TObjArray * GetEmcShowerCol(TDisTrack *recEvent) const
virtual void Clear(Option_t *option="")
virtual void SetEvent(TDigiEvent *digiEvent, TDisTrack *recEvent, TEvtHeader *evtHeader, TRecEvTime *recEvTime)
const TTofDigi * GetTofDigi(Int_t i) const
virtual void SetExtTracks(TDisTrack *recEvent)
const TObjArray * GetMdcTrackCol(TDisTrack *recEvent) const
const TObjArray * GetMucDigiCol() const
const TRecMdcTrack * GetMdcTrack(Int_t i, TDisTrack *recEvent) const
const Int_t GetMdcTrackNum(TDisTrack *recEvent) const
virtual void SetHits()
virtual void SetTracks(TDisTrack *recEvent)
const Int_t GetTofTrackNum(TDisTrack *recEvent) const
const TRecMdcDedx * GetDedx(Int_t i) const
virtual void ConstructMucTrackFromRec(BesGeoTrack *mucTrack, const TRecMucTrack *recTrack)
virtual void Delete(Option_t *option="")
virtual void DrawTracks(Option_t *option)
virtual void SetTofTracks(TDisTrack *recEvent)
virtual void ConstructEmcTrackFromRec(BesGeoTrack *emcTrack, const TRecEmcShower *recTrack)
virtual void DrawHits(Option_t *option)
const Int_t GetEmcShowerNum(TDisTrack *recEvent) const
const TMucDigi * GetMucDigi(Int_t i) const
const TObjArray * GetMdcDigiCol() const
const TRecEmcShower * GetEmcShower(Int_t i, TDisTrack *recEvent) const
virtual void Print(Option_t *option="")
virtual void SetMucTracks(TDisTrack *recEvent)
virtual void ConstructMdcTrackFromRec(BesGeoTrack *mdcTrack, const TRecMdcTrack *recTrack, TDisTrack *recEvent)
const TObjArray * GetEmcDigiCol() const
const TMdcDigi * GetMdcDigi(Int_t i) const
const TObjArray * GetDedxCol(TDisTrack *recEvent) const
virtual ~BesEvent()
const TObjArray * GetTofDigiCol() const
const Int_t GetDedxNum(TDisTrack *recEvent) const
const TEmcDigi * GetEmcDigi(Int_t i) const
const TRecMucTrack * GetMucTrack(Int_t i, TDisTrack *recEvent) const
virtual void ConstructTofTrackFromRec(BesGeoTrack *tofTrack, const TRecTofTrack *recTrack, TDisTrack *recEvent)
const TObjArray * GetExtTrackCol() const
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
Definition: TDigiEvent.cxx:158
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
Definition: TDigiEvent.cxx:124
const TEmcDigi * getEmcDigi(Int_t i) const
retrieve a EmcDigi from the collection, using the index into the array
Definition: TDigiEvent.cxx:134
const TTofDigi * getTofDigi(Int_t i) const
retrieve a TofDigi From the collection, using the index into the array
Definition: TDigiEvent.cxx:146
const TObjArray * getTofDigiCol() const
retrieve the whole TObjArray of TofDigi Data
const TObjArray * getEmcDigiCol() 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
Definition: TDisTrack.cxx:134
const TRecMucTrack * getMucTrack(Int_t i) const
retrieve a MucTrack From the collection, using the index into the array
Definition: TDisTrack.cxx:145
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
Definition: TDisTrack.cxx:157
int getMdcTrackNum()
Definition: TDisTrack.cxx:163
const TObjArray * getTofTrackCol() const
retrieve the whole TObjArray of TofTrack Data
int getMucTrackNum()
Definition: TDisTrack.cxx:193
int getEmcShowerNum()
Definition: TDisTrack.cxx:183
int getTofTrackNum()
Definition: TDisTrack.cxx:173
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
Definition: TDisTrack.cxx:113