GSI Object Oriented Online Offline (Go4) GO4-6.4.0
Loading...
Searching...
No Matches
TGo4MbsSource Class Reference

Generic MBS source. More...

#include <TGo4MbsSource.h>

+ Inheritance diagram for TGo4MbsSource:

Public Member Functions

 TGo4MbsSource ()
 default for streamer
 
 TGo4MbsSource (const char *name, Int_t mode)
 
 TGo4MbsSource (TGo4MbsSourceParameter *par, Int_t mode)
 
virtual ~TGo4MbsSource ()
 
Bool_t BuildEvent (TGo4EventElement *dest) override
 Fill the destination event.
 
void BuildMbsEvent (TGo4MbsEvent *target)
 This methods actually fills the target event class which is passed as pointer.
 
TGo4MbsSubEventBuildMbsSubEvent (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 with matching header fullID longword.
 
Bool_t CheckEventClass (TClass *cl) override
 Check that filled event is a proper class.
 
virtual Int_t Close ()
 Close the file or connection.
 
virtual s_bufheGetBufferHeader ()
 User access to current event buffer header.
 
s_filheGetInfoHeader () const
 User access to info header.
 
virtual Int_t NextEvent ()
 Requests the next event from mbs source.
 
virtual Int_t Open ()
 Open the file or connection.
 
void SetDataCopyMode (Bool_t on)
 
void SetEventInterval (UInt_t skipinterval)
 
void SetPort (Int_t port)
 
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.
 
void SetStartEvent (UInt_t firstindex)
 Define the Start index for the NextEvent.
 
void SetStopEvent (UInt_t lastindex)
 
void SetTimeout (Int_t time)
 
- Public Member Functions inherited from TGo4EventSource
 TGo4EventSource ()
 
 TGo4EventSource (const char *name)
 
virtual ~TGo4EventSource ()
 
void Clear (Option_t *opt="") override
 
virtual const char * GetActiveName () const
 Access to the name of the currently active source.
 
Int_t GetCreateStatus () const
 Status value of server/file open.
 
const char * GetErrMess () const
 Status/ error message of the last event.
 
Int_t GetEventStatus () const
 Status of the last event.
 

Static Public Member Functions

static void SetPollingMode (Bool_t on=kTRUE)
 

Static Public Attributes

static const UInt_t fguEVHEBYCHAR = sizeof(s_evhe) / sizeof(Char_t)
 ratio sizeof(s_evhe) by sizeof(char).
 
static const UInt_t fguLONGBYCHAR = sizeof(Int_t) / sizeof(Char_t)
 ratio sizeof(long) by sizeof(char).
 
static const UInt_t fguLONGBYSHORT = sizeof(Int_t) / sizeof(Short_t)
 ratio sizeof(long) by sizeof(short).
 
static const UInt_t fguSHORTBYCHAR = sizeof(Short_t) / sizeof(Char_t)
 ratio sizeof(short) by sizeof(char).
 
- Static Public Attributes inherited from TGo4EventSource
static const Int_t fgiTIMEOUTDEFAULT =1
 Default timeout in seconds for event input.
 

Protected Attributes

Bool_t fbDataCopyMode {kFALSE}
 switches buildmbs event mode: if true, data buffer is copied to own buffer of subevent.
 
Bool_t fbFirstEvent {kFALSE}
 Indicates if first event should be extracted.
 
Bool_t fbIsOpen {kFALSE}
 
Bool_t fbPollingMode {kFALSE}
 
Int_t fiPort {0}
 if true, use short timeout to keep gSystem->ProcessEvents() running
 
Int_t fiTimeout {0}
 Timeout in seconds for mbs getevent.
 
ULong_t fuEventCounter {0}
 Current event index counter.
 
ULong_t fuEventInterval {0}
 Number of events to skip from file in between two read events.
 
ULong_t fuStartEvent {0}
 Index of first event to process.
 
ULong_t fuStopEvent {0}
 Index of last event to process.
 
s_bufhefxBuffer {nullptr}
 Points to the current gsi buffer structure filled by the event source.
 
s_ve10_1fxEvent {nullptr}
 
s_filhefxInfoHeader {nullptr}
 Reference to header info delivered by source.
 
s_evt_channelfxInputChannel {nullptr}
 Event channel structure used by event source.
 
TGo4MbsSourcePrintPar fxPrEventPar
 This structure keeps parameters for printevent mode.
 

Static Protected Attributes

static Bool_t gbPollingMode = kFALSE
 

Private Member Functions

Int_t GetMode () const
 number of allowed reconnect retries
 

Private Attributes

Int_t fiMode {0}
 Mode of operation.
 
Int_t fiRetryCnt {0}
 

Additional Inherited Members

- Protected Types inherited from TGo4EventSource
enum  { fguTXTLEN = 256 }
 text length More...
 
- Protected Member Functions inherited from TGo4EventSource
void SetCreateStatus (Int_t status)
 Status value of event source init (file/server open).
 
void SetErrMess (const char *txt)
 To be used for modification of the message by the event source implementation.
 
void SetEventStatus (Int_t status)
 Status of the last event.
 
void ThrowEOF (Int_t creastat, Int_t errstat, const char *message,...)
 EOF thrower.
 
void ThrowError (Int_t creastat, Int_t errstat, const char *message,...)
 Exception thrower.
 

Detailed Description

Generic MBS source.

Definition at line 54 of file TGo4MbsSource.h.

Constructor & Destructor Documentation

◆ TGo4MbsSource() [1/3]

◆ TGo4MbsSource() [2/3]

◆ TGo4MbsSource() [3/3]

◆ ~TGo4MbsSource()

TGo4MbsSource::~TGo4MbsSource ( )
virtual

Definition at line 91 of file TGo4MbsSource.cxx.

References Close(), fxInputChannel, and GO4TRACE.

Member Function Documentation

◆ BuildEvent()

Bool_t TGo4MbsSource::BuildEvent ( TGo4EventElement * dest)
overridevirtual

Fill the destination event.

Parameters
dest

Reimplemented from TGo4EventSource.

Definition at line 117 of file TGo4MbsSource.cxx.

References BuildMbsEvent(), TGo4Log::Debug(), TGo4EventSource::GetErrMess(), GETEVT__SUCCESS, and NextEvent().

◆ BuildMbsEvent()

void TGo4MbsSource::BuildMbsEvent ( TGo4MbsEvent * target)

This methods actually fills the target event class which is passed as pointer.

Uses the latest event which is referenced by fxEvent or fxBuffer. Does not fetch a new event from source, therefore one source event may be used to fill several TGo4MbsEvent classes. To get a new event call NextEvent() before this method.

Definition at line 130 of file TGo4MbsSource.cxx.

References TGo4MbsEvent::AddSubEvent(), TGo4Log::Debug(), f_evt_type(), fbDataCopyMode, fguEVHEBYCHAR, fguSHORTBYCHAR, fxBuffer, fxEvent, fxPrEventPar, TGo4EventSource::GetErrMess(), TGo4EventSource::GetEventStatus(), GETEVT__SUCCESS, GO4TRACE, s_ves10_1::i_subtype, s_ves10_1::i_type, s_evhe::l_dlen, s_ves10_1::l_dlen, TGo4MbsEvent::SetCount(), TGo4MbsEvent::SetDlen(), TGo4MbsEvent::SetDummy(), TGo4EventSource::SetErrMess(), TGo4MbsEvent::SetSubtype(), TGo4MbsSubEvent::SetSubtype(), TGo4MbsEvent::SetTrigger(), TGo4MbsEvent::SetType(), TGo4MbsSubEvent::SetType(), and TGo4EventElement::SetValid().

Referenced by BuildEvent().

◆ BuildMbsSubEvent()

TGo4MbsSubEvent * TGo4MbsSource::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 with matching header fullID longword.

Returns handle to this subevent.

Definition at line 243 of file TGo4MbsSource.cxx.

References TGo4MbsEvent::AddSubEvent(), and fbDataCopyMode.

◆ CheckEventClass()

Bool_t TGo4MbsSource::CheckEventClass ( TClass * cl)
overridevirtual

Check that filled event is a proper class.

Reimplemented from TGo4EventSource.

Definition at line 112 of file TGo4MbsSource.cxx.

◆ Close()

◆ GetBufferHeader()

s_bufhe * TGo4MbsSource::GetBufferHeader ( )
virtual

User access to current event buffer header.

Reimplemented in TGo4MbsRandom.

Definition at line 419 of file TGo4MbsSource.cxx.

References f_evt_get_buffer_ptr(), and fxInputChannel.

Referenced by TGo4MbsEvent::GetMbsBufferHeader().

◆ GetInfoHeader()

s_filhe * TGo4MbsSource::GetInfoHeader ( ) const
inline

User access to info header.

May contain additional run information

Definition at line 105 of file TGo4MbsSource.h.

References fxInfoHeader.

Referenced by TGo4MbsEvent::GetMbsSourceHeader().

◆ GetMode()

Int_t TGo4MbsSource::GetMode ( ) const
inlineprivate

number of allowed reconnect retries

Definition at line 139 of file TGo4MbsSource.h.

References fiMode.

Referenced by Open().

◆ NextEvent()

◆ Open()

◆ SetDataCopyMode()

void TGo4MbsSource::SetDataCopyMode ( Bool_t on)
inline

Definition at line 128 of file TGo4MbsSource.h.

References fbDataCopyMode.

◆ SetEventInterval()

void TGo4MbsSource::SetEventInterval ( UInt_t skipinterval)
inline

Definition at line 98 of file TGo4MbsSource.h.

References fuEventInterval.

◆ SetPollingMode()

void TGo4MbsSource::SetPollingMode ( Bool_t on = kTRUE)
static

Definition at line 98 of file TGo4MbsSource.cxx.

References gbPollingMode.

Referenced by main().

◆ SetPort()

void TGo4MbsSource::SetPort ( Int_t port)
inline

Definition at line 102 of file TGo4MbsSource.h.

References fiPort.

◆ SetPrintEvent()

void TGo4MbsSource::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.

Subevent id sid may be specific (-1 is all subevents). Parameters longw, hexw, dataw switch output data formats. See MbsAPI function f_evt_type().

Definition at line 103 of file TGo4MbsSource.cxx.

References fxPrEventPar.

Referenced by TGo4ComSetPrintEvent::ExeCom(), and TGo4MbsEvent::SetPrintEvent().

◆ SetStartEvent()

void TGo4MbsSource::SetStartEvent ( UInt_t firstindex)
inline

Define the Start index for the NextEvent.

Definition at line 94 of file TGo4MbsSource.h.

References fuStartEvent.

◆ SetStopEvent()

void TGo4MbsSource::SetStopEvent ( UInt_t lastindex)
inline

Definition at line 96 of file TGo4MbsSource.h.

References fuStopEvent.

◆ SetTimeout()

void TGo4MbsSource::SetTimeout ( Int_t time)
inline

Definition at line 100 of file TGo4MbsSource.h.

References fiTimeout.

Referenced by TGo4MbsSource().

Field Documentation

◆ fbDataCopyMode

Bool_t TGo4MbsSource::fbDataCopyMode {kFALSE}
protected

switches buildmbs event mode: if true, data buffer is copied to own buffer of subevent.

If false (default), mbs subevent uses reference to external data buffer of eventapi.

Definition at line 159 of file TGo4MbsSource.h.

Referenced by TGo4MbsSource(), TGo4MbsSource(), TGo4MbsSource(), BuildMbsEvent(), BuildMbsSubEvent(), and SetDataCopyMode().

◆ fbFirstEvent

Bool_t TGo4MbsSource::fbFirstEvent {kFALSE}
protected

Indicates if first event should be extracted.

Definition at line 165 of file TGo4MbsSource.h.

Referenced by TGo4MbsSource(), TGo4MbsSource(), TGo4MbsSource(), TGo4MbsFile::NextEvent(), NextEvent(), and TGo4MbsFile::OpenFile().

◆ fbIsOpen

Bool_t TGo4MbsSource::fbIsOpen {kFALSE}
protected

◆ fbPollingMode

Bool_t TGo4MbsSource::fbPollingMode {kFALSE}
protected

Definition at line 179 of file TGo4MbsSource.h.

Referenced by TGo4MbsSource(), TGo4MbsSource(), TGo4MbsSource(), NextEvent(), and Open().

◆ fguEVHEBYCHAR

const UInt_t TGo4MbsSource::fguEVHEBYCHAR = sizeof(s_evhe) / sizeof(Char_t)
static

ratio sizeof(s_evhe) by sizeof(char).

Definition at line 120 of file TGo4MbsSource.h.

Referenced by BuildMbsEvent().

◆ fguLONGBYCHAR

const UInt_t TGo4MbsSource::fguLONGBYCHAR = sizeof(Int_t) / sizeof(Char_t)
static

ratio sizeof(long) by sizeof(char).

Definition at line 111 of file TGo4MbsSource.h.

◆ fguLONGBYSHORT

const UInt_t TGo4MbsSource::fguLONGBYSHORT = sizeof(Int_t) / sizeof(Short_t)
static

ratio sizeof(long) by sizeof(short).

Definition at line 117 of file TGo4MbsSource.h.

Referenced by TGo4MbsSubEvent::Clear().

◆ fguSHORTBYCHAR

const UInt_t TGo4MbsSource::fguSHORTBYCHAR = sizeof(Short_t) / sizeof(Char_t)
static

ratio sizeof(short) by sizeof(char).

Definition at line 114 of file TGo4MbsSource.h.

Referenced by BuildMbsEvent().

◆ fiMode

Int_t TGo4MbsSource::fiMode {0}
private

Mode of operation.

Definition at line 135 of file TGo4MbsSource.h.

Referenced by TGo4MbsSource(), TGo4MbsSource(), TGo4MbsSource(), GetMode(), NextEvent(), and Open().

◆ fiPort

Int_t TGo4MbsSource::fiPort {0}
protected

if true, use short timeout to keep gSystem->ProcessEvents() running

Optional port parameter, if non-positive default port number for transport will be used

Definition at line 182 of file TGo4MbsSource.h.

Referenced by TGo4MbsSource(), TGo4MbsSource(), TGo4MbsSource(), Open(), and SetPort().

◆ fiRetryCnt

Int_t TGo4MbsSource::fiRetryCnt {0}
private

Definition at line 137 of file TGo4MbsSource.h.

Referenced by TGo4MbsSource(), TGo4MbsSource(), TGo4MbsSource(), and NextEvent().

◆ fiTimeout

Int_t TGo4MbsSource::fiTimeout {0}
protected

Timeout in seconds for mbs getevent.

If -1, no timeout (default)

Definition at line 177 of file TGo4MbsSource.h.

Referenced by TGo4MbsSource(), TGo4MbsSource(), TGo4MbsSource(), Open(), and SetTimeout().

◆ fuEventCounter

ULong_t TGo4MbsSource::fuEventCounter {0}
protected

Current event index counter.

Definition at line 162 of file TGo4MbsSource.h.

Referenced by TGo4MbsSource(), TGo4MbsSource(), TGo4MbsSource(), TGo4MbsFile::NextEvent(), NextEvent(), and TGo4MbsFile::NextFile().

◆ fuEventInterval

ULong_t TGo4MbsSource::fuEventInterval {0}
protected

Number of events to skip from file in between two read events.

Definition at line 174 of file TGo4MbsSource.h.

Referenced by TGo4MbsSource(), TGo4MbsSource(), TGo4MbsSource(), TGo4MbsFile::NextEvent(), NextEvent(), TGo4MbsFile::NextFile(), and SetEventInterval().

◆ fuStartEvent

ULong_t TGo4MbsSource::fuStartEvent {0}
protected

Index of first event to process.

Definition at line 168 of file TGo4MbsSource.h.

Referenced by TGo4MbsSource(), TGo4MbsSource(), TGo4MbsSource(), TGo4MbsFile::NextEvent(), NextEvent(), TGo4MbsFile::NextFile(), and SetStartEvent().

◆ fuStopEvent

ULong_t TGo4MbsSource::fuStopEvent {0}
protected

Index of last event to process.

Definition at line 171 of file TGo4MbsSource.h.

Referenced by TGo4MbsSource(), TGo4MbsSource(), TGo4MbsSource(), TGo4MbsFile::NextEvent(), NextEvent(), TGo4MbsFile::NextFile(), and SetStopEvent().

◆ fxBuffer

s_bufhe* TGo4MbsSource::fxBuffer {nullptr}
protected

Points to the current gsi buffer structure filled by the event source.

Definition at line 149 of file TGo4MbsSource.h.

Referenced by TGo4MbsSource(), TGo4MbsSource(), TGo4MbsSource(), BuildMbsEvent(), and NextEvent().

◆ fxEvent

◆ fxInfoHeader

s_filhe* TGo4MbsSource::fxInfoHeader {nullptr}
protected

Reference to header info delivered by source.

Definition at line 152 of file TGo4MbsSource.h.

Referenced by TGo4MbsSource(), TGo4MbsSource(), TGo4MbsSource(), GetInfoHeader(), Open(), and TGo4MbsFile::OpenFile().

◆ fxInputChannel

s_evt_channel* TGo4MbsSource::fxInputChannel {nullptr}
protected

◆ fxPrEventPar

TGo4MbsSourcePrintPar TGo4MbsSource::fxPrEventPar
protected

This structure keeps parameters for printevent mode.

Definition at line 185 of file TGo4MbsSource.h.

Referenced by BuildMbsEvent(), and SetPrintEvent().

◆ gbPollingMode

Bool_t TGo4MbsSource::gbPollingMode = kFALSE
staticprotected

Definition at line 187 of file TGo4MbsSource.h.

Referenced by Open(), and SetPollingMode().


The documentation for this class was generated from the following files: