00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016 #ifndef TGO4MBSSOURCE_H
00017 #define TGO4MBSSOURCE_H
00018
00019 #include "Go4Event/TGo4EventSource.h"
00020
00021 extern "C"
00022 {
00023 #include "MbsAPI/typedefs.h"
00024 #include "MbsAPI/s_filhe_swap.h"
00025 #include "MbsAPI/s_bufhe_swap.h"
00026 #include "MbsAPI/s_ve10_1_swap.h"
00027 #include "MbsAPI/s_ves10_1_swap.h"
00028 #include "MbsAPI/s_evhe_swap.h"
00029 #include "MbsAPI/f_evt.h"
00030 }
00031
00032 class TGo4MbsEvent;
00033
00035 class TGo4MbsSourcePrintPar {
00036
00037 public:
00038 TGo4MbsSourcePrintPar():fiNum(0), fiSid(0), fiLong(0),fiHex(0), fiData(0){}
00039 virtual ~TGo4MbsSourcePrintPar(){}
00041 Int_t fiNum;
00043 Int_t fiSid;
00045 Int_t fiLong;
00047 Int_t fiHex;
00049 Int_t fiData;
00050 ClassDef(TGo4MbsSourcePrintPar, 1)
00051 };
00052
00053
00054 class TGo4MbsSource : public TGo4EventSource {
00055 public:
00056
00058 TGo4MbsSource();
00059
00060 TGo4MbsSource(const char* name, Int_t mode);
00061
00062 virtual ~TGo4MbsSource();
00063
00065 virtual Int_t Close();
00066
00068 virtual Int_t Open();
00069
00071 virtual Int_t NextEvent();
00072
00078 void BuildMbsEvent(TGo4MbsEvent * target);
00079
00081 void SetStartEvent(UInt_t firstindex) { fuStartEvent=firstindex; }
00082
00083 void SetStopEvent(UInt_t lastindex) { fuStopEvent=lastindex; }
00084
00085 void SetEventInterval(UInt_t skipinterval) { fuEventInterval=skipinterval; }
00086
00087 void SetTimeout(Int_t time) { fiTimeout=time; }
00088
00090 s_filhe * GetInfoHeader() { return fxInfoHeader; }
00091
00093 virtual s_bufhe * GetBufferHeader();
00094
00096 static const UInt_t fguLONGBYCHAR;
00097
00099 static const UInt_t fguSHORTBYCHAR;
00100
00102 static const UInt_t fguLONGBYSHORT;
00103
00105 static const UInt_t fguEVHEBYCHAR;
00106
00111 void SetPrintEvent(Int_t num=1, Int_t sid=-1, Int_t longw=1, Int_t hexw=1, Int_t dataw=0);
00112
00113 void SetDataCopyMode(Bool_t on) { fbDataCopyMode=on; }
00114
00115 private:
00116
00118 Int_t fiMode;
00119
00120 protected:
00121
00123 s_evt_channel fxInputChannel;
00124
00125 s_ve10_1* fxEvent;
00126
00128 s_bufhe * fxBuffer;
00129
00131 s_filhe * fxInfoHeader;
00132
00133 Bool_t fbIsOpen;
00134
00138 Bool_t fbDataCopyMode;
00139
00141 UInt_t fuEventCounter;
00142
00144 UInt_t fuStartEvent;
00145
00147 UInt_t fuStopEvent;
00148
00150 UInt_t fuEventInterval;
00151
00153 Int_t fiTimeout;
00154
00156 TGo4MbsSourcePrintPar fxPrEventPar;
00157
00158 ClassDef(TGo4MbsSource, 1)
00159
00160 };
00161
00162 #endif //TGO4MBSSOURCE_H
00163
00164