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

Raw event source which reads entries from a root TTree in a TFile. More...

#include <TGo4FileSource.h>

+ Inheritance diagram for TGo4FileSource:

Public Member Functions

 TGo4FileSource ()
 
 TGo4FileSource (const char *name)
 
 TGo4FileSource (TGo4FileSourceParameter *par)
 
virtual ~TGo4FileSource ()
 
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.
 

Static Public Member Functions

static TList * ProducesFilesList (const char *mask)
 

Private Member Functions

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

Private Attributes

Bool_t fbActivated {kFALSE}
 This flag is used for lazy init of tree in Eventbuilding methods.
 
Long64_t fiCurrentEvent {0}
 Event number in current tree.
 
long int fiGlobalEvent {0}
 Global event number, starting from the first tree.
 
Long64_t fiMaxEvents {0}
 Number of events stored in the Tree.
 
TString fxCurrentFileName
 current name of the file
 
TFile * fxFile {nullptr}
 
TList * fxFilesNames {nullptr}
 list of files names
 
TGo4EventElementfxTopEvent {nullptr}
 pointer to top branch event
 
TTree * fxTree {nullptr}
 

Additional Inherited Members

- Static Public Attributes inherited from TGo4EventSource
static const Int_t fgiTIMEOUTDEFAULT =1
 Default timeout in seconds for event input.
 
- 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

Raw event source which reads entries from a root TTree in a TFile.

File is opened by ctor; method BuildEvent() iterates over tree. Needs pointer to external reference to event structure class which must match the structure of the tree entry New since 10/2004: Name of event element defines tree subbranch to be activated as partial input

Author
J. Adamczewski
Since
1/2001

Definition at line 37 of file TGo4FileSource.h.

Constructor & Destructor Documentation

◆ TGo4FileSource() [1/3]

TGo4FileSource::TGo4FileSource ( )

◆ TGo4FileSource() [2/3]

◆ TGo4FileSource() [3/3]

◆ ~TGo4FileSource()

TGo4FileSource::~TGo4FileSource ( )
virtual

Definition at line 79 of file TGo4FileSource.cxx.

References CloseCurrentFile(), and fxFilesNames.

Member Function Documentation

◆ BuildEvent()

Bool_t TGo4FileSource::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 199 of file TGo4FileSource.cxx.

References fbActivated, fiCurrentEvent, fiGlobalEvent, fiMaxEvents, fxCurrentFileName, fxTopEvent, fxTree, TGo4Log::Info(), OpenNextFile(), TGo4EventElement::synchronizeWithTree(), TGo4EventSource::ThrowEOF(), and TGo4EventSource::ThrowError().

◆ CloseCurrentFile()

Bool_t TGo4FileSource::CloseCurrentFile ( )
private

Close currently open file.

Definition at line 181 of file TGo4FileSource.cxx.

References fbActivated, fiCurrentEvent, fiMaxEvents, fxCurrentFileName, fxFile, fxTopEvent, fxTree, and TGo4Log::Info().

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

◆ OpenNextFile()

Bool_t TGo4FileSource::OpenNextFile ( )
private

◆ ProducesFilesList()

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

Field Documentation

◆ fbActivated

Bool_t TGo4FileSource::fbActivated {kFALSE}
private

This flag is used for lazy init of tree in Eventbuilding methods.

Definition at line 73 of file TGo4FileSource.h.

Referenced by TGo4FileSource(), TGo4FileSource(), TGo4FileSource(), BuildEvent(), and CloseCurrentFile().

◆ fiCurrentEvent

Long64_t TGo4FileSource::fiCurrentEvent {0}
private

Event number in current tree.

Definition at line 67 of file TGo4FileSource.h.

Referenced by TGo4FileSource(), TGo4FileSource(), TGo4FileSource(), BuildEvent(), and CloseCurrentFile().

◆ fiGlobalEvent

long int TGo4FileSource::fiGlobalEvent {0}
private

Global event number, starting from the first tree.

Definition at line 70 of file TGo4FileSource.h.

Referenced by TGo4FileSource(), TGo4FileSource(), TGo4FileSource(), and BuildEvent().

◆ fiMaxEvents

Long64_t TGo4FileSource::fiMaxEvents {0}
private

Number of events stored in the Tree.

Used to check if the complete tree is already read.

Definition at line 64 of file TGo4FileSource.h.

Referenced by TGo4FileSource(), TGo4FileSource(), TGo4FileSource(), BuildEvent(), CloseCurrentFile(), and OpenNextFile().

◆ fxCurrentFileName

TString TGo4FileSource::fxCurrentFileName
private

current name of the file

Definition at line 82 of file TGo4FileSource.h.

Referenced by BuildEvent(), CloseCurrentFile(), and OpenNextFile().

◆ fxFile

TFile* TGo4FileSource::fxFile {nullptr}
private

◆ fxFilesNames

TList* TGo4FileSource::fxFilesNames {nullptr}
private

list of files names

Definition at line 79 of file TGo4FileSource.h.

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

◆ fxTopEvent

TGo4EventElement* TGo4FileSource::fxTopEvent {nullptr}
private

pointer to top branch event

Definition at line 76 of file TGo4FileSource.h.

Referenced by TGo4FileSource(), TGo4FileSource(), TGo4FileSource(), BuildEvent(), and CloseCurrentFile().

◆ fxTree

TTree* TGo4FileSource::fxTree {nullptr}
private

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