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

Event source which reads entries from a dataset in a hdf5 formatted file names of elements in hdf5 data must match the members of the input event class. More...

#include <TGo4HDF5Source.h>

+ Inheritance diagram for TGo4HDF5Source:

Public Member Functions

 TGo4HDF5Source ()
 
 TGo4HDF5Source (const char *name)
 
 TGo4HDF5Source (TGo4HDF5SourceParameter *par)
 
virtual ~TGo4HDF5Source ()
 
Bool_t BuildEvent (TGo4EventElement *dest) override
 Fill the destination event dest from the tree.
 
- Public Member Functions inherited from TGo4EventSource
 TGo4EventSource ()
 
 TGo4EventSource (const char *name)
 
virtual ~TGo4EventSource ()
 
virtual Bool_t CheckEventClass (TClass *cl)
 Check that event class is supported by event source.
 
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.
 
- Public Member Functions inherited from TGo4HDF5Adapter
 TGo4HDF5Adapter ()
 
virtual ~TGo4HDF5Adapter ()
 

Static Public Member Functions

static TList * ProducesFilesList (const char *mask)
 
- Static Public Member Functions inherited from TGo4HDF5Adapter
static void AddSubHandle (TGo4HDF5DataHandle *handle, const char *name, const char *type, size_t size, size_t memberoffset, const char *membername, const char *classname, TClass *valueclass)
 Add subhandle to handle that represents a contained collection.
 
static void FillTypeInfo (TGo4HDF5DataHandle *handle, const char *membername, const char *memtypename, size_t memberoffset=0, Int_t arraydim=0, TDataMember *member=nullptr)
 evaluate h5 type information for basic types of memtypename
 
static void FillTypeInfo (TGo4HDF5DataHandle *handle, TClass *rootclass, const char *basename=nullptr)
 evaluate h5 type information from root class streamer
 

Protected Member Functions

void BuildDataSet (TGo4EventElement *event) override
 initialize dataset from event structure
 
void DeleteDataSet () override
 delete dataset resource
 
void OpenFile (const char *fname) override
 opens the hdf5 file of given name for reading
 
- 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.
 
- Protected Member Functions inherited from TGo4HDF5Adapter
void BuildDataType (TGo4EventElement *event, TGo4HDF5DataHandle *parent=nullptr, Int_t index=0)
 Prepare data type from event structure for hdf5.
 
virtual void CloseFile ()
 opens the hdf5 file depending on the setup
 
UInt_t ConvertFileMode (Go4_H5_File_Flags flags)
 Convert common go4 filemode flags to hdf5 flags:
 
size_t ScanEventSize (TGo4EventElement *event)
 evaluate total memory size of event object regarding composite subevents
 

Private Member Functions

Bool_t CloseCurrentFile ()
 Close currently open file.
 
Bool_t OpenNextFile ()
 Open next file from the files list.
 

Private Attributes

size_t fiReadOffset {0}
 begin of real eventdata payload after event object pointer
 
TString fxCurrentFileName
 current name of the file
 
TList * fxFilesNames {nullptr}
 list of files names
 
Char_t * fxReadBuffer {nullptr}
 read buffer for hdf5
 

Friends

class TGo4HDF5BasicDataHandle
 
class TGo4HDF5DataHandle
 

Additional Inherited Members

- Static Public Attributes inherited from TGo4EventSource
static const Int_t fgiTIMEOUTDEFAULT =1
 Default timeout in seconds for event input.
 
- Static Public Attributes inherited from TGo4HDF5Adapter
static const char * fgcFILESUF = ".h5"
 Standard suffix for file name.
 
- Protected Types inherited from TGo4EventSource
enum  { fguTXTLEN = 256 }
 text length More...
 
- Protected Attributes inherited from TGo4HDF5Adapter
Bool_t fbDataSetExists {kFALSE}
 True if branch already exists.
 
hsize_t fiFillCount {0}
 counter of filled events.
 
UInt_t fiFlags {0}
 remember file property flags.
 
TGo4EventElementfxEvent {nullptr}
 Points to event structure to be filled into dataset.
 
H5::H5File * fxFile {nullptr}
 the currently open hdf5 file
 
TGo4HDF5DataHandlefxHandle {nullptr}
 handle object to recursively treat the io of nested event components
 

Detailed Description

Event source which reads entries from a dataset in a hdf5 formatted file names of elements in hdf5 data must match the members of the input event class.

  • Author
    J. Adamczewski-Musch
    Since
    01/2019

Definition at line 34 of file TGo4HDF5Source.h.

Constructor & Destructor Documentation

◆ TGo4HDF5Source() [1/3]

TGo4HDF5Source::TGo4HDF5Source ( )

◆ TGo4HDF5Source() [2/3]

◆ TGo4HDF5Source() [3/3]

◆ ~TGo4HDF5Source()

