Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

TGo4MbsSource Class Reference

#include <TGo4MbsSource.h>

Inheritance diagram for TGo4MbsSource:

TGo4EventSource TGo4MbsEventServer TGo4MbsFile TGo4MbsRandom TGo4MbsStream TGo4MbsTransport TGo4RevServ List of all members.

Public Member Functions

 TGo4MbsSource ()
 default for streamer
 TGo4MbsSource (const char *name, Int_t mode)
virtual ~TGo4MbsSource ()
virtual Int_t Close ()
 Close the file or connection.
virtual Int_t Open ()
 Open the file or connection.
virtual Int_t NextEvent ()
 Requests the next event from mbs source.
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.
void SetStartEvent (UInt_t firstindex)
 Define the Start index for the NextEvent.
void SetStopEvent (UInt_t lastindex)
void SetEventInterval (UInt_t skipinterval)
void SetTimeout (Int_t time)
s_filheGetInfoHeader ()
 User access to info header.
virtual s_bufheGetBufferHeader ()
 User access to current event buffer 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.
void SetDataCopyMode (Bool_t on)

Static Public Attributes

static const UInt_t fguLONGBYCHAR = sizeof(Int_t) / sizeof(Char_t)
 ratio sizeof(long) by sizeof(char).
static const UInt_t fguSHORTBYCHAR = sizeof(Short_t) / sizeof(Char_t)
 ratio sizeof(short) by sizeof(char).
static const UInt_t fguLONGBYSHORT = sizeof(Int_t) / sizeof(Short_t)
 ratio sizeof(long) by sizeof(short).
static const UInt_t fguEVHEBYCHAR = sizeof(s_evhe) / sizeof(Char_t)
 ratio sizeof(s_evhe) by sizeof(char).

Protected Attributes

s_evt_channelfxInputChannel
 Event channel structure used by event source.
s_ve10_1fxEvent
s_bufhefxBuffer
 Points to the current gsi buffer structure filled by the event source.
s_filhefxInfoHeader
 Reference to header info delivered by source.
Bool_t fbIsOpen
Bool_t fbDataCopyMode
 switches buildmbs event mode: if true, data buffer is copied to own buffer of subevent.
ULong_t fuEventCounter
 Current event index counter.
ULong_t fuStartEvent
 Index of first event to process.
ULong_t fuStopEvent
 Index of last event to process.
ULong_t fuEventInterval
 Number of events to skip from file in between two read events.
Int_t fiTimeout
 Timeout in seconds for mbs getevent.
TGo4MbsSourcePrintPar fxPrEventPar
 This structure keeps parameters for printevent mode.

Private Attributes

Int_t fiMode
 Mode of operation.

Constructor & Destructor Documentation

TGo4MbsSource::TGo4MbsSource  ) 
 

default for streamer

Definition at line 48 of file TGo4MbsSource.cxx.

References f_evt_control(), fxInputChannel, and TRACE.

TGo4MbsSource::TGo4MbsSource const char *  name,
Int_t  mode
 

Definition at line 35 of file TGo4MbsSource.cxx.

References f_evt_control(), fxInputChannel, and TRACE.

TGo4MbsSource::~TGo4MbsSource  )  [virtual]
 

Definition at line 58 of file TGo4MbsSource.cxx.

References Close(), fxInputChannel, and TRACE.


Member Function Documentation

Int_t TGo4MbsSource::Close  )  [virtual]
 

Close the file or connection.

Reimplemented in TGo4MbsFile, and TGo4MbsRandom.

Definition at line 353 of file TGo4MbsSource.cxx.

References f_evt_get_close(), fbIsOpen, fxInputChannel, TGo4EventSource::GetCreateStatus(), GETEVT__SUCCESS, and TRACE.

Referenced by TGo4MbsEventServer::~TGo4MbsEventServer(), ~TGo4MbsSource(), TGo4MbsStream::~TGo4MbsStream(), TGo4MbsTransport::~TGo4MbsTransport(), and TGo4RevServ::~TGo4RevServ().

Int_t TGo4MbsSource::Open  )  [virtual]
 

Open the file or connection.

Reimplemented in TGo4MbsFile, TGo4MbsRandom, and TGo4RevServ.

Definition at line 316 of file TGo4MbsSource.cxx.

References TGo4Log::Debug(), f_evt_error(), f_evt_get_open(), f_evt_timeout(), fbIsOpen, TGo4EventSource::fguTXTLEN, fiMode, fiTimeout, fxInfoHeader, fxInputChannel, TGo4EventSource::GetCreateStatus(), GETEVT__SUCCESS, TGo4EventSource::SetCreateStatus(), TGo4EventSource::SetErrMess(), and TRACE.

Referenced by TGo4RevServ::Open(), TGo4MbsEventServer::TGo4MbsEventServer(), TGo4MbsStream::TGo4MbsStream(), and TGo4MbsTransport::TGo4MbsTransport().

Int_t TGo4MbsSource::NextEvent  )  [virtual]
 

Requests the next event from mbs source.

Returns event status value.

Reimplemented in TGo4MbsFile, and TGo4MbsRandom.

Definition at line 257 of file TGo4MbsSource.cxx.

References f_evt_error(), f_evt_get_event(), TGo4EventSource::fguTXTLEN, fuEventCounter, fuEventInterval, fuStartEvent, fuStopEvent, fxBuffer, fxEvent, fxInputChannel, TGo4EventSource::GetEventStatus(), GETEVT__NOMORE, GETEVT__TIMEOUT, TGo4EventSource::SetErrMess(), TGo4EventSource::SetEventStatus(), TRACE, and TGo4Log::Warn().

Referenced by TGo4MbsEvent::Fill().

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 76 of file TGo4MbsSource.cxx.

References BuildMbsSubEvent(), TGo4Log::Debug(), f_evt_type(), fguEVHEBYCHAR, fguSHORTBYCHAR, TGo4MbsSourcePrintPar::fiData, TGo4MbsSourcePrintPar::fiHex, TGo4MbsSourcePrintPar::fiLong, TGo4MbsSourcePrintPar::fiNum, TGo4MbsSourcePrintPar::fiSid, fxBuffer, fxEvent, fxPrEventPar, TGo4EventSource::GetErrMess(), TGo4EventSource::GetEventStatus(), GETEVT__SUCCESS, s_ve10_1::i_dummy, s_ves10_1::i_subtype, s_ve10_1::i_subtype, s_ve10_1::i_trigger, s_ves10_1::i_type, s_ve10_1::i_type, s_ve10_1::l_count, s_evhe::l_dlen, s_ves10_1::l_dlen, s_ve10_1::l_dlen, TGo4MbsEvent::SetCount(), TGo4MbsEvent::SetDlen(), TGo4MbsEvent::SetDummy(), TGo4EventSource::SetErrMess(), TGo4MbsSubEvent::SetSubtype(), TGo4MbsEvent::SetSubtype(), TGo4MbsEvent::SetTrigger(), TGo4MbsSubEvent::SetType(), TGo4MbsEvent::SetType(), TGo4EventElement::SetValid(), and TRACE.

Referenced by TGo4MbsEvent::Fill().

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 190 of file TGo4MbsSource.cxx.

References TGo4Log::Debug(), fbDataCopyMode, TGo4MbsSubEvent::fbIsDataOwner, TGo4MbsSubEvent::fbIsFilled, fguLONGBYSHORT, TGo4MbsSubEvent::fiAllocLen, TGo4MbsSubEvent::fiData, fxEvent, TGo4MbsSubEvent::fxHeader, TGo4MbsEvent::fxSubEvArray, TGo4MbsSubEvent::GetControl(), TGo4MbsSubEvent::GetProcid(), TGo4MbsSubEvent::GetSubcrate(), s_ve10_1::l_count, TGo4MbsEvent::NextSubEvent(), TGo4MbsSubEvent::ReAllocate(), TGo4MbsEvent::ResetIterator(), and TGo4MbsSubEvent::SetDlen().

Referenced by BuildMbsEvent().

void TGo4MbsSource::SetStartEvent UInt_t  firstindex  )  [inline]
 

Define the Start index for the NextEvent.

Definition at line 97 of file TGo4MbsSource.h.

References fuStartEvent.

Referenced by TGo4MbsFile::TGo4MbsFile().

void TGo4MbsSource::SetStopEvent UInt_t  lastindex  )  [inline]
 

Definition at line 99 of file TGo4MbsSource.h.

References fuStopEvent.

Referenced by TGo4MbsFile::TGo4MbsFile().

void TGo4MbsSource::SetEventInterval UInt_t  skipinterval  )  [inline]
 

Definition at line 101 of file TGo4MbsSource.h.

References fuEventInterval.

Referenced by TGo4MbsFile::TGo4MbsFile().

void TGo4MbsSource::SetTimeout Int_t  time  )  [inline]
 

Definition at line 103 of file TGo4MbsSource.h.

References fiTimeout.

Referenced by TGo4MbsEventServer::TGo4MbsEventServer(), TGo4MbsStream::TGo4MbsStream(), TGo4MbsTransport::TGo4MbsTransport(), and TGo4RevServ::TGo4RevServ().

s_filhe* TGo4MbsSource::GetInfoHeader  )  [inline]
 

User access to info header.

May contain additional run information

Definition at line 106 of file TGo4MbsSource.h.

References fxInfoHeader.

Referenced by TGo4MbsEvent::GetMbsSourceHeader().

s_bufhe * TGo4MbsSource::GetBufferHeader  )  [virtual]
 

User access to current event buffer header.

