GSI Object Oriented Online Offline (Go4) GO4-6.4.0
Loading...
Searching...
No Matches
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
19extern "C" {
20 #include "f_evt.h"
21 #include "s_filhe.h"
22 #include "s_bufhe.h"
23}
24
25class TGo4MbsEvent;
26class TGo4MbsSubEvent;
28
32class TGo4MbsSourcePrintPar : public TObject {
33
34 public:
35 TGo4MbsSourcePrintPar() : TObject() {}
38 Int_t fiNum{0};
40 Int_t fiSid{0};
42 Int_t fiLong{0};
44 Int_t fiHex{0};
46 Int_t fiData{0};
47 ClassDefOverride(TGo4MbsSourcePrintPar, 1)
48};
49
53
55 public:
56
59
60 TGo4MbsSource(const char *name, Int_t mode);
61
62 TGo4MbsSource(TGo4MbsSourceParameter *par, Int_t mode);
63
64 virtual ~TGo4MbsSource();
65
67 Bool_t CheckEventClass(TClass *cl) override;
68
70 Bool_t BuildEvent(TGo4EventElement *dest) override;
71
73 virtual Int_t Close();
74
76 virtual Int_t Open();
77
79 virtual Int_t NextEvent();
80
86 void BuildMbsEvent(TGo4MbsEvent *target);
87
91 TGo4MbsSubEvent *BuildMbsSubEvent(TGo4MbsEvent *target, Int_t fullID, Short_t *source, Int_t datalength);
92
94 void SetStartEvent(UInt_t firstindex) { fuStartEvent = firstindex; }
95
96 void SetStopEvent(UInt_t lastindex) { fuStopEvent = lastindex; }
97
98 void SetEventInterval(UInt_t skipinterval) { fuEventInterval = skipinterval; }
99
100 void SetTimeout(Int_t time) { fiTimeout = time; }
101
102 void SetPort(Int_t port) { fiPort = port; }
103
105 s_filhe *GetInfoHeader() const { return fxInfoHeader; }
106
108 virtual s_bufhe *GetBufferHeader();
109
111 static const UInt_t fguLONGBYCHAR;
112
114 static const UInt_t fguSHORTBYCHAR;
115
117 static const UInt_t fguLONGBYSHORT;
118
120 static const UInt_t fguEVHEBYCHAR;
121
126 void SetPrintEvent(Int_t num = 1, Int_t sid = -1, Int_t longw = 1, Int_t hexw = 1, Int_t dataw = 0);
127
128 void SetDataCopyMode(Bool_t on) { fbDataCopyMode = on; }
129
130 static void SetPollingMode(Bool_t on = kTRUE);
131
132 private:
133
135 Int_t fiMode{0};
136
137 Int_t fiRetryCnt{0};
138
139 Int_t GetMode() const { return fiMode; }
140
141 protected:
142
145
146 s_ve10_1 *fxEvent{nullptr};
147
149 s_bufhe *fxBuffer{nullptr};
150
153
154 Bool_t fbIsOpen{kFALSE};
155
159 Bool_t fbDataCopyMode{kFALSE};
160
162 ULong_t fuEventCounter{0};
163
165 Bool_t fbFirstEvent{kFALSE};
166
168 ULong_t fuStartEvent{0};
169
171 ULong_t fuStopEvent{0};
172
174 ULong_t fuEventInterval{0};
175
177 Int_t fiTimeout{0};
178
179 Bool_t fbPollingMode{kFALSE};
180
182 Int_t fiPort{0};
183
186
187 static Bool_t gbPollingMode;
188
189 ClassDefOverride(TGo4MbsSource, 3)
190
191};
192
193#endif //TGO4MBSSOURCE_H
The abstract base class for the data elements of which the unpacked events (or detector structure dat...
Wrapper for the standard gsi event structure as delivered from mbs.
data structure to keep parameters for f_evt_type (SetPrintEvent)
Int_t fiLong
output longwords
Int_t fiSid
subevent id (-1 is all)
virtual ~TGo4MbsSourcePrintPar()
Int_t fiHex
output hex longwords
Int_t fiNum
Counter for events to be printed.
Int_t fiData
output data
Int_t fiMode
Mode of operation.
Bool_t BuildEvent(TGo4EventElement *dest) override
Fill the destination event.
void SetPort(Int_t port)
static void SetPollingMode(Bool_t on=kTRUE)
virtual ~TGo4MbsSource()
s_evt_channel * fxInputChannel
Event channel structure used by event source.
void SetEventInterval(UInt_t skipinterval)
Bool_t fbDataCopyMode
switches buildmbs event mode: if true, data buffer is copied to own buffer of subevent.
Bool_t CheckEventClass(TClass *cl) override
Check that filled event is a proper class.
static const UInt_t fguSHORTBYCHAR
ratio sizeof(short) by sizeof(char).
ULong_t fuStopEvent
Index of last event to process.
Int_t fiTimeout
Timeout in seconds for mbs getevent.
s_filhe * GetInfoHeader() const
User access to info header.
void SetPrintEvent(Int_t num=1, Int_t sid=-1, Int_t longw=1, Int_t hexw=1, Int_t dataw=0)
Set mbs source into printout (verbose) mode for the next num events.
ULong_t fuStartEvent
Index of first event to process.
virtual s_bufhe * GetBufferHeader()
User access to current event buffer header.
TGo4MbsSubEvent * BuildMbsSubEvent(TGo4MbsEvent *target, Int_t fullID, Short_t *source, Int_t datalength)
Auxiliary function to fill datalength words (Short_t) from source into the next subevent of target wi...
void SetStartEvent(UInt_t firstindex)
Define the Start index for the NextEvent.
s_ve10_1 * fxEvent
Bool_t fbFirstEvent
Indicates if first event should be extracted.
virtual Int_t Close()
Close the file or connection.
void BuildMbsEvent(TGo4MbsEvent *target)
This methods actually fills the target event class which is passed as pointer.
virtual Int_t NextEvent()
Requests the next event from mbs source.
static const UInt_t fguEVHEBYCHAR
ratio sizeof(s_evhe) by sizeof(char).
TGo4MbsSourcePrintPar fxPrEventPar
This structure keeps parameters for printevent mode.
ULong_t fuEventCounter
Current event index counter.
TGo4MbsSource()
default for streamer
static const UInt_t fguLONGBYCHAR
ratio sizeof(long) by sizeof(char).
void SetTimeout(Int_t time)
void SetStopEvent(UInt_t lastindex)
static const UInt_t fguLONGBYSHORT
ratio sizeof(long) by sizeof(short).
ULong_t fuEventInterval
Number of events to skip from file in between two read events.
void SetDataCopyMode(Bool_t on)
s_filhe * fxInfoHeader
Reference to header info delivered by source.
s_bufhe * fxBuffer
Points to the current gsi buffer structure filled by the event source.
Int_t GetMode() const
number of allowed reconnect retries
Int_t fiPort
if true, use short timeout to keep gSystem->ProcessEvents() running
static Bool_t gbPollingMode
virtual Int_t Open()
Open the file or connection.
Subevent class for gsi mbs data.