Read in a real or simulated events in various formats. More...
#include <EventFileReader.h>
Public Types | |
enum | ResultFlag { eSuccess, eFailure, eBreakLoop, eContinueLoop } |
Flag returned by module methods to the RunController. More... | |
enum | VersionInfoType { eFilename = 1, eRevisionNumber = 2, eDate = 3, eTime = 4, eLastEditor = 5 } |
Different types of version info that can be retrieved from GetVersionInfo. More... | |
Public Member Functions | |
EventFileReader () | |
fwk::VModule::ResultFlag | Finish () |
Finish: invoked at end of the run (NOT end of the event) More... | |
const std::string & | GetCurrentFilename () const |
int | GetEventsRead () const |
utl::Stopwatch & | GetStopwatch () |
const utl::Stopwatch & | GetStopwatch () const |
std::string | GetVersionInfo (const VersionInfoType v) const |
Retrieve different sorts of module version info. More... | |
fwk::VModule::ResultFlag | Init () |
Initialize: invoked at beginning of run (NOT beginning of event) More... | |
void | InitTiming () |
fwk::VModule::ResultFlag | Run (evt::Event &theEvent) |
Run: invoked once per event. More... | |
ResultFlag | RunWithTiming (evt::Event &event) |
~EventFileReader () | |
Static Public Member Functions | |
static std::string | GetResultFlagByName (const ResultFlag flag) |
Protected Types | |
enum | InfoLevel { eInfoNone = 0, eInfoFinal = 1, eInfoIntermediate = 2, eInfoDebug = 3 } |
Protected Attributes | |
int | fInfoLevel = 0 |
Private Member Functions | |
fwk::VModule::ResultFlag | OpenFiles () |
REGISTER_MODULE ("EventFileReaderOG", EventFileReader) | |
Private Attributes | |
utl::Branch | fBranch |
std::string | fCurrentFilename |
io::EventFileChain * | fEventFiles = nullptr |
int | fEventsRead = 0 |
bool | fIgnoreExpeptions = false |
bool | fReportFilenames = false |
Read in a real or simulated events in various formats.
This module is used to load real or simulated data from a variety of formats, and make the data therein available through the evt::Event. Based on the configuration you provide, it invokes all of the behind-the-scenes code which knows how to deal with various data formats.
The file type you wish to read is specified in the <InputFileType/>
element. It must be one of:
Offline
: native Offline format, capable of holding data and MC truthFDAS
: FD data acquisition format (read using FdEventLib)CDAS
: CDAS SD formatIoAuger
: Hybrid data format, containing both SD and FD data in DAS formatsAIRES
: files written by Aires air shower simulation packageSENECA
: files written by the SENECA air shower simulation packageCORSIKA
: files written by CORSIKA air shower simulation packageCONEX
: fles written by CONEX air shower simulation packageCONEXRandom
The name of one or more files to read can be specified in the <InputFilenames>
element. Multiple filenames should be space or carriage return delimited. For example:
<InputFilenames> file1.root file2.root file3.root </InputFilenames>
You can also use backtick expanded commands in the <InputFilenames>
element in order to generate filenames and/or paths automatically. For example, the following <InputFilenames>
element will cause the EventFileReader to suck in all files in the curent directory beginning with sd_id
and ending with root
.
<InputFilenames> `find . -name sd_id\*.root` </InputFilenames>
Here is another example of backtick expansion use. Suppose you are running a batch job, and want the EventFileReader to use a file which gets staged in a temporary area, with the path to the staging area specified by an environment variable $TEMPAREA
which gets set in the batch shell. You could then write something like this to get the correct path for the file:
<InputFilenames> `echo $TEMPAREA/my.file` </InputFilenames>
The EventFileReader may also be used to strip the configuration data from a file written in Offline format, and dump it into an xml file. To do this you would specify the Offline file of interest in the <InputFilenames>
element, and then add the <DumpConfig>
element to sepcify what name you want to give to the dumped configuration xml file:
For example, the following would extract configuration data from offline.root
and write it in offlineConfig.xml
:
<InputFilenames> offline.root </InputFilenames> <DumpConfig> offlineConfig.xml </DumpConfig>
For more information on how you can use configuration data, see the documentation for fwk::CentralConfig.
Definition at line 16 of file EventFileReader.h.
|
protectedinherited |
|
inherited |
Flag returned by module methods to the RunController.
Enumerator | |
---|---|
eSuccess |
Report success to RunController. |
eFailure |
Report failure to RunController, causing RunController to terminate execution. |
eBreakLoop |
Break current loop. It works for nested loops too! |
eContinueLoop |
Skip remaining modules in the current loop and continue with next iteration of the loop. |
|
inherited |
|
inline |
Definition at line 19 of file EventFileReader.h.
EventFileReader::~EventFileReader | ( | ) |
Definition at line 73 of file EventFileReader.cc.
|
virtual |
Finish: invoked at end of the run (NOT end of the event)
This method is for things that should be done at the end of the run (for example, closing files or writing out histograms) {You must override this method in your concrete module}
Implements fwk::VModule.
Definition at line 211 of file EventFileReader.cc.
References io::eSuccess, EventFileReaderOG::gStopwatch, and INFO.
const string & EventFileReader::GetCurrentFilename | ( | ) | const |
Definition at line 232 of file EventFileReader.cc.
|
inline |
Definition at line 27 of file EventFileReader.h.
References fEventsRead.
|
staticinherited |
Definition at line 8 of file VModule.cc.
References fwk::VModule::eBreakLoop, fwk::VModule::eContinueLoop, fwk::VModule::eFailure, and fwk::VModule::eSuccess.
Referenced by fwk::RunController::DoNextInSequence(), fwk::RunController::FinishBranch(), and fwk::RunController::InitBranch().
|
inlineinherited |
Definition at line 106 of file VModule.h.
References fwk::VModule::fStopwatch.
|
inlineinherited |
Definition at line 107 of file VModule.h.
References fwk::VModule::fStopwatch.
|
inherited |
Retrieve different sorts of module version info.
Definition at line 26 of file VModule.cc.
Referenced by fwk::CentralConfig::GetConfig(), ThresholdCalculatorKG::ThresholdCalculator::Init(), fdDoubleBumpFinder::FdDoubleBumpFinder::Init(), LaserGeneratorNA::LaserGenerator::Init(), LaserLightSimulatorNA::LaserLightSimulator::Init(), FdElectronicsSimulatorOG::FdElectronicsSimulator::Init(), TelescopeSimulatorKG::TelescopeSimulator::Init(), TelescopeSimulatorKG2::TelescopeSimulator::Init(), SdSimpleSimKG::SdSimpleSim::Init(), ShowerPhotonGeneratorOG::ShowerPhotonGenerator::Init(), and testRunController::testModuleVersionInfo().
|
virtual |
Initialize: invoked at beginning of run (NOT beginning of event)
This method is for things that should be done once at the beginning of a run (for example, booking histograms, performing calculations that need to be done only once, initializing parameters) {You must override this method in your concrete module}
Implements fwk::VModule.
Definition at line 80 of file EventFileReader.cc.
References io::eSuccess, utl::Branch::GetChild(), utl::Branch::GetFirstChild(), utl::Branch::GetNextSibling(), and utl::Branch::GetTopBranch().
|
inlineinherited |
Definition at line 95 of file VModule.h.
References fwk::VModule::fStopwatch, and utl::Stopwatch::Reset().
|
private |
Definition at line 103 of file EventFileReader.cc.
References io::eSuccess, and INFO.
|
private |
|
virtual |
Run: invoked once per event.
This method is for things that should be done once per event {You must override this method in your concrete module}
Implements fwk::VModule.
Definition at line 125 of file EventFileReader.cc.
References io::eAires, io::eCONEX, io::eCONEXRandom, io::eCorsika, io::eEndOfFiles, io::eEOF, io::eEVA, io::eFail, io::eRadioAERA, io::eRadioAERAroot, io::eREAS, io::eSELFAS, io::eSeneca, io::eSkipEvent, io::eSuccess, io::eZHAireS, file, evt::Header::GetId(), evt::Header::GetTime(), evt::Event::HasRawEvent(), INFO, and result.
|
inlineinherited |
Definition at line 98 of file VModule.h.
References fwk::VModule::fStopwatch, fwk::VModule::Run(), utl::Stopwatch::Start(), and utl::Stopwatch::Stop().
Referenced by fwk::RunController::DoNextInSequence().
|
private |
Definition at line 34 of file EventFileReader.h.
|
private |
Definition at line 37 of file EventFileReader.h.
|
private |
Definition at line 36 of file EventFileReader.h.
|
private |
Definition at line 38 of file EventFileReader.h.
Referenced by GetEventsRead().
|
private |
Definition at line 33 of file EventFileReader.h.
|
protectedinherited |
Definition at line 123 of file VModule.h.
Referenced by RdChannelASCIINoiseImporterRD::RdChannelASCIINoiseImporterRD::Init(), Rd2dLDFFitter::Rd2dLDFFitter::Init(), RdChannelNoiseImporter_AERA::RdChannelNoiseImporter_AERA::Init(), and Rd2dLDFFitter::Rd2dLDFFitter::Run().
|
private |
Definition at line 32 of file EventFileReader.h.