LDMX Software
HcalVetoResults.cxx
1#include "DQM/HcalVetoResults.h"
2// #include "Framework/EventProcessor.h"
4
5namespace dqm {
6
8 hcal_veto_name_ = ps.getParameter<std::string>("hcal_veto_name");
9 hcal_veto_pass_ = ps.getParameter<std::string>("hcal_veto_pass");
10}
11
13 std::vector<TH1 *> hists_HCALsector = {histograms_.get("max_section")};
14
15 // enum HcalSection { BACK = 0, TOP = 1, BOTTOM = 2, RIGHT = 3, LEFT = 4 };
16 std::vector<std::string> labels_HCALsector = {"HCAL BACK", // 1
17 "HCAL TOP", // 2
18 "HCAL BOTTOM", // 3
19 "HCAL RIGHT", // 4
20 "HCAL LEFT", // 5
21 ""};
22
23 for (int ilabel{1}; ilabel < labels_HCALsector.size(); ++ilabel) {
24 for (auto &hist : hists_HCALsector) {
25 hist->GetXaxis()->SetBinLabel(ilabel,
26 labels_HCALsector[ilabel - 1].c_str());
27 }
28 }
29}
30
32 // Get the veto object
33 auto hcal_veto{event.getObject<ldmx::HcalVetoResult>("HcalVeto")};
34
35 // Get variables to be plotted
36 auto veto_passed = hcal_veto.passesVeto();
37 auto total_pe = hcal_veto.getTotalPE();
38 auto num_valid_hits = hcal_veto.getNumValidHits();
39 auto max_pe_hit = hcal_veto.getMaxPEHit();
40 auto max_pe = max_pe_hit.getPE();
41 auto max_section = max_pe_hit.getSection();
42 auto max_pos_z = max_pe_hit.getZPos();
43
44 // ldmx_log(info) << "max_section" << max_section;
45
46 // Fill the histograms
47 histograms_.fill("max_pe", max_pe);
48 histograms_.fill("total_pe", total_pe);
49 histograms_.fill("num_valid_hits", num_valid_hits);
50 histograms_.fill("max_section", max_section);
51 histograms_.fill("max_pos_z", max_pos_z);
52 histograms_.fill("veto_pass", veto_passed);
53}
54
55} // namespace dqm
56
57DECLARE_ANALYZER_NS(dqm, HcalVetoResults)
#define DECLARE_ANALYZER_NS(NS, CLASS)
Macro which allows the framework to construct an analyzer given its name during configuration.
Class used to encapsulate the results obtained from HcalVetoProcessor.
std::string hcal_veto_pass_
Pass Name for veto object.
virtual void analyze(const framework::Event &event)
Fills histograms.
std::string hcal_veto_name_
Collection Name for veto object.
virtual void onProcessStart()
Things to do only on process start.
virtual void configure(framework::config::Parameters &ps)
Input python configuration parameters.
HistogramHelper histograms_
Interface class for making and filling histograms.
Implements an event buffer system for storing event data.
Definition Event.h:42
TH1 * get(const std::string &name)
Get a pointer to a histogram by name.
Definition Histograms.h:194
void fill(const std::string &name, const double &val)
Fill a 1D histogram.
Definition Histograms.h:166
Class encapsulating parameters for configuring a processor.
Definition Parameters.h:29