Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef TGO4MBSSOURCE_H
00015 #define TGO4MBSSOURCE_H
00016
00017 #include "TGo4EventSource.h"
00018
00019 #ifdef __CINT__
00020
00021 struct s_filhe;
00022 struct s_bufhe;
00023 struct s_evt_channel;
00024 struct s_ve10_1;
00025
00026 #else
00027
00028 extern "C"
00029 {
00030 #include "f_evt.h"
00031 #include "s_filhe_swap.h"
00032 #include "s_bufhe_swap.h"
00033 }
00034
00035 #endif
00036
00037 class TGo4MbsEvent;
00038 class TGo4MbsSubEvent;
00039 class TGo4MbsSourceParameter;
00040
00042 class TGo4MbsSourcePrintPar : public TObject {
00043
00044 public:
00045 TGo4MbsSourcePrintPar() : TObject(), fiNum(0), fiSid(0), fiLong(0), fiHex(0), fiData(0) {}
00046 virtual ~TGo4MbsSourcePrintPar() {}
00048 Int_t fiNum;
00050 Int_t fiSid;
00052 Int_t fiLong;
00054 Int_t fiHex;
00056 Int_t fiData;
00057 ClassDef(TGo4MbsSourcePrintPar, 1)
00058 };
00059
00060
00061 class TGo4MbsSource : public TGo4EventSource {
00062 public:
00063
00065 TGo4MbsSource();
00066
00067 TGo4MbsSource(const char* name, Int_t mode);
00068
00069 TGo4MbsSource(TGo4MbsSourceParameter* par, Int_t mode);
00070
00071 virtual ~TGo4MbsSource();
00072
00074 virtual Bool_t CheckEventClass(TClass* cl);
00075
00077 virtual Bool_t BuildEvent(TGo4EventElement* dest);
00078
00080 virtual Int_t Close();
00081
00083 virtual Int_t Open();
00084
00086 virtual Int_t NextEvent();
00087
00093 void BuildMbsEvent(TGo4MbsEvent * target);
00094
00098 TGo4MbsSubEvent* BuildMbsSubEvent(TGo4MbsEvent * target, Int_t fullID, Short_t* source, Int_t datalength);
00099
00101 void SetStartEvent(UInt_t firstindex) { fuStartEvent=firstindex; }
00102
00103 void SetStopEvent(UInt_t lastindex) { fuStopEvent=lastindex; }
00104
00105 void SetEventInterval(UInt_t skipinterval) { fuEventInterval=skipinterval; }
00106
00107 void SetTimeout(Int_t time) { fiTimeout=time; }
00108
00109 void SetPort(Int_t port) { fiPort=port; }
00110
00112 s_filhe * GetInfoHeader() { return fxInfoHeader; }
00113
00115 virtual s_bufhe * GetBufferHeader();
00116
00118 static const UInt_t fguLONGBYCHAR;
00119
00121 static const UInt_t fguSHORTBYCHAR;
00122
00124 static const UInt_t fguLONGBYSHORT;
00125
00127 static const UInt_t fguEVHEBYCHAR;
00128
00133 void SetPrintEvent(Int_t num=1, Int_t sid=-1, Int_t longw=1, Int_t hexw=1, Int_t dataw=0);
00134
00135 void SetDataCopyMode(Bool_t on) { fbDataCopyMode=on; }
00136
00137 private:
00138
00140 Int_t fiMode;
00141
00142 Int_t fiRetryCnt;
00143
00144 Int_t GetMode() const { return fiMode; }
00145
00146 protected:
00147
00149 s_evt_channel* fxInputChannel;
00150
00151 s_ve10_1* fxEvent;
00152
00154 s_bufhe * fxBuffer;
00155
00157 s_filhe * fxInfoHeader;
00158
00159 Bool_t fbIsOpen;
00160
00164 Bool_t fbDataCopyMode;
00165
00167 ULong_t fuEventCounter;
00168
00170 Bool_t fbFirstEvent;
00171
00173 ULong_t fuStartEvent;
00174
00176 ULong_t fuStopEvent;
00177
00179 ULong_t fuEventInterval;
00180
00182 Int_t fiTimeout;
00183
00185 Int_t fiPort;
00186
00188 TGo4MbsSourcePrintPar fxPrEventPar;
00189
00190 ClassDef(TGo4MbsSource, 3)
00191
00192 };
00193
00194 #endif //TGO4MBSSOURCE_H