LDMX Software
Public Member Functions | Private Attributes | List of all members
dqm::Trigger Class Reference

Generate histograms to check digi pipeline performance. More...

#include <Trigger.h>

Public Member Functions

 Trigger (const std::string &name, framework::Process &process)
 Constructor.
 
virtual void configure (framework::config::Parameters &ps)
 Input python configuration parameters.
 
virtual void onProcessStart ()
 Method executed before processing of events begins.
 
virtual void analyze (const framework::Event &event)
 Fills histograms.
 
- Public Member Functions inherited from framework::Analyzer
 Analyzer (const std::string &name, Process &process)
 Class constructor.
 
- Public Member Functions inherited from framework::EventProcessor
 EventProcessor (const std::string &name, Process &process)
 Class constructor.
 
virtual ~EventProcessor ()
 Class destructor.
 
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 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.
 

Private Attributes

std::string trigger_collName_
 Trigger collection name.
 
std::string trigger_passName_
 Trigger collection pass name.
 

Additional Inherited Members

- Static Public Member Functions inherited from framework::EventProcessor
static void declare (const std::string &classname, int classtype, EventProcessorMaker *)
 Internal function which is part of the PluginFactory machinery.
 
- Static Public Attributes inherited from framework::Analyzer
static const int CLASSTYPE {2}
 Constant used to track EventProcessor types by the PluginFactory.
 
- Protected Member Functions inherited from framework::EventProcessor
void abortEvent ()
 Abort the event immediately.
 
- Protected Attributes inherited from framework::EventProcessor
HistogramHelper histograms_
 Interface class for making and filling histograms.
 
NtupleManagerntuple_ {NtupleManager::getInstance()}
 Manager for any ntuples.
 
logging::logger theLog_
 The logger for this EventProcessor.
 

Detailed Description

Generate histograms to check digi pipeline performance.

Definition at line 14 of file Trigger.h.

Constructor & Destructor Documentation

◆ Trigger()

dqm::Trigger::Trigger ( const std::string &  name,
framework::Process process 
)
inline

Constructor.

Blank Analyzer constructor

Definition at line 21 of file Trigger.h.

22 : framework::Analyzer(name, process) {}
Base class for a module which does not produce a data product.

Member Function Documentation

◆ analyze()

void dqm::Trigger::analyze ( const framework::Event event)
virtual

Fills histograms.

Implements framework::Analyzer.

Definition at line 44 of file Trigger.cxx.

44 {
45 auto trigResult{event.getObject<ldmx::TriggerResult>(trigger_collName_,
47
48 histograms_.fill(trigger_collName_ + ".EcalEsum", trigResult.getAlgoVar(0));
49 histograms_.fill(trigger_collName_ + ".EcalEcut", trigResult.getAlgoVar(1));
50 histograms_.fill(trigger_collName_ + ".EcalLayercut",
51 trigResult.getAlgoVar(2));
52 histograms_.fill(trigger_collName_ + ".nElectrons", trigResult.getAlgoVar(3));
53 histograms_.fill(trigger_collName_ + ".pass", trigResult.passed());
54
55 return;
56}
std::string trigger_passName_
Trigger collection pass name.
Definition Trigger.h:44
std::string trigger_collName_
Trigger collection name.
Definition Trigger.h:41
HistogramHelper histograms_
Interface class for making and filling histograms.
void fill(const std::string &name, const double &val)
Fill a 1D histogram.
Definition Histograms.h:166
Represents the trigger decision (pass/fail) for reconstruction.

References framework::HistogramHelper::fill(), framework::EventProcessor::histograms_, trigger_collName_, and trigger_passName_.

◆ configure()

void dqm::Trigger::configure ( framework::config::Parameters ps)
virtual

Input python configuration parameters.

Reimplemented from framework::EventProcessor.

Definition at line 8 of file Trigger.cxx.

8 {
9 trigger_collName_ = ps.getParameter<std::string>("trigger_name");
10 trigger_passName_ = ps.getParameter<std::string>("trigger_pass");
11
12 return;
13}
T getParameter(const std::string &name) const
Retrieve the parameter of the given name.
Definition Parameters.h:89

References framework::config::Parameters::getParameter(), trigger_collName_, and trigger_passName_.

◆ onProcessStart()

void dqm::Trigger::onProcessStart ( )
virtual

Method executed before processing of events begins.

Reimplemented from framework::EventProcessor.

Definition at line 15 of file Trigger.cxx.

15 {
17 // create trigger variable histograms
18
19 // pass/fail is a boolean, simple binning
20 histograms_.create(trigger_collName_ + ".pass", "Pass trigger", 2, 0, 2);
21
22 int maxE = 20000;
23 int minE = 0;
24 int nBinsE = (maxE - minE) / 100;
25 histograms_.create(trigger_collName_ + ".EcalEsum", "Ecal energy sum [MeV]",
26 nBinsE, minE, maxE);
27 histograms_.create(trigger_collName_ + ".EcalEcut", "Ecal E_{max} cut [MeV]",
28 nBinsE, minE, maxE);
29
30 int maxLayer = 32;
31 int minLayer = 0;
32 int nBinsLayer = (maxLayer - minLayer);
33 histograms_.create(trigger_collName_ + ".EcalLayercut", "Ecal layer_{max}",
34 nBinsLayer, minLayer, maxLayer);
35
36 int maxElectrons = 10;
37 int minElectrons = 0;
38 int nBinsElectrons = (maxElectrons - minElectrons);
39 histograms_.create(trigger_collName_ + ".nElectrons",
40 "N_{electrons} used for trigger decision", nBinsElectrons,
41 minElectrons, maxElectrons);
42}
TDirectory * getHistoDirectory()
Access/create a directory in the histogram file for this event processor to create histograms and ana...
void create(const std::string &name, const std::string &xLabel, const double &bins, const double &xmin, const double &xmax)
Create a ROOT 1D histogram of type TH1F and pool it for later use.

References framework::HistogramHelper::create(), framework::EventProcessor::getHistoDirectory(), framework::EventProcessor::histograms_, and trigger_collName_.

Member Data Documentation

◆ trigger_collName_

std::string dqm::Trigger::trigger_collName_
private

Trigger collection name.

Definition at line 41 of file Trigger.h.

Referenced by analyze(), configure(), and onProcessStart().

◆ trigger_passName_

std::string dqm::Trigger::trigger_passName_
private

Trigger collection pass name.

Definition at line 44 of file Trigger.h.

Referenced by analyze(), and configure().


The documentation for this class was generated from the following files: