Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef TGO4MBSEVENT_H
00015 #define TGO4MBSEVENT_H
00016
00017 #include "TGo4EventElement.h"
00018
00019 #include "TGo4EventHeader10.h"
00020 #include "s_bufhe_swap.h"
00021 #include "s_filhe_swap.h"
00022 #include "TGo4MbsSubEvent.h"
00023
00024 class TIterator;
00025 class TObjArray;
00026 class TGo4MbsSource;
00027 class TGo4MbsSubEvent;
00028
00033 class TGo4MbsEvent : public TGo4EventElement {
00034
00035 friend class TGo4MbsSource;
00036
00037 public:
00038
00039
00040 TGo4MbsEvent();
00041
00046 TGo4MbsEvent(UInt_t subnum, Short_t* subids, UInt_t datasize=100);
00047
00053 TGo4MbsEvent(UInt_t subnum, Char_t* subcrates, Char_t* controls, Short_t* procids, UInt_t* datasizes);
00054
00057 TGo4MbsEvent(const char* name);
00058
00059 virtual ~TGo4MbsEvent();
00060
00062 virtual void Clear(Option_t *t="");
00063
00064
00065
00066
00067
00068
00069 void AssignReference(TGo4MbsEvent* ref);
00070
00071
00072
00073 void RemoveReference();
00074
00075 void Set(Int_t dlen=0, Short_t type=10, Short_t subtype=1,
00076 Short_t dummy=0, Short_t trigger=0, Int_t count=0);
00077
00079 virtual void PrintEvent();
00080
00089 void PrintMbsEvent(Int_t subid = -1, Bool_t longw = kTRUE, Bool_t hexw = kTRUE, Bool_t dataw = kTRUE,
00090 Bool_t bufhead = kFALSE, Bool_t filhead=kFALSE);
00091
00094 inline void ResetIterator() { fiSubEvIndex = 0; }
00095
00100 TGo4MbsSubEvent* NextSubEvent(Bool_t all=kFALSE);
00101
00106 TGo4MbsSubEvent * GetSubEvent(Char_t subcrate,
00107 Char_t ctrl,
00108 Short_t procid);
00109
00114 TGo4MbsSubEvent * GetSubEvent(Short_t procid);
00115
00122 TGo4MbsSubEvent* AddSubEvent(Int_t fullID,
00123 Short_t* source,
00124 Int_t datalength,
00125 Bool_t copydata = kFALSE);
00126
00127 void SetDlen(Int_t dlen) { fxHeader.fxGSIHeader.fiDlen = dlen; }
00128 Int_t GetDlen() const { return fxHeader.fxGSIHeader.fiDlen; }
00129 Int_t GetIntLen() const { return (GetDlen()-4)*2/4; }
00130 Int_t GetByteLen() const { return (GetDlen()-4)*2; }
00131
00132 void SetType(Short_t type) { fxHeader.fxGSIHeader.fsType = type; }
00133 Short_t GetType() const { return fxHeader.fxGSIHeader.fsType; }
00134
00135 void SetSubtype(Short_t subtype) { fxHeader.fxGSIHeader.fsSubtype = subtype; }
00136 Short_t GetSubtype() const { return fxHeader.fxGSIHeader.fsSubtype; }
00137
00138 void SetDummy(Short_t dummy) { fxHeader.fsDummy = dummy; }
00139 Short_t GetDummy() const { return fxHeader.fsDummy; }
00140
00141 void SetTrigger(Short_t trigger) { fxHeader.fsTrigger = trigger; }
00142 Short_t GetTrigger() const { return fxHeader.fsTrigger; }
00143
00144 void SetCount(Int_t count) { fxHeader.fiCount = count; }
00145 Int_t GetCount() const { return fxHeader.fiCount; }
00146
00148 s_filhe * GetMbsSourceHeader();
00149
00151 void PrintMbsFileHeader();
00152
00154 s_bufhe * GetMbsBufferHeader();
00155
00157 void PrintMbsBufferHeader();
00158
00159
00160 private:
00161
00163 TGo4EventHeader10 fxHeader;
00164
00166 TObjArray* fxSubEvArray;
00167
00169 Int_t fiSubEvIndex;
00170
00172 Bool_t fbIsReference;
00173
00174
00175 void SimpleInit();
00176
00177
00178
00179 ClassDef(TGo4MbsEvent,3)
00180 };
00181
00182 #endif //TGO4MBSEVENT_H