ROOT streamer for top level offline format. More...
#include <OfflineROOTFile.h>
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_ROOT * | fConfig = nullptr |
TBranch * | fConfigBranch = nullptr |
std::ofstream * | fConfigOut = nullptr |
io::Event_ROOT * | fCurEvent = nullptr |
unsigned int | fCurEventNo = 0 |
io::StreamerSwitch | fStreamerSwitch |
Static Private Attributes | |
static const io::StreamerSwitch | fgDefaultSwitch |
ROOT streamer for top level offline format.
Definition at line 32 of file OfflineROOTFile.h.
|
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.
|
virtual |
Definition at line 90 of file OfflineROOTFile.cc.
References fConfig, fConfigOut, and fCurEvent.
|
overridevirtual |
Reimplemented from io::VROOTFile.
Definition at line 104 of file OfflineROOTFile.cc.
References io::VROOTFile::Close(), and fConfigOut.
Referenced by testOfflineEvent::testEventTriggerValues(), testOfflineEvent::testHeaderValues(), testOfflineEvent::testPMTCalibDataValues(), testOfflineEvent::testPMTRecDataValues(), testOfflineEvent::testPMTSimDataValues(), testOfflineEvent::testPMTValues(), testOfflineEvent::testReadBack(), testOfflineEvent::testStationCalibDataValues(), testOfflineEvent::testStationGPSDataValues(), testOfflineEvent::testStationRecDataValues(), testOfflineEvent::testStationSimDataValues(), testOfflineEvent::testStationTriggerValues(), testOfflineEvent::testStationValues(), and testOfflineEvent::testWriteEvent().
|
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().
|
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.
|
overridevirtual |
On success returns event number in the file.
Implements io::VEventFile.
Definition at line 220 of file OfflineROOTFile.cc.
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().
|
private |
Definition at line 117 of file OfflineROOTFile.cc.
References io::eAppend, io::eFail, io::eRead, ERROR, io::eSuccess, fBranch, fConfig, fConfigBranch, io::Config_ROOT::fConfigString, fCurEvent, io::VROOTFile::fFile, io::VEventFile::fMode, fStreamerSwitch, io::VROOTFile::fTree, fwk::CentralConfig::GetConfig(), io::StreamerSwitch::GetFDRaw(), io::StreamerSwitch::GetFDSimPhotonTraces(), io::StreamerSwitch::GetFDSimTelescope(), fwk::CentralConfig::GetInstance(), io::StreamerSwitch::GetRaw(), io::StreamerSwitch::GetSDSimPETimeDistribution(), io::StreamerSwitch::GetSDSimPMTBaseTimeDistribution(), io::StreamerSwitch::GetSDSimPMTFilterTimeDistribution(), io::StreamerSwitch::GetSDSimTankParticles(), io::VROOTFile::GetTree(), kConfigBranchName, kOfflineBranchName, and kOfflineTreeName.
Referenced by GetNEvents(), Read(), and Write().
|
inlineinherited |
Definition at line 54 of file VEventFile.h.
References io::VEventFile::fFilename.
Referenced by io::EventFile::GetFilename().
|
overridevirtual |
Implements io::VEventFile.
Definition at line 241 of file OfflineROOTFile.cc.
References io::VROOTFile::fTree, and GetEventBranch().
Referenced by GotoPosition(), and Read().
|
staticinherited |
Definition at line 123 of file VROOTFile.cc.
References io::eAppend, io::eNew, and io::eWrite.
Referenced by io::FDasEventFile::Open(), io::VROOTFile::OpenROOTFile(), and io::FDasEventFile::Write().
|
protectedinherited |
Definition at line 105 of file VROOTFile.cc.
References FATAL, io::VROOTFile::fFile, and io::VROOTFile::fTree.
Referenced by GetConfig(), and GetEventBranch().
|
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().
|
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().
|
protectedinherited |
Definition at line 69 of file VROOTFile.cc.
References io::VROOTFile::Close(), io::VROOTFile::fFile, io::VEventFile::fFilename, io::VEventFile::fMode, and io::VROOTFile::GetRootMode().
Referenced by io::VROOTFile::Open(), and io::VROOTFile::VROOTFile().
|
overridevirtual |
Returns -1 if End Of File.
Implements io::VEventFile.
Definition at line 200 of file OfflineROOTFile.cc.
References io::eEOF, io::eFail, io::eSuccess, fBranch, fConfigOut, fCurEvent, fCurEventNo, io::VROOTFile::fTree, GetConfig(), GetEventBranch(), and GetNEvents().
Referenced by testOfflineEvent::testEventTriggerValues(), testOfflineEvent::testHeaderValues(), testOfflineEvent::testPMTCalibDataValues(), testOfflineEvent::testPMTRecDataValues(), testOfflineEvent::testPMTSimDataValues(), testOfflineEvent::testPMTValues(), testOfflineEvent::testReadBack(), testOfflineEvent::testStationCalibDataValues(), testOfflineEvent::testStationGPSDataValues(), testOfflineEvent::testStationRecDataValues(), testOfflineEvent::testStationSimDataValues(), testOfflineEvent::testStationTriggerValues(), and testOfflineEvent::testStationValues().
|
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().
|
private |
Definition at line 78 of file OfflineROOTFile.h.
Referenced by GetEventBranch(), and Read().
|
private |
Definition at line 81 of file OfflineROOTFile.h.
Referenced by GetConfig(), GetEventBranch(), OfflineROOTFile(), and ~OfflineROOTFile().
|
private |
Definition at line 79 of file OfflineROOTFile.h.
Referenced by GetConfig(), and GetEventBranch().
|
private |
Definition at line 84 of file OfflineROOTFile.h.
Referenced by Close(), Open(), Read(), and ~OfflineROOTFile().
|
private |
Definition at line 80 of file OfflineROOTFile.h.
Referenced by GetEventBranch(), Read(), Write(), and ~OfflineROOTFile().
|
private |
Definition at line 76 of file OfflineROOTFile.h.
Referenced by GotoPosition(), and Read().
|
protectedinherited |
Definition at line 45 of file VROOTFile.h.
Referenced by io::VROOTFile::Close(), GetEventBranch(), io::VROOTFile::GetTree(), io::VROOTFile::OpenROOTFile(), and io::VROOTFile::~VROOTFile().
|
protectedinherited |
Definition at line 74 of file VEventFile.h.
Referenced by io::VEventFile::GetFilename(), io::FDasEventFile::Open(), io::AiresShowerFile::Open(), io::VROOTFile::OpenROOTFile(), io::AiresShowerFile::Read(), io::VROOTFile::VROOTFile(), and io::FDasEventFile::Write().
|
staticprivate |
Definition at line 36 of file OfflineROOTFile.h.
Definition at line 75 of file VEventFile.h.
Referenced by io::VROOTFile::Close(), GetEventBranch(), io::FDasEventFile::Open(), io::VROOTFile::OpenROOTFile(), io::IoAugerEventFile::Write(), and io::FDasEventFile::Write().
|
private |
Definition at line 82 of file OfflineROOTFile.h.
Referenced by GetEventBranch().
|
protectedinherited |
Definition at line 46 of file VROOTFile.h.
Referenced by io::VROOTFile::Close(), GetConfig(), GetEventBranch(), GetNEvents(), io::VROOTFile::GetTree(), Read(), and Write().
|
static |
Definition at line 71 of file OfflineROOTFile.h.
Referenced by GetConfig(), and GetEventBranch().
|
static |
Definition at line 70 of file OfflineROOTFile.h.
Referenced by GetEventBranch().
|
static |
Definition at line 69 of file OfflineROOTFile.h.
Referenced by GetConfig(), and GetEventBranch().