LDMX Software
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.
 
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.
 
- Public Member Functions inherited from framework::EventProcessor
 DECLARE_FACTORY (EventProcessor, EventProcessor *, const std::string &, Process &)
 declare that we have a factory for this class
 
 EventProcessor (const std::string &name, Process &process)
 Class constructor.
 
virtual ~EventProcessor ()=default
 Class destructor.
 
virtual void onNewRun (const ldmx::RunHeader &run_header)
 Callback for the EventProcessor to take any necessary action when the run being processed changes.
 
virtual void onFileOpen (EventFile &event_file)
 Callback for the EventProcessor to take any necessary action when a new event input ROOT file is opened.
 
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 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_coll_name_
 Trigger collection name.
 
std::string trigger_pass_name_
 Trigger collection pass name.
 

Additional Inherited Members

- Protected Member Functions inherited from framework::EventProcessor
void abortEvent ()
 Abort the event immediately.
 
- Protected Attributes inherited from framework::EventProcessor
HistogramPool histograms_
 helper object for making and filling histograms
 
NtupleManagerntuple_ {NtupleManager::getInstance()}
 Manager for any ntuples.
 
logging::logger the_log_
 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.

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.

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 trig_result{event.getObject<ldmx::TriggerResult>(trigger_coll_name_,
47
48 histograms_.fill(trigger_coll_name_ + ".EcalEsum", trig_result.getAlgoVar(0));
49 histograms_.fill(trigger_coll_name_ + ".EcalEcut", trig_result.getAlgoVar(1));
50 histograms_.fill(trigger_coll_name_ + ".EcalLayercut",
51 trig_result.getAlgoVar(2));
52 histograms_.fill(trigger_coll_name_ + ".nElectrons",
53 trig_result.getAlgoVar(3));
54 histograms_.fill(trigger_coll_name_ + ".pass", trig_result.passed());
55
56 return;
57}
std::string trigger_pass_name_
Trigger collection pass name.
Definition Trigger.h:44
std::string trigger_coll_name_
Trigger collection name.
Definition Trigger.h:41
HistogramPool histograms_
helper object for making and filling histograms
void fill(const std::string &name, const T &val)
Fill a 1D histogram.
Represents the trigger decision (pass/fail) for reconstruction.

References framework::HistogramPool::fill(), framework::EventProcessor::histograms_, trigger_coll_name_, and trigger_pass_name_.

◆ 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_coll_name_ = ps.get<std::string>("trigger_name");
10 trigger_pass_name_ = ps.get<std::string>("trigger_pass");
11
12 return;
13}
const T & get(const std::string &name) const
Retrieve the parameter of the given name.
Definition Parameters.h:78

References framework::config::Parameters::get(), trigger_coll_name_, and trigger_pass_name_.

◆ 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_coll_name_ + ".pass", "Pass trigger", 2, 0, 2);
21
22 int max_e = 20000;
23 int min_e = 0;
24 int n_bins_e = (max_e - min_e) / 100;
25 histograms_.create(trigger_coll_name_ + ".EcalEsum", "Ecal energy sum [MeV]",
26 n_bins_e, min_e, max_e);
27 histograms_.create(trigger_coll_name_ + ".EcalEcut", "Ecal e_{max} cut [MeV]",
28 n_bins_e, min_e, max_e);
29
30 int max_layer = 32;
31 int min_layer = 0;
32 int n_bins_layer = (max_layer - min_layer);
33 histograms_.create(trigger_coll_name_ + ".EcalLayercut", "Ecal layer_{max}",
34 n_bins_layer, min_layer, max_layer);
35
36 int max_electrons = 10;
37 int min_electrons = 0;
38 int n_bins_electrons = (max_electrons - min_electrons);
40 "n_{electrons} used for trigger decision",
41 n_bins_electrons, min_electrons, max_electrons);
42}
TDirectory * getHistoDirectory()
Access/create a directory in the histogram file for this event processor to create histograms and ana...
void create(const config::Parameters &p)
Create a histogram from the input configuration parameters.

References framework::HistogramPool::create(), framework::EventProcessor::getHistoDirectory(), framework::EventProcessor::histograms_, and trigger_coll_name_.

Member Data Documentation

◆ trigger_coll_name_

std::string dqm::Trigger::trigger_coll_name_
private

Trigger collection name.

Definition at line 41 of file Trigger.h.

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

◆ trigger_pass_name_

std::string dqm::Trigger::trigger_pass_name_
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: