7#ifndef FRAMEWORK_EVENTPROCESSOR_H_
8#define FRAMEWORK_EVENTPROCESSOR_H_
14#include "Framework/Configure/Parameters.h"
16#include "Framework/Exception/Exception.h"
18#include "Framework/HistogramPool.h"
19#include "Framework/Logger.h"
20#include "Framework/NtupleManager.h"
21#include "Framework/RunHeader.h"
185 const std::string &purposeString);
210 const std::vector<framework::config::Parameters> &histos);
348#define DECLARE_PRODUCER(CLASS) \
349 FACTORY_REGISTRATION(framework::EventProcessor, CLASS)
363#define DECLARE_ANALYZER(CLASS) \
364 FACTORY_REGISTRATION(framework::EventProcessor, CLASS)
Container and caching class for conditions information.
Class implementing an event buffer system for storing event data.
Header holding Factory class and supporting macros.
Definitions related to event storage control from an EventProcessor.
Specific exception used to abort an event.
virtual ~AbortEventException()
Destructor.
AbortEventException()
Constructor.
Base class for a module which does not produce a data product.
virtual void process(Event &event) final
Processing an event for an Analyzer is calling analyze.
virtual void beforeNewRun(ldmx::RunHeader &run_header) final
Don't allow Analyzers to add parameters to the run header.
virtual void analyze(const Event &event)=0
Process the event and make histograms or summaries.
Analyzer(const std::string &name, Process &process)
Class constructor.
Container and cache for conditions and conditions providers.
const T & getCondition(const std::string &condition_name)
Primary request action for a conditions object If the object is in the cache and still valid (IOV),...
This class manages all ROOT file input/output operations.
Base class for all event processing components.
DECLARE_FACTORY(EventProcessor, EventProcessor *, const std::string &, Process &)
declare that we have a factory for this class
Process & process_
Handle to the Process.
virtual void configure(framework::config::Parameters ¶meters)
Callback for the EventProcessor to configure itself from the given set of parameters.
std::string name_
The name of the EventProcessor.
NtupleManager & ntuple_
Manager for any ntuples.
logging::logger the_log_
The logger for this EventProcessor.
virtual ~EventProcessor()=default
Class destructor.
virtual void onProcessEnd()
Callback for the EventProcessor to take any necessary action when the processing of events finishes,...
void createHistograms(const std::vector< framework::config::Parameters > &histos)
Internal function which is used to create histograms passed from the python configuration @parma hist...
EventProcessor(const std::string &name, Process &process)
Class constructor.
const T & getCondition(const std::string &condition_name)
Access a conditions object for the current event.
Conditions & getConditions() const
Internal getter for conditions without exposing all of Process.
void abortEvent()
Abort the event immediately.
const ldmx::EventHeader & getEventHeader() const
Internal getter for EventHeader without exposing all of Process.
std::string getName() const
Get the processor name.
virtual void beforeNewRun(ldmx::RunHeader &run_header)
Callback for Producers to add parameters to the run header before conditions are initialized.
virtual void onFileClose(EventFile &event_file)
Callback for the EventProcessor to take any necessary action when a event input ROOT file is closed.
virtual void onProcessStart()
Callback for the EventProcessor to take any necessary action when the processing of events starts,...
HistogramPool histograms_
helper object for making and filling histograms
virtual void process(Event &event)=0
How an EventProcessor processes an event.
int getRunNumber() const
Get the run number from the process.
TDirectory * getHistoDirectory()
Access/create a directory in the histogram file for this event processor to create histograms and ana...
TDirectory * histo_dir_
Histogram directory.
int getLogFrequency() const
Get the current logging frequency from the process.
void setStorageHint(framework::StorageControl::Hint hint)
Mark the current event as having the given storage control hint from this module_.
virtual void onFileOpen(EventFile &event_file)
Callback for the EventProcessor to take any necessary action when a new event input ROOT file is open...
virtual void onNewRun(const ldmx::RunHeader &run_header)
Callback for the EventProcessor to take any necessary action when the run being processed changes.
Implements an event buffer system for storing event data.
Class for holding an EventProcessor's histogram pointers and making sure that they all end up in the ...
Singleton class used to manage the creation and pooling of ntuples.
static NtupleManager & getInstance()
Class which represents the process under execution.
Base class for a module which produces a data product.
Producer(const std::string &name, Process &process)
Class constructor.
virtual void produce(Event &event)=0
Process the event and put new data products into it.
virtual void process(Event &event) final
Processing an event for a Producer is calling produce.
Hint
Hints that can be provided by processors to the storage controller.
Class encapsulating parameters for configuring a processor.
Standard base exception class with some useful output information.
Exception()
Empty constructor.
All classes in the ldmx-sw project use this namespace.