00001
00002
00003
00004
00005 #ifndef BES_EVENT
00006 #define BES_EVENT
00007
00008 #include <time.h>
00009 #include <TObject.h>
00010 #include <TString.h>
00011
00012 #include "BesEventHeader.h"
00013 #include "BesGeoTrack.h"
00014
00015 #include "RootEventData/TDigiEvent.h"
00016 #include "RootEventData/TRecTrackEvent.h"
00017 #include "RootEventData/TEvtHeader.h"
00018 #include "RootEventData/TDisTrack.h"
00019 #include "RootEventData/TTrigEvent.h"
00020 #include "RootEventData/TTrigData.h"
00021 #include "RootEventData/TRecEvTime.h"
00022
00023 class BesEvent : public TObject {
00024
00025 private:
00026 Double_t f_Magnetic;
00027 BesEventHeader fEventHeader;
00028 TDigiEvent *fDigiEvent;
00029 TEvtHeader *fEvtHeader;
00030 TTrigEvent *fTrigEvent;
00031 TRecEvTime *fRecEvTime;
00032
00033 TObjArray *fMdcTrackCol;
00034 TObjArray *fTofTrackCol;
00035 TObjArray *fEmcTrackCol;
00036 TObjArray *fMucTrackCol;
00037 TObjArray *fExtTrackCol;
00038
00039 bool Is_tofBarrel(UInt_t status);
00040 bool Is_tofCounter(UInt_t status);
00041 public:
00042 BesEvent();
00043 virtual ~BesEvent();
00044
00045 virtual void Clear(Option_t *option = "");
00046 virtual void Delete(Option_t *option = "");
00047 virtual void Print(Option_t *option = "");
00048
00049
00050 virtual void SetEvent(TDigiEvent *digiEvent, TDisTrack *recEvent, TEvtHeader *evtHeader, TRecEvTime *recEvTime);
00051 virtual void SetHits();
00052 virtual void SetTracks(TDisTrack *recEvent);
00053 virtual void SetMdcTracks(TDisTrack *recEvent);
00054 virtual void SetTofTracks(TDisTrack *recEvent);
00055 virtual void SetEmcShowers(TDisTrack *recEvent);
00056 virtual void SetMucTracks(TDisTrack *recEvent);
00057 virtual void SetExtTracks(TDisTrack *recEvent);
00058 virtual void ConstructMdcTrackFromRec(BesGeoTrack *mdcTrack, const TRecMdcTrack *recTrack,TDisTrack *recEvent);
00059 virtual void ConstructMucTrackFromRec(BesGeoTrack *mucTrack, const TRecMucTrack *recTrack);
00060 virtual void ConstructEmcTrackFromRec(BesGeoTrack *emcTrack, const TRecEmcShower *recTrack);
00061
00062
00063 virtual void ConstructTofTrackFromRec(BesGeoTrack *tofTrack, const TRecTofTrack *recTrack,TDisTrack *recEvent);
00064
00065 virtual void DrawHits(Option_t *option);
00066 virtual void DrawTracks(Option_t *option);
00067
00068
00069 void SetMagnetic(Double_t input){f_Magnetic = input;};
00070 const TObjArray* GetMdcDigiCol() const {
00071 if (fDigiEvent) return fDigiEvent->getMdcDigiCol();
00072 else return 0;
00073 };
00074 const TObjArray* GetTofDigiCol() const {
00075 if (fDigiEvent) return fDigiEvent->getTofDigiCol();
00076 else return 0;
00077 };
00078 const TObjArray* GetEmcDigiCol() const {
00079 if (fDigiEvent) return fDigiEvent->getEmcDigiCol();
00080 else return 0;
00081 };
00082 const TObjArray* GetMucDigiCol() const {
00083 if (fDigiEvent) return fDigiEvent->getMucDigiCol();
00084 else return 0;
00085 };
00086 const Int_t GetMdcDigiNum() const {
00087 if (fDigiEvent) return fDigiEvent->getMdcDigiCol()->GetEntries();
00088 else return -1;
00089 };
00090 const Int_t GetTofDigiNum() const {
00091 if (fDigiEvent) return fDigiEvent->getTofDigiCol()->GetEntries();
00092 else return -1;
00093 };
00094 const Int_t GetEmcDigiNum() const {
00095 if (fDigiEvent) return fDigiEvent->getEmcDigiCol()->GetEntries();
00096 else return -1;
00097 };
00098 const Int_t GetMucDigiNum() const {
00099 if (fDigiEvent) return fDigiEvent->getMucDigiCol()->GetEntries();
00100 else return -1;
00101 };
00102 const TMdcDigi* GetMdcDigi(Int_t i) const {
00103 if (fDigiEvent) return fDigiEvent->getMdcDigi(i);
00104 else return 0;
00105 };
00106 const TTofDigi* GetTofDigi(Int_t i) const {
00107 if (fDigiEvent) return fDigiEvent->getTofDigi(i);
00108 else return 0;
00109 };
00110 const TEmcDigi* GetEmcDigi(Int_t i) const {
00111 if (fDigiEvent) return fDigiEvent->getEmcDigi(i);
00112 else return 0;
00113 };
00114 const TMucDigi* GetMucDigi(Int_t i) const {
00115 if (fDigiEvent) return fDigiEvent->getMucDigi(i);
00116 else return 0;
00117 };
00118 const TObjArray* GetMdcTrackCol(TDisTrack *recEvent) const {
00119 if (recEvent)
00120 return recEvent->getRecMdcTrackCol();
00121 else return 0;
00122 };
00123
00124
00125
00126
00127
00128 const TObjArray* GetTofTrackCol(TDisTrack *recEvent) const {
00129 if (recEvent)
00130 return recEvent->getTofTrackCol();
00131 else
00132 return 0;
00133 };
00134 const TObjArray* GetEmcShowerCol(TDisTrack *recEvent) const {
00135
00136
00137
00138 return 0;
00139 };
00140 const TObjArray* GetMucTrackCol(TDisTrack *recEvent) const {
00141 if (recEvent)
00142 return recEvent->getMucTrackCol();
00143 else
00144 return 0;
00145 };
00146 const TObjArray* GetExtTrackCol() const {
00147 return 0;
00148
00149
00150
00151 };
00152 const TObjArray* GetDedxCol(TDisTrack *recEvent) const {
00153
00154
00155
00156 return 0;
00157 };
00158 const Int_t GetMdcTrackNum(TDisTrack *recEvent) const {
00159 if (recEvent)
00160
00161 return recEvent->getMdcTrackNum();
00162 else
00163 return -1;
00164 };
00165
00166
00167
00168
00169
00170 const Int_t GetTofTrackNum(TDisTrack *recEvent) const {
00171 if (recEvent)
00172
00173 return recEvent->getTofTrackNum();
00174 else
00175 return -1;
00176 };
00177 const Int_t GetEmcShowerNum(TDisTrack *recEvent) const {
00178 if (recEvent)
00179
00180 return recEvent->getEmcShowerNum();
00181 else
00182 return -1;
00183 };
00184 const Int_t GetMucTrackNum(TDisTrack *recEvent) const {
00185 if (recEvent)
00186 return recEvent->getMucTrackNum();
00187
00188 else
00189 return -1;
00190 };
00191 const Int_t GetExtTrackNum() const {
00192 return -1;
00193
00194
00195
00196 };
00197 const Int_t GetDedxNum(TDisTrack *recEvent) const {
00198
00199
00200
00201 return -1;
00202 };
00203 const TRecMdcTrack* GetMdcTrack(Int_t i,TDisTrack *recEvent) const {
00204 if (recEvent)
00205 return recEvent->getRecMdcTrack(i);
00206 else return 0;
00207 };
00208
00209
00210
00211
00212
00213 const TRecTofTrack* GetTofTrack(Int_t i,TDisTrack *recEvent) const {
00214 if (recEvent)
00215 return recEvent->getTofTrack(i);
00216 else
00217 return 0;
00218 };
00219 const TRecEmcShower* GetEmcShower(Int_t i,TDisTrack *recEvent) const {
00220 if (recEvent)
00221 return recEvent->getEmcShower(i);
00222 else
00223 return 0;
00224 };
00225 const TRecMucTrack* GetMucTrack(Int_t i,TDisTrack *recEvent) const {
00226 if (recEvent)
00227 return recEvent->getMucTrack(i);
00228 else
00229 return 0;
00230 };
00231
00232
00233
00234
00235
00236 const TRecMdcDedx* GetDedx(Int_t i) const {
00237
00238
00239
00240 return 0;
00241 };
00242
00243
00244 inline Long64_t GetRun() {
00245 return fEventHeader.GetRunNumber();
00246 }
00247 inline Long64_t GetEvent() {
00248 return fEventHeader.GetEventNumber();
00249 }
00250 inline Int_t GetYear() {
00251 return fEventHeader.GetEventYear();
00252 }
00253 inline Int_t GetMonth() {
00254 return fEventHeader.GetEventMonth();
00255 }
00256 inline Int_t GetDay() {
00257 return fEventHeader.GetEventDay();
00258 }
00259 inline Int_t GetHour() {
00260 return fEventHeader.GetEventHour();
00261 }
00262 inline Int_t GetMin() {
00263 return fEventHeader.GetEventMin();
00264 }
00265 inline Int_t GetSec() {
00266 return fEventHeader.GetEventSec();
00267 }
00268 inline Int_t GetMC() {
00269 return fEventHeader.GetEventMC();
00270 }
00271 inline BesEventHeader GetHeader(){
00272 return fEventHeader;
00273 }
00274
00275 ClassDef(BesEvent,0)
00276 };
00277
00278 R__EXTERN BesEvent *gEvent;
00279
00280 #endif
00281