LDMX Software
Trigger.cxx
1
2#include "DQM/Trigger.h"
3
5
6namespace dqm {
7
9 trigger_collName_ = ps.getParameter<std::string>("trigger_name");
10 trigger_passName_ = ps.getParameter<std::string>("trigger_pass");
11
12 return;
13}
14
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}
43
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}
57
58} // namespace dqm
59
60DECLARE_ANALYZER_NS(dqm, Trigger);
#define DECLARE_ANALYZER_NS(NS, CLASS)
Macro which allows the framework to construct an analyzer given its name during configuration.
Class that represents the trigger decision (pass/fail) for reconstruction.
virtual void configure(framework::config::Parameters &ps)
Input python configuration parameters.
Definition Trigger.cxx:8
virtual void onProcessStart()
Method executed before processing of events begins.
Definition Trigger.cxx:15
virtual void analyze(const framework::Event &event)
Fills histograms.
Definition Trigger.cxx:44
std::string trigger_passName_
Trigger collection pass name.
Definition Trigger.h:44
std::string trigger_collName_
Trigger collection name.
Definition Trigger.h:41
TDirectory * getHistoDirectory()
Access/create a directory in the histogram file for this event processor to create histograms and ana...
HistogramHelper histograms_
Interface class for making and filling histograms.
Implements an event buffer system for storing event data.
Definition Event.h:41
void fill(const std::string &name, const double &val)
Fill a 1D histogram.
Definition Histograms.h:166
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.
Class encapsulating parameters for configuring a processor.
Definition Parameters.h:27
T getParameter(const std::string &name) const
Retrieve the parameter of the given name.
Definition Parameters.h:89
Represents the trigger decision (pass/fail) for reconstruction.