GSI Object Oriented Online Offline (Go4) GO4-6.4.0
|
Implements the gsi mbs lmd file source. More...
#include <TGo4MbsFile.h>
Public Member Functions | |
TGo4MbsFile () | |
TGo4MbsFile (const char *name) | |
TGo4MbsFile (TGo4MbsFileParameter *par) | |
~TGo4MbsFile () | |
Int_t | Close () override |
Close the file or connection. | |
const char * | GetActiveName () const override |
interface from eventsource base class to give active file | |
const char * | GetCurrentFileName () const |
const char * | GetCurrentTagName () const |
const char * | GetTagName () const |
Name of the Tagfile. | |
Int_t | NextEvent () override |
Requests the next event from mbs source. | |
Int_t | Open () override |
Open the file or connection. | |
![]() | |
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. | |
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 with matching header fullID longword. | |
Bool_t | CheckEventClass (TClass *cl) override |
Check that filled event is a proper class. | |
virtual s_bufhe * | GetBufferHeader () |
User access to current event buffer header. | |
s_filhe * | GetInfoHeader () const |
User access to info header. | |
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) |
![]() | |
TGo4EventSource () | |
TGo4EventSource (const char *name) | |
virtual | ~TGo4EventSource () |
void | Clear (Option_t *opt="") override |
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 Attributes | |
static const char * | fgcFILELISTSUF =".lml" |
standard suffix for list of listmode files | |
static const char * | fgcLMDSUF =".lmd" |
standard suffix for listmode data files | |
static const char * | fgcNOTAGFILE ="GO4-NOLMDTAG" |
string to indicate that no lmd tagfile is chosen | |
![]() | |
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 const Int_t | fgiTIMEOUTDEFAULT =1 |
Default timeout in seconds for event input. | |
Private Member Functions | |
void | AddFileName (const char *name, const char *tagname=nullptr, bool isonly=kFALSE) |
Int_t | CloseFile () |
Close current file/tagfile. | |
Int_t | NewFileAction (Bool_t dosave=kTRUE) |
Called whenever new file is opened in multiple mode. | |
Int_t | NextFile () |
For multiple input mode: Open next file in list. | |
Int_t | OpenFile () |
Open current file/tagfile. | |
Private Attributes | |
Bool_t | fbFileOpen {kFALSE} |
This indicates if the current file is open or not. | |
Bool_t | fbShowInfo {kFALSE} |
Indicates if mbs file should show information about new open file. | |
TString | fxCurrentFile |
Currently processed file (for multiple input mode) | |
TString | fxCurrentTag |
Currently processed tagfile (for multiple input mode) | |
TList * | fxMultiFile {nullptr} |
file that contains the list of mbs filenames. | |
TString | fxTagFile |
Name of the tagfile associated with the listmode event file. | |
Additional Inherited Members | |
![]() | |
static void | SetPollingMode (Bool_t on=kTRUE) |
![]() | |
enum | { fguTXTLEN = 256 } |
text length More... | |
![]() | |
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. | |
![]() | |
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_bufhe * | fxBuffer {nullptr} |
Points to the current gsi buffer structure filled by the event source. | |
s_ve10_1 * | fxEvent {nullptr} |
s_filhe * | fxInfoHeader {nullptr} |
Reference to header info delivered by source. | |
s_evt_channel * | fxInputChannel {nullptr} |
Event channel structure used by event source. | |
TGo4MbsSourcePrintPar | fxPrEventPar |
This structure keeps parameters for printevent mode. | |
![]() | |
static Bool_t | gbPollingMode = kFALSE |
Implements the gsi mbs lmd file source.
This is an alias for the TGo4MbsSource class with parameter GETEVT__FILE
Definition at line 30 of file TGo4MbsFile.h.
TGo4MbsFile::TGo4MbsFile | ( | const char * | name | ) |
Definition at line 50 of file TGo4MbsFile.cxx.
References TGo4MbsSource::TGo4MbsSource(), AddFileName(), TGo4Log::Debug(), fbFileOpen, fbShowInfo, fgcNOTAGFILE, fxCurrentFile, fxCurrentTag, fxMultiFile, fxTagFile, GETEVT__FILE, GO4TRACE, and Open().
TGo4MbsFile::TGo4MbsFile | ( | ) |
Definition at line 38 of file TGo4MbsFile.cxx.
References TGo4MbsSource::TGo4MbsSource(), fbFileOpen, fbShowInfo, fxCurrentFile, fxCurrentTag, fxMultiFile, fxTagFile, and GO4TRACE.
TGo4MbsFile::TGo4MbsFile | ( | TGo4MbsFileParameter * | par | ) |
Definition at line 69 of file TGo4MbsFile.cxx.
References TGo4MbsSource::TGo4MbsSource(), AddFileName(), TGo4Log::Debug(), fbFileOpen, fbShowInfo, fxCurrentFile, fxCurrentTag, fxMultiFile, fxTagFile, GETEVT__FILE, TGo4MbsFileParameter::GetMoreName(), TGo4MbsFileParameter::GetTagName(), GO4TRACE, TGo4MbsFileParameter::NumMoreFiles(), and Open().
TGo4MbsFile::~TGo4MbsFile | ( | ) |
Definition at line 93 of file TGo4MbsFile.cxx.
References Close(), fxMultiFile, and GO4TRACE.
|
private |
Definition at line 101 of file TGo4MbsFile.cxx.
References fgcFILELISTSUF, fgcNOTAGFILE, TGo4EventSource::fguTXTLEN, fxMultiFile, GETEVT__NOFILE, TGo4FileSource::ProducesFilesList(), TGo4EventSource::SetCreateStatus(), and TGo4EventSource::SetErrMess().
Referenced by TGo4MbsFile(), and TGo4MbsFile().
|
overridevirtual |
Close the file or connection.
Reimplemented from TGo4MbsSource.
Definition at line 252 of file TGo4MbsFile.cxx.
References CloseFile(), TGo4MbsSource::fbIsOpen, fxMultiFile, TGo4EventSource::GetCreateStatus(), GETEVT__SUCCESS, and GO4TRACE.
Referenced by ~TGo4MbsFile().
|
private |
Close current file/tagfile.
Definition at line 407 of file TGo4MbsFile.cxx.
References f_evt_get_tagclose(), fbFileOpen, TGo4MbsSource::fxInputChannel, and GETEVT__SUCCESS.
Referenced by Close(), and NextFile().
|
overridevirtual |
interface from eventsource base class to give active file
Reimplemented from TGo4EventSource.
Definition at line 435 of file TGo4MbsFile.cxx.
References GetCurrentFileName().
|
inline |
Definition at line 55 of file TGo4MbsFile.h.
References fxCurrentFile.
Referenced by GetActiveName(), NewFileAction(), NextEvent(), Open(), and OpenFile().
|
inline |
Definition at line 53 of file TGo4MbsFile.h.
References fxCurrentTag.
Referenced by NextEvent(), and OpenFile().
|
inline |
Name of the Tagfile.
Definition at line 51 of file TGo4MbsFile.h.
References fxTagFile.
Referenced by NextFile().
|
private |
Called whenever new file is opened in multiple mode.
For ctor, argument dosave should be false (no autosave possible inside InitEventClasses())
Definition at line 415 of file TGo4MbsFile.cxx.
References TGo4Analysis::AutoSave(), TGo4Analysis::ClearObjects(), GetCurrentFileName(), TGo4Analysis::Instance(), TGo4Analysis::IsAutoSaveFileChange(), TGo4Analysis::Message(), TGo4Analysis::SetAutoSaveFile(), TGo4Analysis::SetInputFileName(), and TGo4Analysis::SetNewInputFile().
Referenced by NextEvent(), and Open().
|
overridevirtual |
Requests the next event from mbs source.
Returns event status value.
Reimplemented from TGo4MbsSource.
Definition at line 177 of file TGo4MbsFile.cxx.
References f_evt_error(), f_evt_get_tagnext(), TGo4MbsSource::fbFirstEvent, fbShowInfo, TGo4EventSource::fguTXTLEN, TGo4MbsSource::fuEventCounter, TGo4MbsSource::fuEventInterval, TGo4MbsSource::fuStartEvent, TGo4MbsSource::fuStopEvent, TGo4MbsSource::fxEvent, TGo4MbsSource::fxInputChannel, fxMultiFile, GetCurrentFileName(), GetCurrentTagName(), TGo4EventSource::GetEventStatus(), GETEVT__NOMORE, GO4TRACE, TGo4EventSourceException::Handle(), TGo4Log::Info(), NewFileAction(), NextFile(), TGo4EventSource::SetErrMess(), and TGo4EventSource::SetEventStatus().
|
private |
For multiple input mode: Open next file in list.
Definition at line 296 of file TGo4MbsFile.cxx.
References CloseFile(), fbShowInfo, fgcNOTAGFILE, TGo4EventSource::fguTXTLEN, TGo4MbsSource::fuEventCounter, TGo4MbsSource::fuEventInterval, TGo4MbsSource::fuStartEvent, TGo4MbsSource::fuStopEvent, fxCurrentFile, fxCurrentTag, fxMultiFile, GETEVT__NOFILE, GetTagName(), TGo4EventSourceException::Handle(), TGo4Analysis::Instance(), TGo4Analysis::Message(), OpenFile(), TGo4EventSource::SetCreateStatus(), and TGo4EventSource::SetErrMess().
Referenced by NextEvent(), and Open().
|
overridevirtual |
Open the file or connection.
Reimplemented from TGo4MbsSource.
Definition at line 266 of file TGo4MbsFile.cxx.
References TGo4MbsSource::fbIsOpen, fxMultiFile, GetCurrentFileName(), GO4TRACE, TGo4Log::Info(), NewFileAction(), and NextFile().
Referenced by TGo4MbsFile(), and TGo4MbsFile().
|
private |
Open current file/tagfile.
Definition at line 378 of file TGo4MbsFile.cxx.
References TGo4Log::Debug(), f_evt_error(), f_evt_get_tagopen(), fbFileOpen, TGo4MbsSource::fbFirstEvent, fgcNOTAGFILE, TGo4EventSource::fguTXTLEN, fxCurrentTag, TGo4MbsSource::fxInfoHeader, TGo4MbsSource::fxInputChannel, TGo4EventSource::GetCreateStatus(), GetCurrentFileName(), GetCurrentTagName(), GETEVT__SUCCESS, TGo4EventSource::SetCreateStatus(), and TGo4EventSource::SetErrMess().
Referenced by NextFile().
|
private |
This indicates if the current file is open or not.
Definition at line 101 of file TGo4MbsFile.h.
Referenced by TGo4MbsFile(), TGo4MbsFile(), TGo4MbsFile(), CloseFile(), and OpenFile().
|
private |
Indicates if mbs file should show information about new open file.
Definition at line 104 of file TGo4MbsFile.h.
Referenced by TGo4MbsFile(), TGo4MbsFile(), TGo4MbsFile(), NextEvent(), and NextFile().
|
static |
standard suffix for list of listmode files
Definition at line 67 of file TGo4MbsFile.h.
Referenced by AddFileName().
|
static |
standard suffix for listmode data files
Definition at line 64 of file TGo4MbsFile.h.
|
static |
string to indicate that no lmd tagfile is chosen
Definition at line 61 of file TGo4MbsFile.h.
Referenced by TGo4MbsFile(), AddFileName(), NextFile(), and OpenFile().
|
private |
Currently processed file (for multiple input mode)
Definition at line 91 of file TGo4MbsFile.h.
Referenced by TGo4MbsFile(), TGo4MbsFile(), TGo4MbsFile(), GetCurrentFileName(), and NextFile().
|
private |
Currently processed tagfile (for multiple input mode)
Definition at line 94 of file TGo4MbsFile.h.
Referenced by TGo4MbsFile(), TGo4MbsFile(), TGo4MbsFile(), GetCurrentTagName(), NextFile(), and OpenFile().
|
private |
file that contains the list of mbs filenames.
format should be: "filename.lmd tagfilename" for each line.
Definition at line 98 of file TGo4MbsFile.h.
Referenced by TGo4MbsFile(), TGo4MbsFile(), TGo4MbsFile(), ~TGo4MbsFile(), AddFileName(), Close(), NextEvent(), NextFile(), and Open().
|
private |
Name of the tagfile associated with the listmode event file.
Definition at line 88 of file TGo4MbsFile.h.
Referenced by TGo4MbsFile(), TGo4MbsFile(), TGo4MbsFile(), and GetTagName().