List of all members | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Static Private Attributes
io::OfflineROOTFile Class Reference

ROOT streamer for top level offline format. More...

#include <OfflineROOTFile.h>

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

Public Member Functions

void Close () override
 
Status FindEvent (const unsigned int eventId) override
 On success returns event number in the file. More...
 
std::string GetConfig ()
 Return a string with the configuration corresponding to the run. More...
 
const std::string & GetFilename () const
 
int GetNEvents () override
 
Status GotoPosition (const unsigned int evNo) override
 goto by position in the file More...
 
 OfflineROOTFile ()=default
 
 OfflineROOTFile (const std::string &filename, const Mode mode=eRead, utl::Branch *const b=nullptr, const io::StreamerSwitch &streamerSwitch=fgDefaultSwitch)
 
void Open (const std::string &filename, const Mode mode, utl::Branch *const b=nullptr) override
 
Status Read (evt::Event &event) override
 Returns -1 if End Of File. More...
 
void Write (const evt::Event &event) override
 
virtual ~OfflineROOTFile ()
 

Static Public Member Functions

static std::string GetRootMode (const Mode mode)
 

Static Public Attributes

static const std::string kConfigBranchName = "Config"
 
static const std::string kOfflineBranchName = "Event"
 
static const std::string kOfflineTreeName = "AugerOffline"
 

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

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

Private Member Functions

Status GetEventBranch ()
 

Private Attributes

TBranch * fBranch = nullptr
 
io::Config_ROOTfConfig = nullptr
 
TBranch * fConfigBranch = nullptr
 
std::ofstream * fConfigOut = nullptr
 
io::Event_ROOTfCurEvent = nullptr
 
unsigned int fCurEventNo = 0
 
io::StreamerSwitch fStreamerSwitch
 

Static Private Attributes

static const io::StreamerSwitch fgDefaultSwitch
 

Detailed Description

ROOT streamer for top level offline format.

Definition at line 32 of file OfflineROOTFile.h.

Constructor & Destructor Documentation

io::OfflineROOTFile::OfflineROOTFile ( )
default
OfflineROOTFile::OfflineROOTFile ( const std::string &  filename,
const Mode  mode = eRead,
utl::Branch *const  b = nullptr,
const io::StreamerSwitch streamerSwitch = fgDefaultSwitch 
)

Definition at line 45 of file OfflineROOTFile.cc.

References fConfig.

OfflineROOTFile::~OfflineROOTFile ( )
virtual

Definition at line 90 of file OfflineROOTFile.cc.

References fConfig, fConfigOut, and fCurEvent.

Member Function Documentation

void OfflineROOTFile::Close ( )
overridevirtual
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 io::VROOTFile::Open(), io::AiresShowerFile::Open(), io::VEventFile::VEventFile(), and io::VROOTFile::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.

Status OfflineROOTFile::FindEvent ( const unsigned int  eventId)
overridevirtual

On success returns event number in the file.

Implements io::VEventFile.

Definition at line 220 of file OfflineROOTFile.cc.

References io::eFail, and ERROR.

string OfflineROOTFile::GetConfig ( )

Return a string with the configuration corresponding to the run.

The configuration returned is a concatenation of all config files accessed during the run which produced the current OfflineROOTFile

Definition at line 252 of file OfflineROOTFile.cc.

References ERROR, exit, fConfig, fConfigBranch, io::Config_ROOT::fConfigString, io::VROOTFile::fTree, io::VROOTFile::GetTree(), INFO, kConfigBranchName, and kOfflineTreeName.

Referenced by Read(), and testOfflineEvent::testReadConfig().

Status OfflineROOTFile::GetEventBranch ( )
private
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().

int OfflineROOTFile::GetNEvents ( )
overridevirtual

Implements io::VEventFile.

Definition at line 241 of file OfflineROOTFile.cc.

References io::VROOTFile::fTree, and GetEventBranch().

Referenced by GotoPosition(), and Read().