Reimplemented in TGo4MbsRandom.

Definition at line 368 of file TGo4MbsSource.cxx.

References f_evt_get_buffer_ptr(), and fxInputChannel.

Referenced by TGo4MbsEvent::GetMbsBufferHeader().

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 specifiec (-1 is all subevents). Parameters longw, hexw, dataw switch output data formats. See MbsAPI function f_evt_type().

Definition at line 65 of file TGo4MbsSource.cxx.

References TGo4MbsSourcePrintPar::fiData, TGo4MbsSourcePrintPar::fiHex, TGo4MbsSourcePrintPar::fiLong, TGo4MbsSourcePrintPar::fiNum, TGo4MbsSourcePrintPar::fiSid, and fxPrEventPar.

Referenced by TGo4MbsEvent::SetPrintEvent().

void TGo4MbsSource::SetDataCopyMode Bool_t  on  )  [inline]
 

Definition at line 129 of file TGo4MbsSource.h.

References fbDataCopyMode.


Member Data Documentation

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

ratio sizeof(long) by sizeof(char).

Definition at line 30 of file TGo4MbsSource.cxx.

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

ratio sizeof(short) by sizeof(char).

Definition at line 31 of file TGo4MbsSource.cxx.

Referenced by BuildMbsEvent().

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

ratio sizeof(long) by sizeof(short).

Definition at line 32 of file TGo4MbsSource.cxx.

Referenced by BuildMbsSubEvent(), and TGo4MbsSubEvent::Clear().

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

ratio sizeof(s_evhe) by sizeof(char).

Definition at line 33 of file TGo4MbsSource.cxx.

Referenced by BuildMbsEvent().

Int_t TGo4MbsSource::fiMode [private]
 

Mode of operation.

Definition at line 134 of file TGo4MbsSource.h.

Referenced by Open().

s_evt_channel* TGo4MbsSource::fxInputChannel [protected]
 

Event channel structure used by event source.

Definition at line 139 of file TGo4MbsSource.h.

Referenced by Close(), TGo4MbsFile::CloseFile(), GetBufferHeader(), NextEvent(), TGo4MbsFile::NextEvent(), Open(), TGo4MbsFile::OpenFile(), TGo4MbsSource(), and ~TGo4MbsSource().

s_ve10_1* TGo4MbsSource::fxEvent [protected]
 

Definition at line 141 of file TGo4MbsSource.h.

Referenced by BuildMbsEvent(), BuildMbsSubEvent(), TGo4MbsRandom::Close(), NextEvent(), TGo4MbsRandom::NextEvent(), TGo4MbsFile::NextEvent(), and TGo4MbsRandom::Open().

s_bufhe* TGo4MbsSource::fxBuffer [protected]
 

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

Definition at line 144 of file TGo4MbsSource.h.

Referenced by BuildMbsEvent(), and NextEvent().

s_filhe* TGo4MbsSource::fxInfoHeader [protected]
 

Reference to header info delivered by source.

Definition at line 147 of file TGo4MbsSource.h.

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

Bool_t TGo4MbsSource::fbIsOpen [protected]
 

Definition at line 149 of file TGo4MbsSource.h.

Referenced by Close(), TGo4MbsRandom::Close(), TGo4MbsFile::Close(), TGo4RevServ::Open(), Open(), TGo4MbsRandom::Open(), and TGo4MbsFile::Open().

Bool_t TGo4MbsSource::fbDataCopyMode [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 154 of file TGo4MbsSource.h.

Referenced by BuildMbsSubEvent(), and SetDataCopyMode().

ULong_t TGo4MbsSource::fuEventCounter [protected]
 

Current event index counter.

Definition at line 157 of file TGo4MbsSource.h.

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

ULong_t TGo4MbsSource::fuStartEvent [protected]
 

Index of first event to process.

Definition at line 160 of file TGo4MbsSource.h.

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

ULong_t TGo4MbsSource::fuStopEvent [protected]
 

Index of last event to process.

Definition at line 163 of file TGo4MbsSource.h.

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

ULong_t TGo4MbsSource::fuEventInterval [protected]
 

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

Definition at line 166 of file TGo4MbsSource.h.

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

Int_t TGo4MbsSource::fiTimeout [protected]
 

Timeout in seconds for mbs getevent.

If -1, no timeout (default)

Definition at line 169 of file TGo4MbsSource.h.

Referenced by Open(), and SetTimeout().

TGo4MbsSourcePrintPar TGo4MbsSource::fxPrEventPar [protected]
 

This structure keeps parameters for printevent mode.

Definition at line 172 of file TGo4MbsSource.h.

Referenced by BuildMbsEvent(), and SetPrintEvent().


The documentation for this class was generated from the following files:
Generated on Fri Nov 28 13:01:06 2008 for Go4-v3.04-1 by  doxygen 1.4.2