1 #include <fwk/CentralConfig.h>
3 #include <utl/ErrorLogger.h>
4 #include <utl/SaveCurrentTDirectory.h>
5 #include <utl/Branch.h>
9 #include <io/Event_ROOT.h>
10 #include <io/Config_ROOT.h>
11 #include <io/Eye_ROOT.h>
12 #include <io/Telescope_ROOT.h>
13 #include <io/PMTSimData_ROOT.h>
14 #include <io/PixelSimData_ROOT.h>
15 #include <io/Pixel_ROOT.h>
16 #include <io/ShowerSimData_ROOT.h>
17 #include <io/PMTSimData_ROOT.h>
18 #include <io/StationSimData_ROOT.h>
19 #include <io/Station_ROOT.h>
21 #include <io/OfflineROOTFile.h>
23 #include <AugerEvent.h>
28 #include <TDataMember.h>
30 #include <TStreamerInfo.h>
49 fStreamerSwitch(streamerSwitch)
69 if (branch && *branch) {
74 dumpConfigB.
GetData(dumpFileName);
79 fConfigOut =
new ofstream(dumpFileName.c_str());
81 inf <<
"Dumping previous Offline config into output: " << dumpFileName;
129 ERROR (
"Could Not Read because Tree is NULL");
139 const Int_t persistent = 4;
143 Event_ROOT::Class()->GetDataMember(
"fRawEvent")->SetBit(persistent,
false);
146 AugerEvent::Class()->GetDataMember(
"Eyes")->SetBit(persistent,
false);
150 Telescope_ROOT::Class()->GetDataMember(
"fChannels")->SetBit(persistent,
false);
151 Pixel_ROOT::Class()->GetDataMember(
"fSimData")->SetBit(persistent,
false);
152 ShowerSimData_ROOT::Class()->GetDataMember(
"fFluorescencePhotons")->SetBit(persistent,
false);
153 ShowerSimData_ROOT::Class()->GetDataMember(
"fCherenkovPhotons")->SetBit(persistent,
false);
154 ShowerSimData_ROOT::Class()->GetDataMember(
"fCherenkovBeamPhotons")->SetBit(persistent,
false);
155 ShowerSimData_ROOT::Class()->GetDataMember(
"fCherenkovBeamProductionPhotons")->SetBit(persistent,
false);
159 Telescope_ROOT::Class()->GetDataMember(
"fSim")->SetBit(persistent,
false);
161 PMTSimData_ROOT::Class()->GetDataMember(
"fPETimeDistribution")->SetBit(persistent,
false);
163 PMTSimData_ROOT::Class()->GetDataMember(
"fBaseSignals")->SetBit(persistent,
false);
165 PMTSimData_ROOT::Class()->GetDataMember(
"fFilterSignals")->SetBit(persistent,
false);
167 StationSimData_ROOT::Class()->GetDataMember(
"fParticles")->SetBit(persistent,
false);
180 ERROR(
"Could Not Read branch");
222 ERROR(
"OfflineROOTFile::FindEvent not implemented");
231 ERROR(
"Trying to move past End of File");
247 return fTree->GetEntries();
255 ERROR(
"Could Not Read because Tree is NULL");
261 INFO(
"Could not find a configuration branch. "
262 "Is it possible this event was written with Offline version 1.3 or older?");
263 return "No configuration data available.";
std::string GetConfig()
Return a string with the configuration corresponding to the run.
int GetNEvents() override
std::ofstream * fConfigOut
switches to allow excluding certain parts of Event from streaming
Holds the run configuration data from CentralConfig.
Status GotoPosition(const unsigned int evNo) override
goto by position in the file
std::string GetConfig()
Get configuration in a string.
Mode
Available open modes.
#define INFO(message)
Macro for logging informational messages.
Branch GetChild(const std::string &childName) const
Get child of this Branch by child name.
OfflineROOTFile()=default
Event Class being actually streamed when using ROOT IO.
Base class to report exceptions in IO.
io::StreamerSwitch fStreamerSwitch
bool GetRaw() const
Get value of RAW switch.
bool GetSDSimPETimeDistribution() const
Get value of SDSimPETimeDistribution switch.
Class representing a document branch.
Status
Return code for seek operation.
bool GetFDSimPhotonTraces() const
Get value of FDSimPhotonTraces.
virtual ~OfflineROOTFile()
void Write(const evt::Event &event) override
void GetData(bool &b) const
Overloads of the GetData member template function.
static const std::string kConfigBranchName
int GetTree(const std::string &name)
bool GetSDSimPMTFilterTimeDistribution() const
Get value of SDPMTFilterTimeDistribution switch.
bool GetSDSimTankParticles() const
void Open(const std::string &filename, const Mode mode, utl::Branch *const b=nullptr) override
virtual void Open(const std::string &filename, const Mode mode=eRead, utl::Branch *const b=nullptr)
static const std::string kOfflineTreeName
static CentralConfig * GetInstance()
Use this the first time you get an instance of central configuration.
Status FindEvent(const unsigned int eventId) override
On success returns event number in the file.
static const std::string kOfflineBranchName
io::Event_ROOT * fCurEvent
Overwrite if exist and open for write.
io::Config_ROOT * fConfig
bool GetFDSimTelescope() const
Get value of FDSimPhotonTraces.
bool GetFDRaw() const
Get value of FDRaw switch.
static const io::StreamerSwitch fgDefaultSwitch
#define ERROR(message)
Macro for logging error messages.
bool GetSDSimPMTBaseTimeDistribution() const
Get value of SDSimPMTBaseTimeDistribution switch (from SD simulation)
std::string fConfigString
Status Read(evt::Event &event) override
Returns -1 if End Of File.