![]() |
ATLAS Offline Software
|
#include <Worker.h>
Public Member Functions | |
| void | testInvariant () const |
| effects: test the invariant of this object guarantee: no-fail | |
| virtual | ~Worker () |
| effects: standard destructor guarantee: no-fail | |
| void | addOutput (TObject *output_swallow) final override |
| effects: add an object to the output. | |
| void | addOutputList (const std::string &name, TObject *output_swallow) override |
| effects: add a given object to the output. | |
| TObject * | getOutputHist (const std::string &name) const final override |
| get the output histogram with the given name | |
| TFile * | getOutputFile (const std::string &label) const override |
| effects: get the output file that goes into the dataset with the given label. | |
| TFile * | getOutputFileNull (const std::string &label) const override |
| effects: get the output file that goes into the dataset with the given label. | |
| ::StatusCode | addTree (const TTree &tree, const std::string &stream) final override |
| effects: adds a tree to an output file specified by the stream/label failures: Incorrect stream/label specified, called at the wrong time note: See getOutputFile for failure types... | |
| TTree * | getOutputTree (const std::string &name, const std::string &stream) const final override |
| effects: get the tree that was added to an output file earlier failures: Tree doesn't exist | |
| const SH::MetaObject * | metaData () const override |
| description: the sample meta-data we are working on guarantee: no-fail invariant: metaData != 0 rationale: this can be used for accessing sample meta-data | |
| TTree * | tree () const override |
| description: the tree we are running on guarantee: no-fail | |
| Long64_t | treeEntry () const override |
| description: the entry in the tree we are reading guarantee: no-fail | |
| TFile * | inputFile () const override |
| description: the file we are reading the current tree from guarantee: no-fail | |
| std::string | inputFileName () const override |
| the name of the file we are reading the current tree from, without the path component | |
| TTree * | triggerConfig () const override |
| description: the trigger config tree from the input file, or NULL if we did not find it guarantee: strong failures: i/o errors | |
| xAOD::TEvent * | xaodEvent () const override |
| description: the xAOD event and store guarantee: strong failures: out of memory I failures: TEventSvc not configured postcondition: result != 0 | |
| xAOD::TStore * | xaodStore () const override |
| EL::Algorithm * | getAlg (const std::string &name) const override |
| effects: returns the algorithms with the given name or NULL if there is none guarantee: strong failures: out of memory II | |
| void | skipEvent () override |
| effects: skip the current event, i.e. | |
| virtual bool | filterPassed () const noexcept final override |
| whether the current algorithm passed its filter criterion for the current event | |
| virtual void | setFilterPassed (bool val_filterPassed) noexcept final override |
| set the value of filterPassed | |
| Worker () | |
| standard constructor | |
| ::StatusCode | directExecute (const SH::SamplePtr &sample, const Job &job, const std::string &location, const SH::MetaObject &options) |
| run the job | |
| ::StatusCode | batchExecute (unsigned job_id, const char *confFile) |
| effects: do what is needed to execute the given job segment guarantee: basic failures: job specific | |
| ::StatusCode | gridExecute (const std::string &sampleName, Long64_t SkipEvents, Long64_t nEventsPerJob) |
Protected Member Functions | |
| void | setMetaData (const SH::MetaObject *val_metaData) |
| set the metaData | |
| void | setOutputHist (const std::string &val_outputTarget) |
| set the histogram output list | |
| void | setSegmentName (const std::string &val_segmentName) |
| set the segment name | |
| void | setJobConfig (JobConfig &&jobConfig) |
| set the JobConfig | |
| ::StatusCode | initialize () |
| initialize the worker | |
| ::StatusCode | processInputs () |
| process all the inputs | |
| ::StatusCode | finalize () |
| finalize the worker | |
| ::StatusCode | processEvents (EventRange &eventRange) override |
| process the given event range | |
| ::StatusCode | openInputFile (const std::string &inputFileUrl) override |
| open the given input file without processing it | |
| ::StatusCode | addOutputStream (const std::string &label, Detail::OutputStreamData output) |
| effects: add another output file guarantee: strong failures: low level errors II failures: label already used | |
| Long64_t | inputFileNumEntries () const override |
| the number of events in the input file | |
| uint64_t | eventsProcessed () const noexcept |
| the number of events that have been processed | |
Private Types | |
| enum | GridErrorCodes { EC_FAIL = 220 , EC_ABORT = 221 , EC_NOTFINISHED = 222 , EC_BADINPUT = 223 } |
| typedef std::map< std::string, TH1 * >::const_iterator | OutputHistMapIter |
| the output map | |
| typedef std::map< std::pair< std::string, std::string >, TTree * >::const_iterator | OutputTreeMapIter |
| description: the list of output trees | |
Private Member Functions | |
| void | gridCreateJobSummary (uint64_t eventsProcessed) |
| void | addOutput (std::unique_ptr< TObject > output) |
| add the given output object to the histogram output stream | |
Static Private Member Functions | |
| static bool | fileOpenErrorFilter (int level, bool, const char *, const char *) |
| Error handler for file opening. | |
Private Attributes | |
| std::map< std::string, TH1 * > | m_outputHistMap |
| std::map< std::pair< std::string, std::string >, TTree * > | m_outputTreeMap |
| std::vector< std::unique_ptr< Detail::Module > > | m_modules |
| the list of modules we hold | |
| bool | m_newInputFile {false} |
| whether this is a new input file (i.e. | |
| std::string | m_outputTarget |
| the target file to which we will write the histogram output | |
| std::string | m_segmentName |
| the name of the segment we are processing | |
| bool | m_algorithmsInitialized {false} |
| whether the algorithms are initialized | |
| bool | m_firstEvent {true} |
| whether we are still to process the first event | |
| std::vector< asg::AsgComponentConfig > | m_moduleConfig |
| the module configurations we use | |
| std::vector< Detail::AlgorithmData > | m_algs |
| the list of algorithms | |
| std::string | m_inputFileUrl |
| the input file url of the currently opened file | |
| std::unique_ptr< TFile > | m_inputFile |
| the input file pointer of the currently opened filed | |
| TTree * | m_inputTree {nullptr} |
| the (main) tree in the input file | |
| uint64_t | m_inputTreeEntry {0} |
| the entry in the input tree we are currently looking at | |
| bool | m_skipEvent = false |
| whether we are skipping the current event | |
| const SH::MetaObject * | m_metaData {nullptr} |
| the meta-data we use | |
| uint64_t | m_eventsProcessed {0} |
| the number of events that have been processed | |
| OutputStreamData * | m_histOutput {nullptr} |
| the histogram output stream | |
| std::unique_ptr< TTree > | m_jobStats |
| Tree saving per-job statistics information. | |
| xAOD::TEvent * | m_tevent {nullptr} |
| the TEvent structure, if we use one | |
| xAOD::TStore * | m_tstore {nullptr} |
| the TStore structure, if we use one | |
| asg::SgTEvent * | m_evtStore {nullptr} |
| the SgTEvent structure, if we use one | |
| Worker * | m_worker {nullptr} |
| the worker (to pass on to the algorithms) | |
| std::map< std::string, std::shared_ptr< Detail::OutputStreamData > > | m_outputs |
| the list of output files | |
| BatchJob * | m_batchJob = nullptr |
| the BatchJob configuration (if used) | |
|
private |
|
private |
|
private |
| Enumerator | |
|---|---|
| EC_FAIL | |
| EC_ABORT | |
| EC_NOTFINISHED | |
| EC_BADINPUT | |
|
virtual |
| EL::Worker::Worker | ( | ) |
standard constructor
Definition at line 324 of file Worker.cxx.
|
inherited |
add the given output object to the histogram output stream
Definition at line 33 of file ModuleData.cxx.
|
finaloverridevirtual |
effects: add an object to the output.
the worker takes over ownership of the object, but the caller may maintain a reference to it guarantee: basic, argument is always swallowed failures: out of memory I requires: output_swallow != 0 warning: so far I placed no requirements on the output objects. I may do that at a later stage though, possibly breaking existing code.
Implements EL::IHistogramWorker.
Definition at line 88 of file Worker.cxx.
|
overridevirtual |
effects: add a given object to the output.
instead of trying to merge the outputs from multiple jobs the output file will contain a TList of the given name with the objects from all the output. guarantee: basic, argument is always swallowed failures: out of memory II requires: output_swallow != 0 rationale: This was primarily build to allow the GRL output to be collected from EventLoop jobs, but it can be used for any kind of output that can not or should not be merged.
Implements EL::IWorker.
Definition at line 102 of file Worker.cxx.
|
protected |
effects: add another output file guarantee: strong failures: low level errors II failures: label already used
Definition at line 739 of file Worker.cxx.
|
finaloverridevirtual |
effects: adds a tree to an output file specified by the stream/label failures: Incorrect stream/label specified, called at the wrong time note: See getOutputFile for failure types...
Implements EL::ITreeWorker.
Definition at line 155 of file Worker.cxx.
| StatusCode EL::Worker::batchExecute | ( | unsigned | job_id, |
| const char * | confFile ) |
effects: do what is needed to execute the given job segment guarantee: basic failures: job specific
Definition at line 832 of file Worker.cxx.
| StatusCode EL::Worker::directExecute | ( | const SH::SamplePtr & | sample, |
| const Job & | job, | ||
| const std::string & | location, | ||
| const SH::MetaObject & | options ) |
run the job
Definition at line 787 of file Worker.cxx.
|
protectednoexcept |
the number of events that have been processed
Definition at line 778 of file Worker.cxx.
|
staticprivate |
Error handler for file opening.
Definition at line 638 of file Worker.cxx.
|
finaloverridevirtualnoexcept |
whether the current algorithm passed its filter criterion for the current event
Implements EL::IFilterWorker.
Definition at line 306 of file Worker.cxx.
|
protected |
finalize the worker
This method ought to be called after all events have been processed. It is meant to ensure that the job is ended properly and all outputs are written out and files are closed.
Definition at line 507 of file Worker.cxx.
|
overridevirtual |
effects: returns the algorithms with the given name or NULL if there is none guarantee: strong failures: out of memory II
Implements EL::IWorker.
Definition at line 283 of file Worker.cxx.
|
overridevirtual |
effects: get the output file that goes into the dataset with the given label.
this dataset has to be registered before the job is submitted. typically that happens in the doSetupJob method. guarantee: strong failures: no dataset with the given label postcondition: result != 0 note: the default value for the argument corresponds to the default label value in the OutputInfo class.
Implements EL::IWorker.
Definition at line 131 of file Worker.cxx.
|
overridevirtual |
effects: get the output file that goes into the dataset with the given label.
this dataset has to be registered before the job is submitted. typically that happens in the doSetupJob method. guarantee: strong failures: internal errors note: the default value for the argument corresponds to the default label value in the OutputInfo class. rationale: this method was added to support optional output files, i.e.: the algorithm leaves it to the user whether or not the output file gets configured. then the algorithm just checks whether the output file is there. if so it fills it, otherwise it ignores it.
Implements EL::IWorker.
Definition at line 143 of file Worker.cxx.
|
finaloverridevirtual |
get the output histogram with the given name
This is mostly meant, so that I can emulate the Athena histogram mechanism.
Implements EL::IHistogramWorker.
Definition at line 119 of file Worker.cxx.
|
finaloverridevirtual |
effects: get the tree that was added to an output file earlier failures: Tree doesn't exist
Implements EL::ITreeWorker.
Definition at line 177 of file Worker.cxx.
|
private |
| StatusCode EL::Worker::gridExecute | ( | const std::string & | sampleName, |
| Long64_t | SkipEvents, | ||
| Long64_t | nEventsPerJob ) |
Definition at line 907 of file Worker.cxx.
|
protected |
initialize the worker
This method ought to be called after the options on the worker are set and before any events are processed. It is meant to make sure everything is ready and set up for event processing.
Definition at line 377 of file Worker.cxx.
|
overridevirtual |
description: the file we are reading the current tree from guarantee: no-fail
Implements EL::IWorker.
Definition at line 227 of file Worker.cxx.
|
overridevirtual |
the name of the file we are reading the current tree from, without the path component
Implements EL::IWorker.
Definition at line 236 of file Worker.cxx.
|
overrideprotectedvirtual |
the number of events in the input file
Implements EL::Detail::IInputModuleActions.
Definition at line 764 of file Worker.cxx.
|
overridevirtual |
description: the sample meta-data we are working on guarantee: no-fail invariant: metaData != 0 rationale: this can be used for accessing sample meta-data
Implements EL::IWorker.
Definition at line 200 of file Worker.cxx.
|
overrideprotectedvirtual |
open the given input file without processing it
This is mostly to allow the driver to query the number of events in the input file without processing it, usually to determine the range of events to process.
Implements EL::Detail::IInputModuleActions.
Definition at line 663 of file Worker.cxx.
|
overrideprotectedvirtual |
process the given event range
This will update eventRange if the end is set to eof
Implements EL::Detail::IInputModuleActions.
Definition at line 560 of file Worker.cxx.
|
protected |
process all the inputs
This method ought to be called after initialize and before finalize. It will rely on the defined modules to steer it to the files and events it ought to process.
Definition at line 493 of file Worker.cxx.
|
finaloverridevirtualnoexcept |
set the value of filterPassed
Implements EL::IFilterWorker.
Definition at line 315 of file Worker.cxx.
|
protected |
set the JobConfig
This takes care of adding the algorithms, etc. (only algorithms for now, 03 Feb 17).
Note the rvalue calling convention here: Algorithms are objects that get modified, so if you use them more than once you need to copy/clone them. However, in practice no driver should need that (though many do for now, 03 Feb 17), as drivers generally stream the JobConfig in for one-time use.
Definition at line 365 of file Worker.cxx.
|
protected |
set the metaData
Definition at line 334 of file Worker.cxx.
|
protected |
|
protected |
|
overridevirtual |
effects: skip the current event, i.e.
skip the rest of the algorithms for this event guarantee: no-fail rationale: if you have an analysis strategy in which you divide work into multiple algorithms you may want to have dedicated algorithms for event selection that then skip later algorithms that fill histograms
Implements EL::IWorker.
Definition at line 297 of file Worker.cxx.
| void EL::Worker::testInvariant | ( | ) | const |
effects: test the invariant of this object guarantee: no-fail
Definition at line 68 of file Worker.cxx.
|
overridevirtual |
description: the tree we are running on guarantee: no-fail
Implements EL::IWorker.
Definition at line 209 of file Worker.cxx.
|
overridevirtual |
description: the entry in the tree we are reading guarantee: no-fail
Implements EL::IWorker.
Definition at line 218 of file Worker.cxx.
|
overridevirtual |
description: the trigger config tree from the input file, or NULL if we did not find it guarantee: strong failures: i/o errors
Implements EL::IWorker.
Definition at line 250 of file Worker.cxx.
|
overridevirtual |
description: the xAOD event and store guarantee: strong failures: out of memory I failures: TEventSvc not configured postcondition: result != 0
Implements EL::IWorker.
Definition at line 259 of file Worker.cxx.
|
overridevirtual |
Implements EL::IWorker.
Definition at line 271 of file Worker.cxx.
|
private |
|
inherited |
the list of algorithms
Definition at line 66 of file ModuleData.h.
|
inherited |
the BatchJob configuration (if used)
Definition at line 112 of file ModuleData.h.
|
inherited |
|
inherited |
|
private |
|
inherited |
|
inherited |
the input file pointer of the currently opened filed
Definition at line 72 of file ModuleData.h.
|
inherited |
the input file url of the currently opened file
Definition at line 69 of file ModuleData.h.
|
inherited |
|
inherited |
the entry in the input tree we are currently looking at
Definition at line 79 of file ModuleData.h.
|
inherited |
Tree saving per-job statistics information.
Definition at line 94 of file ModuleData.h.
|
inherited |
|
private |
|
private |
|
private |
|
private |
|
inherited |
the list of output files
Definition at line 109 of file ModuleData.h.
|
private |
|
private |
|
private |
|
inherited |
whether we are skipping the current event
Definition at line 82 of file ModuleData.h.
|
inherited |
|
inherited |
|
inherited |
the worker (to pass on to the algorithms)
Definition at line 106 of file ModuleData.h.