LDMX Software
HgcrocPulseTruthAnalyzer.cxx
1#include "DQM/HgcrocPulseTruthAnalyzer.h"
2
4#include "Recon/Event/HgcrocPulseTruth.h"
5
6namespace dqm {
7
9 input_digi_name_ = ps.get<std::string>("input_digi_name");
10 input_digi_pass_ = ps.get<std::string>("input_digi_pass");
11 input_truth_name_ = ps.get<std::string>("input_truth_name");
12 input_truth_pass_ = ps.get<std::string>("input_truth_pass");
13}
14
16 auto digis{event.getObject<ldmx::HgcrocDigiCollection>(input_digi_name_,
17 input_digi_pass_)};
18 auto truths{event.getObject<ldmx::HgcrocPulseTruthCollection>(
19 input_truth_name_, input_truth_pass_)};
20
21 for (auto const& t : truths) {
22 unsigned int id = t.getID();
23
24 double vpeak = t.getMax();
25
26 for (auto const& d : digis) {
27 if (d.id() == id) {
28 if (d.isADC()) {
29 int sum_adc = 0;
30 for (int i = 0; i < d.size(); i++) {
31 sum_adc += d.at(i).adcT();
32 }
33 histograms_.fill("vpeak_sumADC", vpeak, sum_adc);
34 } else {
35 histograms_.fill("vpeak_TOT", vpeak, d.tot());
36 }
37 break;
38 }
39 }
40 }
41}
42
43} // namespace dqm
44
#define DECLARE_ANALYZER(CLASS)
Macro which allows the framework to construct an analyzer given its name during configuration.
Class that represents a digitized hit in a calorimeter cell readout by an HGCROC.
void configure(framework::config::Parameters &parameters) override
Callback for the EventProcessor to configure itself from the given set of parameters.
void analyze(const framework::Event &event) override
Process the event and make histograms or summaries.
HistogramPool histograms_
helper object for making and filling histograms
Implements an event buffer system for storing event data.
Definition Event.h:42
void fill(const std::string &name, const T &val)
Fill a 1D histogram.
Class encapsulating parameters for configuring a processor.
Definition Parameters.h:29
const T & get(const std::string &name) const
Retrieve the parameter of the given name.
Definition Parameters.h:78
Represents a collection of the digi hits readout by an HGCROC.