BOSS 7.0.8
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
12#include "BesEventHeader.h"
13#include "BesGeoTrack.h"
14
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 //Long Peixun's update: add parameter "isRec"
51 virtual void SetEvent(TDigiEvent *digiEvent, TDisTrack *recEvent, TEvtHeader *evtHeader, TRecEvTime *recEvTime, Bool_t isRec);//, TTrigEvent *trigEvent);
52 virtual void SetHits();
53 virtual void SetTracks(TDisTrack *recEvent);
54 virtual void SetMdcTracks(TDisTrack *recEvent);
55 virtual void SetTofTracks(TDisTrack *recEvent);
56 virtual void SetEmcShowers(TDisTrack *recEvent);
57 virtual void SetMucTracks(TDisTrack *recEvent);
58 virtual void SetExtTracks(TDisTrack *recEvent);
59 virtual void ConstructMdcTrackFromRec(BesGeoTrack *mdcTrack, const TRecMdcTrack *recTrack,TDisTrack *recEvent);
60 virtual void ConstructMucTrackFromRec(BesGeoTrack *mucTrack, const TRecMucTrack *recTrack);
61 virtual void ConstructEmcTrackFromRec(BesGeoTrack *emcTrack, const TRecEmcShower *recTrack);
62 //virtual void ConstructTofTrackFromRec(BesGeoTrack *tofTrack, const TRecBTofTrack *recBTrack);
63 //virtual void ConstructTofTrackFromRec(BesGeoTrack *tofTrack, const TRecETofTrack *recETrack);
64 virtual void ConstructTofTrackFromRec(BesGeoTrack *tofTrack, const TRecTofTrack *recTrack,TDisTrack *recEvent);
65 //virtual void ConstructExtTrackFromRec(BesGeoTrack *extTrack, const TExtTrack *recTrack);
66 virtual void DrawHits(Option_t *option);
67 virtual void DrawTracks(Option_t *option);
68 void SetMagnetic(Double_t input) {f_Magnetic = input;}
69
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 } //Long Peixun's update: Remove semicolon
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
119 const TObjArray* GetMdcTrackCol(TDisTrack *recEvent) const {
120 if (recEvent)
121 return recEvent->getRecMdcTrackCol();
122 else return 0;
123 }
124 //const TObjArray* GetBTofTrackCol() const {
125 // if (fRecEvent)
126 // return fRecEvent->getTofTrackCol();
127 // else return 0;
128 //}
129 const TObjArray* GetTofTrackCol(TDisTrack *recEvent) const {
130 if (recEvent)
131 return recEvent->getTofTrackCol();
132 else
133 return 0;
134 }
135 const TObjArray* GetEmcShowerCol(TDisTrack *recEvent) const {
136 // if (recEvent)
137 // return recEvent->getEmcShowerCol();
138 // else
139 return 0;
140 }
141 const TObjArray* GetMucTrackCol(TDisTrack *recEvent) const {
142 if (recEvent)
143 return recEvent->getMucTrackCol();
144 else
145 return 0;
146 }
147 const TObjArray* GetExtTrackCol() const {
148 return 0; // for test
149 //if (fRecEvent)
150 // return fRecEvent->getExtTrackCol();
151 //else return 0;
152 }
153 const TObjArray* GetDedxCol(TDisTrack *recEvent) const {
154 // if (recEvent)
155 // return recEvent->getRecMdcDedxCol();
156 // else
157 return 0;
158 }
159 const Int_t GetMdcTrackNum(TDisTrack *recEvent) const {
160 if (recEvent)
161// return recEvent->getRecMdcTrackCol()->GetEntries();
162 return recEvent->getMdcTrackNum();
163 else
164 return -1;
165 }
166 //const Int_t GetBTofTrackNum() const {
167 // if (fRecEvent)
168 // return fRecEvent->getTofTrackCol()->GetEntries();
169 // else return -1;
170 //};
171 const Int_t GetTofTrackNum(TDisTrack *recEvent) const {
172 if (recEvent)
173 // return recEvent->getTofTrackCol()->GetEntries();
174 return recEvent->getTofTrackNum();
175 else
176 return -1;
177 }
178 const Int_t GetEmcShowerNum(TDisTrack *recEvent) const {
179 if (recEvent)
180 // return recEvent->getEmcShowerCol()->GetEntries();
181 return recEvent->getEmcShowerNum();
182 else
183 return -1;
184 }
185 const Int_t GetMucTrackNum(TDisTrack *recEvent) const {
186 if (recEvent)
187 return recEvent->getMucTrackNum();
188 // return recEvent->getMucTrackCol()->GetEntries();
189 else
190 return -1;
191 }
192 const Int_t GetExtTrackNum() const {
193 return -1;// for test
194 //if (fRecEvent)
195 // return fRecEvent->getExtTrackCol()->GetEntries();
196 //else return -1;
197 }
198 const Int_t GetDedxNum(TDisTrack *recEvent) const {
199 // if (fRecEvent)
200 // return fRecEvent->getRecMdcDedxCol()->GetEntries();
201 // else
202 return -1;
203 }
204 const TRecMdcTrack* GetMdcTrack(Int_t i,TDisTrack *recEvent) const {
205 if (recEvent)
206 return recEvent->getRecMdcTrack(i);
207 else return 0;
208 }
209 //const TRecBTofTrack* GetBTofTrack(Int_t i) const {
210 // if (fRecEvent)
211 // return fRecEvent->getBTofTrack(i);
212 // else return 0;
213 //};
214 const TRecTofTrack* GetTofTrack(Int_t i,TDisTrack *recEvent) const {
215 if (recEvent)
216 return recEvent->getTofTrack(i);
217 else
218 return 0;
219 }
220 const TRecEmcShower* GetEmcShower(Int_t i,TDisTrack *recEvent) const {
221 if (recEvent)
222 return recEvent->getEmcShower(i);
223 else
224 return 0;
225 }
226 const TRecMucTrack* GetMucTrack(Int_t i,TDisTrack *recEvent) const {
227 if (recEvent)
228 return recEvent->getMucTrack(i);
229 else
230 return 0;
231 }
232 //const TExtTrack* GetExtTrack(Int_t i) const {
233 // if (fRecEvent)
234 // return fRecEvent->getExtTrack(i);
235 // else return 0;
236 //};
237 const TRecMdcDedx* GetDedx(Int_t i) const {
238 // if (fRecEvent)
239 // return fRecEvent->getRecMdcDedx(i);
240 // else
241 return 0;
242 }
243
244 // header access functions
245 inline Long64_t GetRun() {
246 return fEventHeader.GetRunNumber();
247 }
248 inline Long64_t GetEvent() {
249 return fEventHeader.GetEventNumber();
250 }
251 inline Int_t GetYear() {
252 return fEventHeader.GetEventYear();
253 }
254 inline Int_t GetMonth() {
255 return fEventHeader.GetEventMonth();
256 }
257 inline Int_t GetDay() {
258 return fEventHeader.GetEventDay();
259 }
260 inline Int_t GetHour() {
261 return fEventHeader.GetEventHour();
262 }
263 inline Int_t GetMin() {
264 return fEventHeader.GetEventMin();
265 }
266 inline Int_t GetSec() {
267 return fEventHeader.GetEventSec();
268 }
269 inline Int_t GetMC() {
270 return fEventHeader.GetEventMC();
271 }
273 return fEventHeader;
274 }
275
276 ClassDef(BesEvent,0) // BesVis Event
277};
278
279R__EXTERN BesEvent *gEvent;
280
281#endif
282
R__EXTERN BesEvent * gEvent
Definition: BesEvent.h:279
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:141
const Int_t GetMucTrackNum(TDisTrack *recEvent) const
Definition: BesEvent.h:185
const TObjArray * GetTofTrackCol(TDisTrack *recEvent) const
Definition: BesEvent.h:129
virtual void Delete(Option_t *option="")
Definition: BesEvent.cxx:58
virtual void SetHits()
Definition: BesEvent.cxx:239
const TRecTofTrack * GetTofTrack(Int_t i, TDisTrack *recEvent) const
Definition: BesEvent.h:214
virtual ~BesEvent()
Definition: BesEvent.cxx:48
Int_t GetSec()
Definition: BesEvent.h:266
const Int_t GetMucDigiNum() const
Definition: BesEvent.h:98
virtual void Clear(Option_t *option="")
Definition: BesEvent.cxx:103
Int_t GetMin()
Definition: BesEvent.h:263
const TObjArray * GetEmcShowerCol(TDisTrack *recEvent) const
Definition: BesEvent.h:135
const Int_t GetTofDigiNum() const
Definition: BesEvent.h:90
virtual void ConstructTofTrackFromRec(BesGeoTrack *tofTrack, const TRecTofTrack *recTrack, TDisTrack *recEvent)
Definition: BesEvent.cxx:663
virtual void SetTofTracks(TDisTrack *recEvent)
Definition: BesEvent.cxx:284
const TTofDigi * GetTofDigi(Int_t i) const
Definition: BesEvent.h:106
const TObjArray * GetMdcTrackCol(TDisTrack *recEvent) const
Definition: BesEvent.h:119
const TObjArray * GetMucDigiCol() const
Definition: BesEvent.h:82
const TRecMdcTrack * GetMdcTrack(Int_t i, TDisTrack *recEvent) const
Definition: BesEvent.h:204
const Int_t GetMdcTrackNum(TDisTrack *recEvent) const
Definition: BesEvent.h:159
Int_t GetMonth()
Definition: BesEvent.h:254
Int_t GetMC()
Definition: BesEvent.h:269
Int_t GetDay()
Definition: BesEvent.h:257
void SetMagnetic(Double_t input)
Definition: BesEvent.h:68
Int_t GetHour()
Definition: BesEvent.h:260
virtual void ConstructEmcTrackFromRec(BesGeoTrack *emcTrack, const TRecEmcShower *recTrack)
Definition: BesEvent.cxx:817
const Int_t GetTofTrackNum(TDisTrack *recEvent) const
Definition: BesEvent.h:171
virtual void Print(Option_t *option="")
Definition: BesEvent.cxx:1123
const TRecMdcDedx * GetDedx(Int_t i) const
Definition: BesEvent.h:237
const Int_t GetMdcDigiNum() const
Definition: BesEvent.h:86
virtual void SetMucTracks(TDisTrack *recEvent)
Definition: BesEvent.cxx:327
Int_t GetYear()
Definition: BesEvent.h:251
const Int_t GetExtTrackNum() const
Definition: BesEvent.h:192
virtual void SetMdcTracks(TDisTrack *recEvent)
Definition: BesEvent.cxx:264
virtual void SetEmcShowers(TDisTrack *recEvent)
Definition: BesEvent.cxx:306
const Int_t GetEmcShowerNum(TDisTrack *recEvent) const
Definition: BesEvent.h:178
const TMucDigi * GetMucDigi(Int_t i) const
Definition: BesEvent.h:114
BesEventHeader GetHeader()
Definition: BesEvent.h:272
const TObjArray * GetMdcDigiCol() const
Definition: BesEvent.h:70
const TRecEmcShower * GetEmcShower(Int_t i, TDisTrack *recEvent) const
Definition: BesEvent.h:220
const Int_t GetEmcDigiNum() const
Definition: BesEvent.h:94
virtual void ConstructMucTrackFromRec(BesGeoTrack *mucTrack, const TRecMucTrack *recTrack)
Definition: BesEvent.cxx:895
const TObjArray * GetEmcDigiCol() const
Definition: BesEvent.h:78
const TMdcDigi * GetMdcDigi(Int_t i) const
Definition: BesEvent.h:102
const TObjArray * GetDedxCol(TDisTrack *recEvent) const
Definition: BesEvent.h:153
Long64_t GetRun()
Definition: BesEvent.h:245
const TObjArray * GetTofDigiCol() const
Definition: BesEvent.h:74
virtual void SetEvent(TDigiEvent *digiEvent, TDisTrack *recEvent, TEvtHeader *evtHeader, TRecEvTime *recEvTime, Bool_t isRec)
Definition: BesEvent.cxx:114
const Int_t GetDedxNum(TDisTrack *recEvent) const
Definition: BesEvent.h:198
const TEmcDigi * GetEmcDigi(Int_t i) const
Definition: BesEvent.h:110
const TRecMucTrack * GetMucTrack(Int_t i, TDisTrack *recEvent) const
Definition: BesEvent.h:226
virtual void ConstructMdcTrackFromRec(BesGeoTrack *mdcTrack, const TRecMdcTrack *recTrack, TDisTrack *recEvent)
Definition: BesEvent.cxx:362
const TObjArray * GetExtTrackCol() const
Definition: BesEvent.h:147
virtual void DrawHits(Option_t *option)
Definition: BesEvent.cxx:1060
virtual void DrawTracks(Option_t *option)
Definition: BesEvent.cxx:1072
virtual void SetTracks(TDisTrack *recEvent)
Definition: BesEvent.cxx:250
virtual void SetExtTracks(TDisTrack *recEvent)
Definition: BesEvent.cxx:347
Long64_t GetEvent()
Definition: BesEvent.h:248
const TObjArray * getMucDigiCol() const
retrieve the whole TObjArray of MucDigi Data
Definition: TDigiEvent.h:68
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
Definition: TDigiEvent.h:31
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
Definition: TDigiEvent.h:56
const TObjArray * getEmcDigiCol() 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: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
Definition: TDisTrack.h:31
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
Definition: TDisTrack.h:52
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
Definition: TDisTrack.h:63
const TRecMdcTrack * getRecMdcTrack(Int_t i) const
retrieve a MdcTrack from the collection, using the index into the array
Definition: TDisTrack.cxx:113