string VROOTFile::GetRootMode ( const Mode  mode)
staticinherited
int VROOTFile::GetTree ( const std::string &  name)
protectedinherited

Definition at line 105 of file VROOTFile.cc.

References FATAL, io::VROOTFile::fFile, and io::VROOTFile::fTree.

Referenced by GetConfig(), and GetEventBranch().

Status OfflineROOTFile::GotoPosition ( const unsigned int  position)
overridevirtual

goto by position in the file

Implements io::VEventFile.

Definition at line 228 of file OfflineROOTFile.cc.

References io::eEOF, ERROR, io::eSuccess, fCurEventNo, and GetNEvents().

void OfflineROOTFile::Open ( const std::string &  filename,
const Mode  mode,
utl::Branch *const  b = nullptr 
)
overridevirtual

Reimplemented from io::VROOTFile.

Definition at line 63 of file OfflineROOTFile.cc.

References fConfigOut, utl::Branch::GetChild(), utl::Branch::GetData(), INFO, and io::VROOTFile::Open().

int VROOTFile::OpenROOTFile ( )
protectedinherited
Status OfflineROOTFile::Read ( evt::Event event)
overridevirtual
void OfflineROOTFile::Write ( const evt::Event event)
overridevirtual

Implements io::VEventFile.

Definition at line 189 of file OfflineROOTFile.cc.

References io::eFail, fCurEvent, io::VROOTFile::fTree, and GetEventBranch().

Referenced by testOfflineEvent::testWriteEvent().

Member Data Documentation

TBranch* io::OfflineROOTFile::fBranch = nullptr
private

Definition at line 78 of file OfflineROOTFile.h.

Referenced by GetEventBranch(), and Read().

io::Config_ROOT* io::OfflineROOTFile::fConfig = nullptr
private

Definition at line 81 of file OfflineROOTFile.h.

Referenced by GetConfig(), GetEventBranch(), OfflineROOTFile(), and ~OfflineROOTFile().

TBranch* io::OfflineROOTFile::fConfigBranch = nullptr
private

Definition at line 79 of file OfflineROOTFile.h.

Referenced by GetConfig(), and GetEventBranch().

std::ofstream* io::OfflineROOTFile::fConfigOut = nullptr
private

Definition at line 84 of file OfflineROOTFile.h.

Referenced by Close(), Open(), Read(), and ~OfflineROOTFile().

io::Event_ROOT* io::OfflineROOTFile::fCurEvent = nullptr
private

Definition at line 80 of file OfflineROOTFile.h.

Referenced by GetEventBranch(), Read(), Write(), and ~OfflineROOTFile().

unsigned int io::OfflineROOTFile::fCurEventNo = 0
private

Definition at line 76 of file OfflineROOTFile.h.

Referenced by GotoPosition(), and Read().

TFile* io::VROOTFile::fFile = nullptr
protectedinherited
std::string io::VEventFile::fFilename
protectedinherited
const StreamerSwitch OfflineROOTFile::fgDefaultSwitch
staticprivate

Definition at line 36 of file OfflineROOTFile.h.

Mode io::VEventFile::fMode = eRead
protectedinherited
io::StreamerSwitch io::OfflineROOTFile::fStreamerSwitch
private

Definition at line 82 of file OfflineROOTFile.h.

Referenced by GetEventBranch().

TTree* io::VROOTFile::fTree = nullptr
protectedinherited
const std::string OfflineROOTFile::kConfigBranchName = "Config"
static

Definition at line 71 of file OfflineROOTFile.h.

Referenced by GetConfig(), and GetEventBranch().

const std::string OfflineROOTFile::kOfflineBranchName = "Event"
static

Definition at line 70 of file OfflineROOTFile.h.

Referenced by GetEventBranch().

const std::string OfflineROOTFile::kOfflineTreeName = "AugerOffline"
static

Definition at line 69 of file OfflineROOTFile.h.

Referenced by GetConfig(), and GetEventBranch().


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

, generated on Tue Sep 26 2023.