GSI Object Oriented Online Offline (Go4)  GO4-6.1.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TGo4MbsSource.h
Go to the documentation of this file.
1 // $Id: TGo4MbsSource.h 3346 2021-10-18 14:00:53Z linev $
2 //-----------------------------------------------------------------------
3 // The GSI Online Offline Object Oriented (Go4) Project
4 // Experiment Data Processing at EE department, GSI
5 //-----------------------------------------------------------------------
6 // Copyright (C) 2000- GSI Helmholtzzentrum fuer Schwerionenforschung GmbH
7 // Planckstr. 1, 64291 Darmstadt, Germany
8 // Contact: http://go4.gsi.de
9 //-----------------------------------------------------------------------
10 // This software can be used under the license agreements as stated
11 // in Go4License.txt file which is part of the distribution.
12 //-----------------------------------------------------------------------
13 
14 #ifndef TGO4MBSSOURCE_H
15 #define TGO4MBSSOURCE_H
16 
17 #include "TGo4EventSource.h"
18 
19 #ifdef __CINT__
20 
21 struct s_filhe;
22 struct s_bufhe;
23 struct s_evt_channel;
24 struct s_ve10_1;
25 
26 #else
27 
28 extern "C" {
29  #include "f_evt.h"
30  #include "s_filhe.h"
31  #include "s_bufhe.h"
32 }
33 
34 #endif
35 
36 class TGo4MbsEvent;
37 class TGo4MbsSubEvent;
39 
41 class TGo4MbsSourcePrintPar : public TObject {
42 
43  public:
44  TGo4MbsSourcePrintPar() : TObject(), fiNum(0), fiSid(0), fiLong(0), fiHex(0), fiData(0) {}
47  Int_t fiNum;
49  Int_t fiSid;
51  Int_t fiLong;
53  Int_t fiHex;
55  Int_t fiData;
56  ClassDef(TGo4MbsSourcePrintPar, 1)
57 };
58 
59 
61  public:
62 
64  TGo4MbsSource();
65 
66  TGo4MbsSource(const char* name, Int_t mode);
67 
68  TGo4MbsSource(TGo4MbsSourceParameter* par, Int_t mode);
69 
70  virtual ~TGo4MbsSource();
71 
73  virtual Bool_t CheckEventClass(TClass* cl);
74 
76  virtual Bool_t BuildEvent(TGo4EventElement* dest);
77 
79  virtual Int_t Close();
80 
82  virtual Int_t Open();
83 
85  virtual Int_t NextEvent();
86 
92  void BuildMbsEvent(TGo4MbsEvent * target);
93 
97  TGo4MbsSubEvent* BuildMbsSubEvent(TGo4MbsEvent * target, Int_t fullID, Short_t* source, Int_t datalength);
98 
100  void SetStartEvent(UInt_t firstindex) { fuStartEvent=firstindex; }
101 
102  void SetStopEvent(UInt_t lastindex) { fuStopEvent=lastindex; }
103 
104  void SetEventInterval(UInt_t skipinterval) { fuEventInterval=skipinterval; }
105 
106  void SetTimeout(Int_t time) { fiTimeout=time; }
107 
108  void SetPort(Int_t port) { fiPort=port; }
109 
112 
114  virtual s_bufhe * GetBufferHeader();
115 
117  static const UInt_t fguLONGBYCHAR;
118 
120  static const UInt_t fguSHORTBYCHAR;
121 
123  static const UInt_t fguLONGBYSHORT;
124 
126  static const UInt_t fguEVHEBYCHAR;
127 
132  void SetPrintEvent(Int_t num=1, Int_t sid=-1, Int_t longw=1, Int_t hexw=1, Int_t dataw=0);
133 
134  void SetDataCopyMode(Bool_t on) { fbDataCopyMode = on; }
135 
136  static void SetPollingMode(Bool_t on = kTRUE);
137 
138  private:
139 
141  Int_t fiMode;
142 
143  Int_t fiRetryCnt;
144 
145  Int_t GetMode() const { return fiMode; }
146 
147  protected:
148 
151 
153 
156 
159 
160  Bool_t fbIsOpen;
161 
166 
168  ULong_t fuEventCounter;
169 
171  Bool_t fbFirstEvent;
172 
174  ULong_t fuStartEvent;
175 
177  ULong_t fuStopEvent;
178 
181 
183  Int_t fiTimeout;
184 
185  Bool_t fbPollingMode;
186 
188  Int_t fiPort;
189 
192 
193  static Bool_t gbPollingMode;
194 
195  ClassDef(TGo4MbsSource, 3)
196 
197 };
198 
199 #endif //TGO4MBSSOURCE_H
virtual ~TGo4MbsSourcePrintPar()
Definition: TGo4MbsSource.h:45
s_evt_channel * fxInputChannel
void SetStopEvent(UInt_t lastindex)
static Bool_t gbPollingMode
void SetEventInterval(UInt_t skipinterval)
s_filhe * fxInfoHeader
Bool_t fbPollingMode
Bool_t fbDataCopyMode
virtual Bool_t CheckEventClass(TClass *cl)
virtual ~TGo4MbsSource()
ULong_t fuEventCounter
ULong_t fuEventInterval
virtual Int_t NextEvent()
void BuildMbsEvent(TGo4MbsEvent *target)
Int_t GetMode() const
number of allowed reconnect retries
void SetTimeout(Int_t time)
s_filhe * GetInfoHeader()
void SetStartEvent(UInt_t firstindex)
static void SetPollingMode(Bool_t on=kTRUE)
s_bufhe * fxBuffer
static const UInt_t fguLONGBYCHAR
static const UInt_t fguSHORTBYCHAR
virtual Int_t Close()
s_ve10_1 * fxEvent
static const UInt_t fguEVHEBYCHAR
Bool_t fbFirstEvent
virtual Int_t Open()
ULong_t fuStartEvent
void SetPrintEvent(Int_t num=1, Int_t sid=-1, Int_t longw=1, Int_t hexw=1, Int_t dataw=0)
virtual Bool_t BuildEvent(TGo4EventElement *dest)
ULong_t fuStopEvent
virtual s_bufhe * GetBufferHeader()
TGo4MbsSubEvent * BuildMbsSubEvent(TGo4MbsEvent *target, Int_t fullID, Short_t *source, Int_t datalength)
TGo4MbsSourcePrintPar fxPrEventPar
static const UInt_t fguLONGBYSHORT
void SetDataCopyMode(Bool_t on)
void SetPort(Int_t port)
Int_t fiPort
if true, use short timeout to keep gSystem->ProcessEvents() running