GSI Object Oriented Online Offline (Go4)  GO4-6.3.0
TGo4MbsSource.h
Go to the documentation of this file.
1 // $Id$
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() {}
47  Int_t fiNum{0};
49  Int_t fiSid{0};
51  Int_t fiLong{0};
53  Int_t fiHex{0};
55  Int_t fiData{0};
56  ClassDefOverride(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  Bool_t CheckEventClass(TClass *cl) override;
74 
76  Bool_t BuildEvent(TGo4EventElement *dest) override;
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 
111  s_filhe *GetInfoHeader() const { return fxInfoHeader; }
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{0};
142 
143  Int_t fiRetryCnt{0};
144 
145  Int_t GetMode() const { return fiMode; }
146 
147  protected:
148 
150  s_evt_channel *fxInputChannel{nullptr};
151 
152  s_ve10_1 *fxEvent{nullptr};
153 
155  s_bufhe *fxBuffer{nullptr};
156 
158  s_filhe *fxInfoHeader{nullptr};
159 
160  Bool_t fbIsOpen{kFALSE};
161 
165  Bool_t fbDataCopyMode{kFALSE};
166 
168  ULong_t fuEventCounter{0};
169 
171  Bool_t fbFirstEvent{kFALSE};
172 
174  ULong_t fuStartEvent{0};
175 
177  ULong_t fuStopEvent{0};
178 
180  ULong_t fuEventInterval{0};
181 
183  Int_t fiTimeout{0};
184 
185  Bool_t fbPollingMode{kFALSE};
186 
188  Int_t fiPort{0};
189 
192 
193  static Bool_t gbPollingMode;
194 
195  ClassDefOverride(TGo4MbsSource, 3)
196 
197 };
198 
199 #endif //TGO4MBSSOURCE_H
virtual ~TGo4MbsSourcePrintPar()
Definition: TGo4MbsSource.h:45
void SetStopEvent(UInt_t lastindex)
static Bool_t gbPollingMode
void SetEventInterval(UInt_t skipinterval)
s_filhe * GetInfoHeader() const
void SetTimeout(Int_t time)
void SetStartEvent(UInt_t firstindex)
static const UInt_t fguLONGBYCHAR
static const UInt_t fguSHORTBYCHAR
static const UInt_t fguEVHEBYCHAR
Int_t GetMode() const
number of allowed reconnect retries
TGo4MbsSourcePrintPar fxPrEventPar
static const UInt_t fguLONGBYSHORT
void SetDataCopyMode(Bool_t on)
void SetPort(Int_t port)