List of all members | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
io::VROOTFile Class Referenceabstract

#include <VROOTFile.h>

Inheritance diagram for io::VROOTFile:
Inheritance graph
[legend]

Public Member Functions

virtual void Close ()
 
virtual Status FindEvent (const unsigned int eventId)=0
 seek Event id set cursor there More...
 
const std::string & GetFilename () const
 
virtual int GetNEvents ()=0
 
virtual Status GotoPosition (const unsigned int position)=0
 goto by position in the file More...
 
virtual void Open (const std::string &filename, const Mode mode=eRead, utl::Branch *const b=nullptr)
 
virtual Status Read (evt::Event &event)=0
 read current event advance cursor by 1 More...
 
 VROOTFile ()
 
 VROOTFile (const std::string &filename, const Mode mode=eRead, utl::Branch *const b=nullptr)
 
virtual void Write (const evt::Event &event)=0
 
virtual ~VROOTFile ()
 

Static Public Member Functions

static std::string GetRootMode (const Mode mode)
 

Protected Member Functions

int DefaultOpen (const std::string &filename, const Mode mode=eRead)
 
int DefaultWrite (evt::Event &event)
 
int GetTree (const std::string &name)
 
int OpenROOTFile ()
 

Protected Attributes

utl::BranchfBranch = nullptr
 
TFile * fFile = nullptr
 
std::string fFilename
 
Mode fMode = eRead
 
TTree * fTree = nullptr
 

Detailed Description

Base class for EventFiles

that are implemented using a TFile and a TTree

Author
Stefano Argiro'
Date
1 April 2003

Definition at line 27 of file VROOTFile.h.

Constructor & Destructor Documentation

io::VROOTFile::VROOTFile ( )
inline

Definition at line 30 of file VROOTFile.h.

VROOTFile::VROOTFile ( const std::string &  filename,
const Mode  mode = eRead,
utl::Branch *const  b = nullptr 
)
VROOTFile::~VROOTFile ( )
virtual

Definition at line 41 of file VROOTFile.cc.

References fFile.

Member Function Documentation

void VROOTFile::Close ( )
virtual

Implements io::VEventFile.

Reimplemented in io::OfflineROOTFile, io::RadioFileAERAroot, and io::CDASEventFile.

Definition at line 89 of file VROOTFile.cc.

References io::eRead, fFile, io::VEventFile::fMode, and fTree.

Referenced by io::OfflineROOTFile::Close(), and OpenROOTFile().

int VEventFile::DefaultOpen ( const std::string &  filename,
const Mode  mode = eRead 
)
protectedinherited

Checks that file exists Intended to be called in the Write method of derived classes

Definition at line 31 of file VEventFile.cc.

Referenced by Open(), io::AiresShowerFile::Open(), io::VEventFile::VEventFile(), and VROOTFile().

int VEventFile::DefaultWrite ( evt::Event event)
protectedinherited

Checks that we are open for write Intended to be called in the Write method of derived classes

Definition at line 15 of file VEventFile.cc.

References io::eRead, and FATAL.

virtual Status io::VEventFile::FindEvent ( const unsigned int  eventId)
pure virtualinherited
const std::string& io::VEventFile::GetFilename ( ) const
inlineinherited

Definition at line 54 of file VEventFile.h.

References io::VEventFile::fFilename.

Referenced by io::EventFile::GetFilename().

virtual int io::VEventFile::GetNEvents ( )
pure virtualinherited
string VROOTFile::GetRootMode ( const Mode  mode)
static

Definition at line 123 of file VROOTFile.cc.

References io::eAppend, io::eNew, and io::eWrite.

Referenced by io::FDasEventFile::Open(), OpenROOTFile(), and io::FDasEventFile::Write().

int VROOTFile::GetTree ( const std::string &  name)
protected

Definition at line 105 of file VROOTFile.cc.

References FATAL, fFile, and fTree.

Referenced by io::OfflineROOTFile::GetConfig(), and io::OfflineROOTFile::GetEventBranch().

virtual Status io::VEventFile::GotoPosition ( const unsigned int  position)
pure virtualinherited
void VROOTFile::Open ( const std::string &  filename,
const Mode  mode = eRead,
utl::Branch *const  b = nullptr 
)
virtual
int VROOTFile::OpenROOTFile ( )
protected

Definition at line 69 of file VROOTFile.cc.

References Close(), fFile, io::VEventFile::fFilename, io::VEventFile::fMode, and GetRootMode().

Referenced by Open(), and VROOTFile().

virtual Status io::VEventFile::Read ( evt::Event event)
pure virtualinherited
virtual void io::VEventFile::Write ( const evt::Event event)
pure virtualinherited

Member Data Documentation

utl::Branch* io::VEventFile::fBranch = nullptr
protectedinherited

Definition at line 72 of file VEventFile.h.

TFile* io::VROOTFile::fFile = nullptr
protected
std::string io::VEventFile::fFilename
protectedinherited
Mode io::VEventFile::fMode = eRead
protectedinherited
TTree* io::VROOTFile::fTree = nullptr
protected

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

, generated on Tue Sep 26 2023.