TGo4HDF5Source::~TGo4HDF5Source ( )
virtual

Definition at line 63 of file TGo4HDF5Source.cxx.

References CloseCurrentFile(), and fxFilesNames.

Member Function Documentation

◆ BuildDataSet()

void TGo4HDF5Source::BuildDataSet ( TGo4EventElement * event)
overrideprotectedvirtual

◆ BuildEvent()

Bool_t TGo4HDF5Source::BuildEvent ( TGo4EventElement * dest)
overridevirtual

Fill the destination event dest from the tree.

If end of tree is reached, the current event counter is reset and a kFALSE value is returned.

Reimplemented from TGo4EventSource.

Definition at line 214 of file TGo4HDF5Source.cxx.

References BuildDataSet(), TGo4Log::Error(), TGo4HDF5Adapter::fiFillCount, TGo4HDF5Adapter::fxEvent, TGo4HDF5Adapter::fxFile, TGo4HDF5Adapter::fxHandle, TGo4EventSource::SetErrMess(), and TGo4EventSource::ThrowError().

◆ CloseCurrentFile()

Bool_t TGo4HDF5Source::CloseCurrentFile ( )
private

Close currently open file.

Definition at line 149 of file TGo4HDF5Source.cxx.

References TGo4HDF5Adapter::CloseFile(), TGo4Log::Error(), fxCurrentFileName, TGo4Log::Info(), and TGo4EventSource::SetErrMess().

Referenced by ~TGo4HDF5Source(), and OpenNextFile().

◆ DeleteDataSet()

void TGo4HDF5Source::DeleteDataSet ( )
overrideprotectedvirtual

delete dataset resource

Reimplemented from TGo4HDF5Adapter.

Definition at line 208 of file TGo4HDF5Source.cxx.

References TGo4HDF5Adapter::DeleteDataSet(), and fxReadBuffer.

◆ OpenFile()

void TGo4HDF5Source::OpenFile ( const char * fname)
overrideprotectedvirtual

opens the hdf5 file of given name for reading

Implements TGo4HDF5Adapter.

Definition at line 165 of file TGo4HDF5Source.cxx.

References TGo4HDF5Adapter::CloseFile(), TGo4Log::Error(), TGo4HDF5Adapter::fgcFILESUF, TGo4HDF5Adapter::fxFile, TGo4Log::Info(), and TGo4EventSource::SetErrMess().

Referenced by OpenNextFile().

◆ OpenNextFile()

Bool_t TGo4HDF5Source::OpenNextFile ( )
private

Open next file from the files list.

Definition at line 133 of file TGo4HDF5Source.cxx.

References CloseCurrentFile(), fxCurrentFileName, fxFilesNames, and OpenFile().

Referenced by TGo4HDF5Source(), and TGo4HDF5Source().

◆ ProducesFilesList()

TList * TGo4HDF5Source::ProducesFilesList ( const char * mask)
static

Definition at line 73 of file TGo4HDF5Source.cxx.

References TGo4HDF5Adapter::fgcFILESUF.

Referenced by TGo4HDF5Source(), and TGo4HDF5Source().

Friends And Related Symbol Documentation

◆ TGo4HDF5BasicDataHandle

friend class TGo4HDF5BasicDataHandle
friend

Definition at line 37 of file TGo4HDF5Source.h.

References TGo4HDF5BasicDataHandle.

Referenced by TGo4HDF5BasicDataHandle.

◆ TGo4HDF5DataHandle

friend class TGo4HDF5DataHandle
friend

Definition at line 36 of file TGo4HDF5Source.h.

References TGo4HDF5DataHandle.

Referenced by TGo4HDF5DataHandle.

Field Documentation

◆ fiReadOffset

size_t TGo4HDF5Source::fiReadOffset {0}
private

begin of real eventdata payload after event object pointer

Definition at line 73 of file TGo4HDF5Source.h.

Referenced by TGo4HDF5Source(), TGo4HDF5Source(), and TGo4HDF5Source().

◆ fxCurrentFileName

TString TGo4HDF5Source::fxCurrentFileName
private

current name of the file

!

Definition at line 79 of file TGo4HDF5Source.h.

Referenced by CloseCurrentFile(), and OpenNextFile().

◆ fxFilesNames

TList* TGo4HDF5Source::fxFilesNames {nullptr}
private

list of files names

!

Definition at line 76 of file TGo4HDF5Source.h.

Referenced by TGo4HDF5Source(), TGo4HDF5Source(), TGo4HDF5Source(), ~TGo4HDF5Source(), and OpenNextFile().

◆ fxReadBuffer

Char_t* TGo4HDF5Source::fxReadBuffer {nullptr}
private

read buffer for hdf5

!

Definition at line 70 of file TGo4HDF5Source.h.

Referenced by TGo4HDF5Source(), TGo4HDF5Source(), TGo4HDF5Source(), and DeleteDataSet().


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