LDMX Software
|
Base class for all event processing components. More...
#include <EventProcessor.h>
Public Member Functions | |
EventProcessor (const std::string &name, Process &process) | |
Class constructor. | |
virtual | ~EventProcessor () |
Class destructor. | |
virtual void | configure (framework::config::Parameters ¶meters) |
Callback for the EventProcessor to configure itself from the given set of parameters. | |
virtual void | onNewRun (const ldmx::RunHeader &runHeader) |
Callback for the EventProcessor to take any necessary action when the run being processed changes. | |
virtual void | onFileOpen (EventFile &eventFile) |
Callback for the EventProcessor to take any necessary action when a new event input ROOT file is opened. | |
virtual void | onFileClose (EventFile &eventFile) |
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, such as creating histograms. | |
virtual void | onProcessEnd () |
Callback for the EventProcessor to take any necessary action when the processing of events finishes, such as calculating job-summary quantities. | |
template<class T > | |
const T & | getCondition (const std::string &condition_name) |
Access a conditions object for the current event. | |
TDirectory * | getHistoDirectory () |
Access/create a directory in the histogram file for this event processor to create histograms and analysis tuples. | |
void | setStorageHint (framework::StorageControl::Hint hint) |
Mark the current event as having the given storage control hint from this module. | |
void | setStorageHint (framework::StorageControl::Hint hint, const std::string &purposeString) |
Mark the current event as having the given storage control hint from this module and the given purpose string. | |
int | getLogFrequency () const |
Get the current logging frequency from the process. | |
int | getRunNumber () const |
Get the run number from the process. | |
std::string | getName () const |
Get the processor name. | |
void | createHistograms (const std::vector< framework::config::Parameters > &histos) |
Internal function which is used to create histograms passed from the python configuration @parma histos vector of Parameters that configure histograms to create. | |
Static Public Member Functions | |
static void | declare (const std::string &classname, int classtype, EventProcessorMaker *) |
Internal function which is part of the PluginFactory machinery. | |
Protected Member Functions | |
void | abortEvent () |
Abort the event immediately. | |
Protected Attributes | |
HistogramHelper | histograms_ |
Interface class for making and filling histograms. | |
NtupleManager & | ntuple_ {NtupleManager::getInstance()} |
Manager for any ntuples. | |
logging::logger | theLog_ |
The logger for this EventProcessor. | |
Private Member Functions | |
Conditions & | getConditions () const |
Internal getter for conditions without exposing all of Process. | |
const ldmx::EventHeader & | getEventHeader () const |
Internal getter for EventHeader without exposing all of Process. | |
Private Attributes | |
Process & | process_ |
Handle to the Process. | |
std::string | name_ |
The name of the EventProcessor. | |
TDirectory * | histoDir_ {0} |
Histogram directory. | |
Base class for all event processing components.
Definition at line 65 of file EventProcessor.h.
framework::EventProcessor::EventProcessor | ( | const std::string & | name, |
Process & | process | ||
) |
Class constructor.
name | Name for this instance of the class. |
process | The Process class associated with EventProcessor, provided by the framework. |
Definition at line 11 of file EventProcessor.cxx.
|
inlinevirtual |
|
inlineprotected |
Abort the event immediately.
Skip the rest of the sequence and don't save anything in the event bus.
Definition at line 213 of file EventProcessor.h.
Referenced by packing::SingleSubsystemPacker::analyze(), hcal::HcalAlignPolarfires::produce(), packing::RawIO::produce(), packing::SingleSubsystemUnpacker::produce(), simcore::ReSimulator::produce(), and simcore::Simulator::produce().
|
inlinevirtual |
Callback for the EventProcessor to configure itself from the given set of parameters.
The parameters a processor has access to are the member variables of the python class in the sequence that has className equal to the EventProcessor class name.
For an example, look at MyProcessor.
parameters | Parameters for configuration. |
Reimplemented in ecal::EcalDigiProducer, ecal::EcalRawDecoder, ecal::EcalRawEncoder, ecal::EcalRecProducer, ecal::EcalTrigPrimDigiProducer, trigger::NtupleWriter, trigger::PropagationMapWriter, recon::EcalPreselectionSkimmer, packing::FiberTrackerRawDecoder, packing::WRRawDecoder, hcal::HcalDigiProducer, hcal::HcalRawDecoder, hcal::HcalRecProducer, hcal::HcalTrigPrimDigiProducer, framework::test::TestProducer, hcal::HcalDoubleEndRecProducer, hcal::HcalSingleEndRecProducer, framework::test::TestConfig, dqm::HCalDQM, dqm::HcalGeometryVerifier, dqm::HcalInefficiencyAnalyzer, dqm::HCalRawDigi, dqm::PhotoNuclearDQM, dqm::RecoilTrackerDQM, dqm::ReSimVerifier, ecal::DNNEcalVetoProcessor, ecal::EcalClusterProducer, ecal::EcalVetoProcessor, hcal::HcalClusterProducer, hcal::HcalVetoProcessor, hcal::HcalWABVetoProcessor, recon::BeamElectronLocator, recon::ElectronCounter, recon::MyProcessor, recon::OverlayProducer, recon::SequentialTrigger, recon::TriggerProcessor, simcore::ReSimulator, simcore::Simulator, simcore::SimulatorBase, tracking::dqm::TrackingRecoDQM, tracking::reco::AlignmentTestProcessor, tracking::reco::CKFProcessor, tracking::reco::DigitizationProcessor, tracking::reco::GSFProcessor, tracking::reco::SeedFinderProcessor, tracking::reco::TruthSeedProcessor, tracking::reco::Vertexer, tracking::reco::VertexProcessor, trigscint::EventReadoutProducer, trigscint::QIEAnalyzer, trigscint::QualityFlagAnalyzer, trigscint::TestBeamClusterAnalyzer, trigscint::TestBeamHitAnalyzer, trigscint::TestBeamHitProducer, trigscint::TrigScintDigiProducer, trigscint::TrigScintQIEDigiProducer, trigscint::TrigScintRecHitProducer, trigscint::TruthHitProducer, dqm::EcalDigiVerifier, dqm::EcalMipTrackingFeatures, dqm::EcalShowerFeatures, dqm::EcalVetoResults, dqm::SimObjects, dqm::Trigger, recon::ParticleFlow, recon::PFEcalClusterProducer, recon::PFHcalClusterProducer, recon::PFTrackProducer, recon::PFTruthProducer, trigger::DumpFileWriter, trigger::EcalTPSelector, trigger::TrigEcalClusterProducer, trigger::TrigEcalEnergySum, trigger::TrigElectronProducer, trigger::TrigHcalEnergySum, trigscint::TestBeamClusterProducer, dqm::NtuplizeHgcrocDigiCollection, dqm::NtuplizeTrigScintQIEDigis, dqm::SampleValidation, hcal::HcalAlignPolarfires, hcal::HcalPedestalAnalyzer, packing::RawIO, packing::SingleSubsystemPacker, packing::SingleSubsystemUnpacker, trigscint::QIEDecoder, trigscint::QIEEncoder, trigscint::TrigScintClusterProducer, trigscint::TrigScintFirmwareHitProducer, trigscint::TrigScintFirmwareTracker, trigscint::TrigScintTrackProducer, dqm::TrigScintClusterDQM, dqm::TrigScintDQM, dqm::TrigScintHitDQM, and dqm::TrigScintTrackDQM.
Definition at line 98 of file EventProcessor.h.
Referenced by framework::Process::Process().
void framework::EventProcessor::createHistograms | ( | const std::vector< framework::config::Parameters > & | histos | ) |
Internal function which is used to create histograms passed from the python configuration @parma histos vector of Parameters that configure histograms to create.
Definition at line 50 of file EventProcessor.cxx.
References framework::HistogramHelper::create(), and histograms_.
Referenced by framework::Process::Process().
|
static |
Internal function which is part of the PluginFactory machinery.
classname | The class name of the processor. |
classtype | The class type of the processor (1 for Producer, 2 for Analyzer). |
Definition at line 44 of file EventProcessor.cxx.
References framework::PluginFactory::getInstance(), and framework::PluginFactory::registerEventProcessor().
|
inline |
Access a conditions object for the current event.
Definition at line 141 of file EventProcessor.h.
References framework::Conditions::getCondition(), and getConditions().
Referenced by simcore::ConditionsInterface::getCondition().
|
private |
Internal getter for conditions without exposing all of Process.
Definition at line 17 of file EventProcessor.cxx.
References framework::Process::getConditions(), and process_.
Referenced by getCondition().
|
private |
Internal getter for EventHeader without exposing all of Process.
Definition at line 21 of file EventProcessor.cxx.
References framework::Process::getEventHeader(), and process_.
TDirectory * framework::EventProcessor::getHistoDirectory | ( | ) |
Access/create a directory in the histogram file for this event processor to create histograms and analysis tuples.
Definition at line 25 of file EventProcessor.cxx.
References histoDir_, framework::Process::makeHistoDirectory(), name_, and process_.
Referenced by dqm::SimObjects::createCalorimeterHists(), dqm::SimObjects::createTrackerHists(), dqm::SimObjects::onProcessStart(), dqm::Trigger::onProcessStart(), dqm::TrigScintClusterDQM::onProcessStart(), dqm::TrigScintDQM::onProcessStart(), dqm::TrigScintHitDQM::onProcessStart(), dqm::TrigScintTrackDQM::onProcessStart(), dqm::NtuplizeHgcrocDigiCollection::onProcessStart(), dqm::NtuplizeTrigScintQIEDigis::onProcessStart(), ecal::test::EcalCheckEnergyReconstruction::onProcessStart(), framework::test::TestAnalyzer::onProcessStart(), hcal::test::HcalCheckReconstruction::onProcessStart(), packing::FiberTrackerRawDecoder::onProcessStart(), packing::WRRawDecoder::onProcessStart(), dqm::HCalRawDigi::onProcessStart(), and framework::Process::Process().
int framework::EventProcessor::getLogFrequency | ( | ) | const |
Get the current logging frequency from the process.
Definition at line 38 of file EventProcessor.cxx.
References framework::Process::getLogFrequency(), and process_.
|
inline |
Get the processor name.
Definition at line 188 of file EventProcessor.h.
References name_.
Referenced by tracking::reco::SeedFinderProcessor::configure(), ecal::EcalTrigPrimDigiProducer::produce(), and hcal::HcalTrigPrimDigiProducer::produce().
int framework::EventProcessor::getRunNumber | ( | ) | const |
Get the run number from the process.
Definition at line 42 of file EventProcessor.cxx.
References framework::Process::getRunNumber(), and process_.
|
inlinevirtual |
Callback for the EventProcessor to take any necessary action when a event input ROOT file is closed.
filename | Input event ROOT file name |
Definition at line 121 of file EventProcessor.h.
|
inlinevirtual |
Callback for the EventProcessor to take any necessary action when a new event input ROOT file is opened.
filename | Input event ROOT file name. |
Definition at line 113 of file EventProcessor.h.
|
inlinevirtual |
Callback for the EventProcessor to take any necessary action when the run being processed changes.
runHeader | The RunHeader containing run information. |
Reimplemented in recon::OverlayProducer, simcore::Simulator, tracking::reco::DigitizationProcessor, tracking::reco::AlignmentTestProcessor, tracking::reco::CKFProcessor, tracking::reco::GSFProcessor, and tracking::reco::TruthSeedProcessor.
Definition at line 105 of file EventProcessor.h.
|
inlinevirtual |
Callback for the EventProcessor to take any necessary action when the processing of events finishes, such as calculating job-summary quantities.
Reimplemented in recon::ParticleFlow, trigger::DumpFileWriter, trigger::NtupleWriter, trigger::PropagationMapWriter, trigger::TrigElectronProducer, trigscint::TestBeamClusterProducer, hcal::HcalPedestalAnalyzer, packing::RawIO, simcore::Simulator, simcore::SimulatorBase, tracking::dqm::TrackingRecoDQM, tracking::reco::AlignmentTestProcessor, tracking::reco::CKFProcessor, tracking::reco::GSFProcessor, tracking::reco::SeedFinderProcessor, tracking::reco::Vertexer, tracking::reco::VertexProcessor, trigscint::QIEAnalyzer, trigscint::QIEDecoder, trigscint::QIEEncoder, trigscint::QualityFlagAnalyzer, trigscint::TestBeamClusterAnalyzer, trigscint::TestBeamHitAnalyzer, trigscint::TrigScintClusterProducer, and trigscint::TrigScintTrackProducer.
Definition at line 135 of file EventProcessor.h.
|
inlinevirtual |
Callback for the EventProcessor to take any necessary action when the processing of events starts, such as creating histograms.
Reimplemented in dqm::SimObjects, dqm::Trigger, dqm::TrigScintClusterDQM, dqm::TrigScintDQM, dqm::TrigScintHitDQM, dqm::TrigScintTrackDQM, trigger::DumpFileWriter, trigger::NtupleWriter, trigger::PropagationMapWriter, trigger::TrigElectronProducer, trigscint::TestBeamClusterProducer, dqm::NtuplizeHgcrocDigiCollection, dqm::NtuplizeTrigScintQIEDigis, ecal::test::EcalCheckEnergyReconstruction, framework::test::TestAnalyzer, hcal::test::HcalCheckReconstruction, hcal::test::HcalCheckPositionMap, packing::FiberTrackerRawDecoder, packing::WRRawDecoder, dqm::DarkBremInteraction, dqm::HCalRawDigi, dqm::PhotoNuclearDQM, dqm::RecoilTrackerDQM, dqm::SampleValidation, recon::BeamElectronLocator, recon::OverlayProducer, simcore::SimulatorBase, tracking::reco::AlignmentTestProcessor, tracking::reco::CKFProcessor, tracking::reco::DigitizationProcessor, tracking::reco::GSFProcessor, tracking::reco::SeedFinderProcessor, tracking::reco::TruthSeedProcessor, tracking::reco::Vertexer, tracking::reco::VertexProcessor, trigscint::QIEAnalyzer, trigscint::QIEDecoder, trigscint::QIEEncoder, trigscint::QualityFlagAnalyzer, trigscint::TestBeamClusterAnalyzer, trigscint::TestBeamHitAnalyzer, trigscint::TrigScintClusterProducer, and trigscint::TrigScintTrackProducer.
Definition at line 128 of file EventProcessor.h.
|
inline |
Mark the current event as having the given storage control hint from this module.
controlhint | The storage control hint to apply for the given event |
Definition at line 160 of file EventProcessor.h.
References setStorageHint().
Referenced by dqm::EcalDigiVerifier::analyze(), recon::RecoilMissesEcalSkimmer::produce(), recon::EcalPreselectionSkimmer::produce(), framework::test::TestProducer::produce(), ecal::EcalVetoProcessor::produce(), hcal::HcalAlignPolarfires::produce(), hcal::HcalVetoProcessor::produce(), hcal::HcalWABVetoProcessor::produce(), recon::SequentialTrigger::produce(), recon::TriggerProcessor::produce(), and setStorageHint().
void framework::EventProcessor::setStorageHint | ( | framework::StorageControl::Hint | hint, |
const std::string & | purposeString | ||
) |
Mark the current event as having the given storage control hint from this module and the given purpose string.
controlhint | The storage control hint to apply for the given event |
purposeString | A purpose string which can be used in the skim control configuration |
Definition at line 33 of file EventProcessor.cxx.
References framework::StorageControl::addHint(), framework::Process::getStorageController(), name_, and process_.
|
private |
Histogram directory.
Definition at line 242 of file EventProcessor.h.
Referenced by getHistoDirectory().
|
protected |
Interface class for making and filling histograms.
Definition at line 216 of file EventProcessor.h.
Referenced by dqm::EcalDigiVerifier::analyze(), dqm::EcalMipTrackingFeatures::analyze(), dqm::EcalShowerFeatures::analyze(), dqm::EcalVetoResults::analyze(), dqm::SimObjects::analyze(), dqm::Trigger::analyze(), dqm::TrigScintClusterDQM::analyze(), dqm::TrigScintDQM::analyze(), dqm::TrigScintHitDQM::analyze(), dqm::TrigScintTrackDQM::analyze(), dqm::HcalGeometryVerifier::analyze(), dqm::HcalInefficiencyAnalyzer::analyze(), dqm::HCalRawDigi::analyze(), dqm::PhotoNuclearDQM::analyze(), dqm::RecoilTrackerDQM::analyze(), dqm::SampleValidation::analyze(), tracking::dqm::TrackerDigiDQM::analyze(), tracking::dqm::TrackingRecoDQM::analyze(), dqm::SimObjects::createCalorimeterHists(), createHistograms(), dqm::SimObjects::createTrackerHists(), dqm::PhotoNuclearDQM::findParticleKinematics(), dqm::PhotoNuclearDQM::findRecoilProperties(), dqm::PhotoNuclearDQM::findSubleadingKinematics(), dqm::SimObjects::onProcessStart(), dqm::Trigger::onProcessStart(), dqm::TrigScintClusterDQM::onProcessStart(), dqm::TrigScintDQM::onProcessStart(), dqm::TrigScintHitDQM::onProcessStart(), dqm::TrigScintTrackDQM::onProcessStart(), dqm::HCalRawDigi::onProcessStart(), dqm::PhotoNuclearDQM::onProcessStart(), dqm::SampleValidation::onProcessStart(), dqm::DarkBremInteraction::produce(), dqm::DarkBremInteraction::setHistLabels(), and tracking::dqm::TrackingRecoDQM::TrackStateMonitoring().
|
private |
The name of the EventProcessor.
Definition at line 239 of file EventProcessor.h.
Referenced by getHistoDirectory(), getName(), and setStorageHint().
|
protected |
Manager for any ntuples.
Definition at line 219 of file EventProcessor.h.
Referenced by ecal::test::EcalCheckEnergyReconstruction::analyze(), hcal::test::HcalCheckReconstruction::analyze(), ecal::test::EcalCheckEnergyReconstruction::onProcessStart(), and hcal::test::HcalCheckReconstruction::onProcessStart().
|
private |
Handle to the Process.
Definition at line 236 of file EventProcessor.h.
Referenced by getConditions(), getEventHeader(), getHistoDirectory(), getLogFrequency(), getRunNumber(), and setStorageHint().
|
protected |
The logger for this EventProcessor.
Definition at line 222 of file EventProcessor.h.