5#ifndef EVENT_LOOP_WORKER_HH
6#define EVENT_LOOP_WORKER_HH
18#include <unordered_map>
53 void addOutput (TObject *output_swallow)
final override;
67 void addOutputList (
const std::string& name, TObject *output_swallow)
override;
80 TObject *
getOutputHist (
const std::string& name)
const final override;
118 const std::string& stream )
final override;
125 const std::string& stream )
const final override;
139 TTree *
tree ()
const override;
204 virtual bool filterPassed ()
const noexcept final override;
210 virtual void setFilterPassed (
bool val_filterPassed)
noexcept final override;
all data needed to manage a given output stream
the interface for algorithms to access IWorker
the job configuration that is independent of driver and dataset
Long64_t treeEntry() const override
description: the entry in the tree we are reading guarantee: no-fail
std::string inputFileName() const override
the name of the file we are reading the current tree from, without the path component
std::map< std::string, TH1 * > m_outputHistMap
::StatusCode directExecute(const SH::SamplePtr &sample, const Job &job, const std::string &location, const SH::MetaObject &options)
run the job
void testInvariant() const
effects: test the invariant of this object guarantee: no-fail
::StatusCode gridExecute(const std::string &sampleName, Long64_t SkipEvents, Long64_t nEventsPerJob)
void addOutputList(const std::string &name, TObject *output_swallow) override
effects: add a given object to the output.
::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...
TFile * inputFile() const override
description: the file we are reading the current tree from guarantee: no-fail
void skipEvent() override
effects: skip the current event, i.e.
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
::StatusCode processEvents(EventRange &eventRange) override
process the given event range
static bool fileOpenErrorFilter(int level, bool, const char *, const char *)
Error handler for file opening.
void setOutputHist(const std::string &val_outputTarget)
set the histogram output list
std::vector< asg::AsgComponentConfig > m_moduleConfig
the module configurations we use
::StatusCode addOutputStream(const std::string &label, Detail::OutputStreamData output)
effects: add another output file guarantee: strong failures: low level errors II failures: label alre...
const SH::MetaObject * metaData() const override
description: the sample meta-data we are working on guarantee: no-fail invariant: metaData !...
TFile * getOutputFile(const std::string &label) const override
effects: get the output file that goes into the dataset with the given label.
TObject * getOutputHist(const std::string &name) const final override
get the output histogram with the given name
virtual void setFilterPassed(bool val_filterPassed) noexcept final override
set the value of filterPassed
std::string m_segmentName
the name of the segment we are processing
::StatusCode finalize()
finalize the worker
std::map< std::pair< std::string, std::string >, TTree * > m_outputTreeMap
Worker()
standard constructor
virtual bool filterPassed() const noexcept final override
whether the current algorithm passed its filter criterion for the current event
void setJobConfig(JobConfig &&jobConfig)
set the JobConfig
::StatusCode openInputFile(const std::string &inputFileUrl) override
open the given input file without processing it
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 failur...
uint64_t eventsProcessed() const noexcept
the number of events that have been processed
bool m_newInputFile
whether this is a new input file (i.e.
TTree * tree() const override
description: the tree we are running on guarantee: no-fail
void setMetaData(const SH::MetaObject *val_metaData)
set the metaData
TTree * triggerConfig() const override
description: the trigger config tree from the input file, or NULL if we did not find it guarantee: st...
bool m_algorithmsInitialized
whether the algorithms are initialized
std::vector< std::unique_ptr< Detail::Module > > m_modules
the list of modules we hold
std::map< std::string, TH1 * >::const_iterator OutputHistMapIter
the output map
std::map< std::pair< std::string, std::string >, TTree * >::const_iterator OutputTreeMapIter
description: the list of output trees
void addOutput(TObject *output_swallow) final override
effects: add an object to the output.
virtual ~Worker()
effects: standard destructor guarantee: no-fail
::StatusCode initialize()
initialize the worker
TFile * getOutputFileNull(const std::string &label) const override
effects: get the output file that goes into the dataset with the given label.
void setSegmentName(const std::string &val_segmentName)
set the segment name
xAOD::TEvent * xaodEvent() const override
description: the xAOD event and store guarantee: strong failures: out of memory I failures: TEventSvc...
void gridCreateJobSummary(uint64_t eventsProcessed)
Long64_t inputFileNumEntries() const override
the number of events in the input file
xAOD::TStore * xaodStore() const override
::StatusCode processInputs()
process all the inputs
::StatusCode batchExecute(unsigned job_id, const char *confFile)
effects: do what is needed to execute the given job segment guarantee: basic failures: job specific
bool m_firstEvent
whether we are still to process the first event
std::string m_outputTarget
the target file to which we will write the histogram output
A smart pointer class that holds a single Sample object.
Tool for accessing xAOD files outside of Athena.
A relatively simple transient store for objects created in analysis.
std::string label(const std::string &format, int i)
This module defines the arguments passed from the BATCH driver to the BATCH worker.
::StatusCode StatusCode
StatusCode definition for legacy code.
the data the EventLoop core classes are sharing with the Module implementation
a range of events in a given file