LDMX Software
|
Class which represents the process under execution. More...
#include <Process.h>
Public Member Functions | |
Process (const framework::config::Parameters &configuration) | |
Class constructor. | |
~Process () | |
Class Destructor. | |
const std::string & | getPassName () const |
Get the processing pass label. | |
int | getRunNumber () const |
Get the current run number or the run number to be used when initiating new events from the job. | |
const ldmx::EventHeader * | getEventHeader () const |
Get the pointer to the current event header, if defined. | |
const ldmx::RunHeader * | getRunHeader () const |
Get the pointer to the current run header, if defined. | |
Conditions & | getConditions () |
Get a reference to the conditions system. | |
int | getLogFrequency () const |
Get the frequency with which the event information is printed. | |
void | run () |
Run the process. | |
void | requestFinish () |
Request that the processing finish with this event. | |
TDirectory * | makeHistoDirectory (const std::string &dirName) |
Construct a TDirectory* for the given module. | |
TDirectory * | openHistoFile () |
Open a ROOT TFile to write histograms and TTrees. | |
StorageControl & | getStorageController () |
Access the storage control unit for this process. | |
void | setEventHeader (ldmx::EventHeader *h) |
Set the pointer to the current event header, used only for tests. | |
Static Public Member Functions | |
static Process | getDummy () |
Get a dummy process. | |
Private Member Functions | |
Process () | |
Private dummy constructor We hide it here because it shouldn't be used anywhere else. | |
bool | process (int n, int n_tries, Event &event) const |
Process the input event through the sequence of processors. | |
void | newRun (ldmx::RunHeader &header) |
Run through the processors and let them know that we are starting a new run. | |
void | onFileOpen (EventFile &file) const |
File is being opened. | |
void | onFileClose (EventFile &file) const |
File is begin closed. | |
enableLogging ("Process") | |
Turn on logging for our process. | |
Private Attributes | |
framework::config::Parameters | config_ |
The parameters used to configure this class. | |
std::string | passname_ |
Processing pass name. | |
int | eventLimit_ |
Limit on events to process. | |
int | totalEvents_ |
Number of events we'd like to produce independetly of the number of tries it would take. | |
int | logFrequency_ |
The frequency with which event info is printed. | |
int | maxTries_ |
Maximum number of attempts to make before giving up on an event. | |
bool | skipCorruptedInputFiles_ |
allow the Process to skip input files that are corrupted | |
StorageControl | storageController_ |
Storage controller. | |
std::vector< EventProcessor * > | sequence_ |
Ordered list of EventProcessors to execute. | |
Conditions | conditions_ |
Set of ConditionsProviders. | |
std::vector< std::string > | inputFiles_ |
List of input files to process. | |
std::vector< std::string > | outputFiles_ |
List of output file names. | |
int | compressionSetting_ |
Compression setting to pass to output files. | |
std::vector< std::string > | dropKeepRules_ |
Set of drop/keep rules. | |
int | runForGeneration_ {1} |
Run number to use if generating events. | |
std::string | histoFilename_ |
Filename for histograms and other user products. | |
const ldmx::EventHeader * | eventHeader_ {0} |
Pointer to the current EventHeader, used for Conditions information. | |
ldmx::RunHeader * | runHeader_ {0} |
Pointer to the current RunHeader, used for Conditions information. | |
TFile * | histoTFile_ {0} |
TFile for histograms and other user products. | |
performance::Tracker * | performance_ {0} |
class with calls backs to track performance measurements of software | |
framework::Process::Process | ( | const framework::config::Parameters & | configuration | ) |
Class constructor.
configuration | Parameters to configure process with |
Definition at line 23 of file Process.cxx.
References framework::StorageControl::addRule(), compressionSetting_, conditions_, config_, framework::EventProcessor::configure(), framework::Conditions::createConditionsObjectProvider(), framework::PluginFactory::createEventProcessor(), framework::EventProcessor::createHistograms(), dropKeepRules_, eventHeader_, eventLimit_, framework::EventProcessor::getHistoDirectory(), framework::PluginFactory::getInstance(), framework::config::Parameters::getParameter(), histoFilename_, inputFiles_, logFrequency_, makeHistoDirectory(), maxTries_, outputFiles_, passname_, performance_, run(), runForGeneration_, sequence_, framework::StorageControl::setDefaultKeep(), skipCorruptedInputFiles_, storageController_, and totalEvents_.
framework::Process::~Process | ( | ) |
Class Destructor.
Cleans up sequence of EventProcessors. These processors were created by ConfigurePython and should be deleted.
Definition at line 126 of file Process.cxx.
References histoTFile_, performance_, and sequence_.
|
inlineprivate |
Private dummy constructor We hide it here because it shouldn't be used anywhere else.
Definition at line 133 of file Process.h.
Referenced by getDummy().
|
inline |
Get a reference to the conditions system.
Definition at line 78 of file Process.h.
References conditions_.
Referenced by framework::EventProcessor::getConditions(), and framework::ConditionsObjectProvider::requestParentCondition().
|
inlinestatic |
Get a dummy process.
This function returns an instance of this class without any configuration. This is only helpful in the use case where the user is writing a test for a processor and needs to pass a Process object to the processor's constructor.
Definition at line 126 of file Process.h.
References Process().
|
inline |
Get the pointer to the current event header, if defined.
Definition at line 68 of file Process.h.
References eventHeader_.
Referenced by framework::Conditions::getConditionPtr(), and framework::EventProcessor::getEventHeader().
|
inline |
Get the frequency with which the event information is printed.
Definition at line 84 of file Process.h.
References logFrequency_.
Referenced by framework::EventProcessor::getLogFrequency().
|
inline |
Get the processing pass label.
Definition at line 56 of file Process.h.
References passname_.
Referenced by framework::RandomNumberSeedService::onNewRun().
|
inline |
Get the pointer to the current run header, if defined.
Definition at line 73 of file Process.h.
References runHeader_.
int framework::Process::getRunNumber | ( | ) | const |
Get the current run number or the run number to be used when initiating new events from the job.
Definition at line 420 of file Process.cxx.
References eventHeader_, ldmx::EventHeader::getRun(), and runForGeneration_.
Referenced by framework::EventProcessor::getRunNumber().
|
inline |
Access the storage control unit for this process.
Definition at line 109 of file Process.h.
References storageController_.
Referenced by framework::EventProcessor::setStorageHint().
TDirectory * framework::Process::makeHistoDirectory | ( | const std::string & | dirName | ) |
Construct a TDirectory* for the given module.
Definition at line 424 of file Process.cxx.
References openHistoFile().
Referenced by framework::EventProcessor::getHistoDirectory(), and Process().
|
private |
Run through the processors and let them know that we are starting a new run.
[in] | header | RunHeader for the new run |
Definition at line 452 of file Process.cxx.
References conditions_, framework::Conditions::onNewRun(), performance_, sequence_, framework::performance::Tracker::start(), and framework::performance::Tracker::stop().
Referenced by run().
|
private |
File is begin closed.
Definition at line 539 of file Process.cxx.
References performance_, sequence_, framework::performance::Tracker::start(), and framework::performance::Tracker::stop().
Referenced by run().
|
private |
File is being opened.
Definition at line 525 of file Process.cxx.
References performance_, sequence_, framework::performance::Tracker::start(), and framework::performance::Tracker::stop().
Referenced by run().
TDirectory * framework::Process::openHistoFile | ( | ) |
Open a ROOT TFile to write histograms and TTrees.
Definition at line 431 of file Process.cxx.
References histoFilename_, and histoTFile_.
Referenced by makeHistoDirectory().
|
private |
Process the input event through the sequence of processors.
The input counters (for events and tries) are only used to print the status.
[in] | n | counter for number of events processed |
[in] | n_tries | counter for number of tries on current event |
[in,out] | event | reference to event we are going to process |
Definition at line 484 of file Process.cxx.
References framework::performance::Tracker::end_event(), logFrequency_, performance_, sequence_, framework::performance::Tracker::start(), and framework::performance::Tracker::stop().
Referenced by run().
|
inline |
Request that the processing finish with this event.
Definition at line 94 of file Process.h.
References eventLimit_.
void framework::Process::run | ( | ) |
Run the process.
Definition at line 140 of file Process.cxx.
References framework::performance::Tracker::absolute_start(), framework::performance::Tracker::absolute_stop(), framework::EventFile::addDrop(), framework::NtupleManager::clear(), conditions_, config_, dropKeepRules_, eventHeader_, eventLimit_, framework::Event::getEventHeader(), framework::Event::getEventHeaderPtr(), framework::Event::getEventNumber(), framework::EventFile::getFileName(), framework::NtupleManager::getInstance(), ldmx::EventHeader::getRun(), framework::EventFile::getRunHeaderPtr(), inputFiles_, framework::EventFile::isCorrupted(), framework::StorageControl::keepEvent(), maxTries_, newRun(), framework::EventFile::nextEvent(), framework::Event::onEndOfFile(), onFileClose(), onFileOpen(), framework::Conditions::onProcessStart(), outputFiles_, passname_, performance_, process(), framework::NtupleManager::reset(), framework::StorageControl::resetEventState(), runForGeneration_, runHeader_, sequence_, framework::logging::Formatter::set(), ldmx::EventHeader::setEventNumber(), ldmx::RunHeader::setNumTries(), ldmx::EventHeader::setRun(), ldmx::RunHeader::setRunEnd(), ldmx::RunHeader::setRunStart(), ldmx::EventHeader::setTimestamp(), framework::EventFile::setupEvent(), skipCorruptedInputFiles_, framework::performance::Tracker::start(), framework::performance::Tracker::stop(), storageController_, totalEvents_, framework::EventFile::updateParent(), framework::EventFile::writeRunHeader(), and framework::EventFile::writeRunTree().
Referenced by Process().
|
inline |
Set the pointer to the current event header, used only for tests.
Definition at line 114 of file Process.h.
References eventHeader_.
|
private |
|
private |
|
private |
|
private |
|
private |
Pointer to the current EventHeader, used for Conditions information.
Definition at line 228 of file Process.h.
Referenced by getEventHeader(), getRunNumber(), Process(), run(), and setEventHeader().
|
private |
Limit on events to process.
Definition at line 175 of file Process.h.
Referenced by Process(), requestFinish(), and run().
|
private |
Filename for histograms and other user products.
Definition at line 225 of file Process.h.
Referenced by openHistoFile(), and Process().
|
private |
TFile for histograms and other user products.
Definition at line 234 of file Process.h.
Referenced by openHistoFile(), and ~Process().
|
private |
|
private |
The frequency with which event info is printed.
Definition at line 183 of file Process.h.
Referenced by getLogFrequency(), Process(), and process().
|
private |
|
private |
|
private |
Processing pass name.
Definition at line 172 of file Process.h.
Referenced by getPassName(), Process(), and run().
|
private |
class with calls backs to track performance measurements of software
Definition at line 237 of file Process.h.
Referenced by newRun(), onFileClose(), onFileOpen(), Process(), process(), run(), and ~Process().
|
private |
Run number to use if generating events.
Definition at line 222 of file Process.h.
Referenced by getRunNumber(), Process(), and run().
|
private |
Pointer to the current RunHeader, used for Conditions information.
Definition at line 231 of file Process.h.
Referenced by getRunHeader(), and run().
|
private |
Ordered list of EventProcessors to execute.
Definition at line 197 of file Process.h.
Referenced by newRun(), onFileClose(), onFileOpen(), Process(), process(), run(), and ~Process().
|
private |
|
private |
Storage controller.
Definition at line 194 of file Process.h.
Referenced by getStorageController(), Process(), and run().
|
private |