LDMX Software
HCalRawDigi.cxx
1
2#include "DQM/HCalRawDigi.h"
3
4#include "DetDescr/HcalDigiID.h"
6
7namespace dqm {
8
10 input_name_ = ps.getParameter<std::string>("input_name");
11 input_pass_ = ps.getParameter<std::string>("input_pass");
12}
13
16 for (unsigned int i_sample{0}; i_sample < 4; i_sample++) {
17 histograms_.create("adc_by_channel_sample" + std::to_string(i_sample),
18 "Arbitrary Channel Index", 250, 0, 250,
19 "ADC Counts in Sample " + std::to_string(i_sample), 200,
20 0, 200);
21 // histograms_.get("adc_by_channel_sample"+std::to_string(i_sample))->SetCanExtend(TH1::kAllAxes);
22 }
23}
24
26 auto digis{
27 event.getObject<ldmx::HgcrocDigiCollection>(input_name_, input_pass_)};
33 unsigned int i_digi{1};
34 for (auto const& digi : digis) {
35 for (unsigned int i_sample{0}; i_sample < digis.getNumSamplesPerDigi();
36 i_sample++) {
37 histograms_.fill("adc_by_channel_sample" + std::to_string(i_sample),
38 i_digi, digi.at(i_sample).adc_t());
39 }
40 i_digi++;
41 }
42}
43
44} // namespace dqm
45
46DECLARE_ANALYZER_NS(dqm, HCalRawDigi)
#define DECLARE_ANALYZER_NS(NS, 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 analyze(const framework::Event &event) override
Process the event and make histograms ro summaries.
void configure(framework::config::Parameters &parameters) override
Configure the processor using the given user specified parameters.
void onProcessStart() override
Callback for the EventProcessor to take any necessary action when the processing of events starts,...
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 a collection of the digi hits readout by an HGCROC.