LDMX Software
HcalPedestalAnalyzer.h
1#ifndef HCALPEDESTALANALYZER_H
2#define HCALPEDESTALANALYZER_H
3
4#include "DetDescr/HcalDigiID.h"
7namespace hcal {
8
10 std::string input_name_, input_pass_;
11 std::string output_file_, comments_;
12 bool make_histos_;
13 bool filter_noTOT;
14 bool filter_noTOA;
15 int low_cutoff_, high_cutoff_;
16
17 struct Channel {
18 Channel() : hist{0}, sum{0}, sum_sq{0}, entries{0}, rejects{4, 0} {}
21 std::vector<int> adcs;
23 TH1* hist;
25 uint64_t sum;
27 double sum_sq;
31 std::vector<int> rejects;
32 };
33
34 std::map<ldmx::HcalDigiID, Channel> pedestal_data_;
35
36 void create_and_fill(Channel& chan, ldmx::HcalDigiID detid);
37
38 public:
39 HcalPedestalAnalyzer(const std::string& n, framework::Process& p)
40 : framework::Analyzer(n, p) {}
41 virtual ~HcalPedestalAnalyzer() = default;
42
44 input_name_ = ps.getParameter<std::string>("input_name");
45 input_pass_ = ps.getParameter<std::string>("input_pass");
46 output_file_ = ps.getParameter<std::string>("output_file");
47 comments_ = ps.getParameter<std::string>("comments");
48
49 make_histos_ = ps.getParameter<bool>("make_histos", false);
50
51 filter_noTOT = ps.getParameter<bool>("filter_noTOT", true);
52 filter_noTOA = ps.getParameter<bool>("filter_noTOA", true);
53 low_cutoff_ = ps.getParameter<int>("low_cutoff", 10);
54 high_cutoff_ = ps.getParameter<int>("high_cutoff", 512);
55 }
56
57 void analyze(const framework::Event& event) override;
58 void onProcessEnd() override;
59};
60
61} // namespace hcal
62
63#endif /* HCALPEDESTALANALYZER_H */
Base classes for all user event processing components to extend.
Class that represents a digitized hit in a calorimeter cell readout by an HGCROC.
Base class for a module which does not produce a data product.
Analyzer(const std::string &name, Process &process)
Class constructor.
Implements an event buffer system for storing event data.
Definition Event.h:41
Class which represents the process under execution.
Definition Process.h:36
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
void analyze(const framework::Event &event) override
Process the event and make histograms or summaries.
void onProcessEnd() override
Callback for the EventProcessor to take any necessary action when the processing of events finishes,...
void configure(framework::config::Parameters &ps) override
Callback for the EventProcessor to configure itself from the given set of parameters.
Extension of HcalAbstractID providing access to HCal digi information.
Definition HcalDigiID.h:13
All classes in the ldmx-sw project use this namespace.
Definition PerfDict.cxx:45
double sum_sq
Sum of values squared.
std::vector< int > rejects
counts of various rejections
std::vector< int > adcs
collection of hits accumulated to produce appropriately-binned histograms