|
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. | |
Private Member Functions | |
| 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 | pass_name_ |
| Processing pass name. | |
| int | event_limit_ |
| Limit on events to process. | |
| int | min_events_ |
| When reading a file in, what's the first event to read. | |
| int | total_events_ |
| Number of events we'd like to produce independetly of the number of tries it would take. | |
| int | log_frequency_ |
| The frequency with which event info is printed. | |
| int | max_tries_ |
| Maximum number of attempts to make before giving up on an event. | |
| bool | skip_corrupted_input_files_ |
| allow the Process to skip input files that are corrupted | |
| StorageControl | storage_controller_ |
| Storage controller. | |
| std::vector< EventProcessor * > | sequence_ |
| Ordered list of EventProcessors to execute. | |
| Conditions | conditions_ |
| Set of ConditionsProviders. | |
| std::vector< std::string > | input_files_ |
| List of input files to process. | |
| std::vector< std::string > | output_files_ |
| List of output file names. | |
| int | compression_setting_ |
| Compression setting to pass to output files. | |
| std::vector< std::string > | drop_keep_rules_ |
| Set of drop/keep rules. | |
| int | run_for_generation_ {1} |
| Run number to use if generating events. | |
| std::string | histo_filename_ |
| Filename for histograms and other user products. | |
| const ldmx::EventHeader * | event_header_ {0} |
| Pointer to the current EventHeader, used for Conditions information. | |
| ldmx::RunHeader * | run_header_ {0} |
| Pointer to the current RunHeader, used for Conditions information. | |
| TFile * | histo_t_file_ {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 25 of file Process.cxx.
References framework::StorageControl::addRule(), compression_setting_, conditions_, config_, framework::Conditions::createConditionsObjectProvider(), drop_keep_rules_, event_header_, event_limit_, framework::config::Parameters::get(), histo_filename_, input_files_, log_frequency_, makeHistoDirectory(), max_tries_, min_events_, output_files_, pass_name_, performance_, run(), run_for_generation_, sequence_, framework::StorageControl::setDefaultKeep(), skip_corrupted_input_files_, storage_controller_, and total_events_.
| framework::Process::~Process | ( | ) |
Class Destructor.
Cleans up sequence of EventProcessors. These processors were created by ConfigurePython and should be deleted.
Definition at line 135 of file Process.cxx.
References histo_t_file_, performance_, and sequence_.
|
inline |
Get a reference to the conditions system.
Definition at line 78 of file Process.h.
References conditions_.
Referenced by framework::ConditionsObjectProvider::requestParentCondition().
|
inline |
Get the pointer to the current event header, if defined.
Definition at line 68 of file Process.h.
References event_header_.
Referenced by framework::Conditions::getConditionPtr().
|
inline |
Get the frequency with which the event information is printed.
Definition at line 84 of file Process.h.
References log_frequency_.
|
inline |
Get the processing pass label.
Definition at line 56 of file Process.h.
References pass_name_.
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 run_header_.
| 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 434 of file Process.cxx.
References event_header_, ldmx::EventHeader::getRun(), and run_for_generation_.
|
inline |
Access the storage control unit for this process.
Definition at line 109 of file Process.h.
References storage_controller_.
| TDirectory * framework::Process::makeHistoDirectory | ( | const std::string & | dirName | ) |
Construct a TDirectory* for the given module.
Definition at line 438 of file Process.cxx.
References openHistoFile().
Referenced by 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 467 of file Process.cxx.
References conditions_, framework::Conditions::onNewRun(), pass_name_, performance_, sequence_, ldmx::RunHeader::setStringParameter(), framework::performance::Tracker::start(), and framework::performance::Tracker::stop().
Referenced by run().
|
private |
File is begin closed.
Definition at line 554 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 540 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 445 of file Process.cxx.
References histo_filename_, and histo_t_file_.
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 502 of file Process.cxx.
References framework::performance::Tracker::endEvent(), log_frequency_, 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 event_limit_.
| void framework::Process::run | ( | ) |
Run the process.
Definition at line 149 of file Process.cxx.
References framework::performance::Tracker::absoluteStart(), framework::performance::Tracker::absoluteStop(), framework::EventFile::addDrop(), framework::NtupleManager::clear(), conditions_, config_, drop_keep_rules_, event_header_, event_limit_, framework::Event::getEventHeader(), framework::Event::getEventHeaderPtr(), framework::Event::getEventNumber(), framework::EventFile::getFileName(), framework::NtupleManager::getInstance(), ldmx::EventHeader::getRun(), framework::EventFile::getRunHeaderPtr(), input_files_, framework::EventFile::isCorrupted(), framework::StorageControl::keepEvent(), max_tries_, min_events_, newRun(), framework::EventFile::nextEvent(), framework::Event::onEndOfFile(), onFileClose(), onFileOpen(), framework::Conditions::onProcessStart(), output_files_, pass_name_, performance_, process(), framework::NtupleManager::reset(), framework::StorageControl::resetEventState(), run_for_generation_, run_header_, 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(), skip_corrupted_input_files_, framework::performance::Tracker::start(), framework::performance::Tracker::stop(), storage_controller_, total_events_, 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 event_header_.
|
private |
|
private |
|
private |
|
private |
|
private |
Pointer to the current EventHeader, used for Conditions information.
Definition at line 213 of file Process.h.
Referenced by getEventHeader(), getRunNumber(), Process(), run(), and setEventHeader().
|
private |
Limit on events to process.
Definition at line 157 of file Process.h.
Referenced by Process(), requestFinish(), and run().
|
private |
Filename for histograms and other user products.
Definition at line 210 of file Process.h.
Referenced by openHistoFile(), and Process().
|
private |
TFile for histograms and other user products.
Definition at line 219 of file Process.h.
Referenced by openHistoFile(), and ~Process().
|
private |
|
private |
The frequency with which event info is printed.
Definition at line 168 of file Process.h.
Referenced by getLogFrequency(), Process(), and process().
|
private |
|
private |
|
private |
|
private |
|
private |
class with calls backs to track performance measurements of software
Definition at line 222 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 207 of file Process.h.
Referenced by getRunNumber(), Process(), and run().
|
private |
Pointer to the current RunHeader, used for Conditions information.
Definition at line 216 of file Process.h.
Referenced by getRunHeader(), and run().
|
private |
Ordered list of EventProcessors to execute.
Definition at line 182 of file Process.h.
Referenced by newRun(), onFileClose(), onFileOpen(), Process(), process(), run(), and ~Process().
|
private |
|
private |
Storage controller.
Definition at line 179 of file Process.h.
Referenced by getStorageController(), Process(), and run().
|
private |