LDMX Software
HcalPedestalAnalyzer.h
1#ifndef HCALPEDESTALANALYZER_H
2#define HCALPEDESTALANALYZER_H
3
4#include "DetDescr/HcalDigiID.h"
6namespace hcal {
7
9 std::string input_name_, input_pass_;
10 std::string output_file_, comments_;
11 bool make_histos_;
12 bool filter_no_tot_;
13 bool filter_no_toa_;
14 int low_cutoff_, high_cutoff_;
15
16 struct Channel {
17 Channel() : hist_{0}, sum_{0}, sum_sq_{0}, entries_{0}, rejects_{4, 0} {}
20 std::vector<int> adcs_;
22 TH1* hist_;
24 uint64_t sum_;
26 double sum_sq_;
30 std::vector<int> rejects_;
31 };
32
33 std::map<ldmx::HcalDigiID, Channel> pedestal_data_;
34
35 void createAndFill(Channel& chan, ldmx::HcalDigiID detid);
36
37 public:
38 HcalPedestalAnalyzer(const std::string& n, framework::Process& p)
39 : framework::Analyzer(n, p) {}
40 virtual ~HcalPedestalAnalyzer() = default;
41
43 input_name_ = ps.getParameter<std::string>("input_name");
44 input_pass_ = ps.getParameter<std::string>("input_pass");
45 output_file_ = ps.getParameter<std::string>("output_file");
46 comments_ = ps.getParameter<std::string>("comments");
47
48 make_histos_ = ps.getParameter<bool>("make_histos", false);
49
50 filter_no_tot_ = ps.getParameter<bool>("filter_noTOT", true);
51 filter_no_toa_ = ps.getParameter<bool>("filter_noTOA", true);
52 low_cutoff_ = ps.getParameter<int>("low_cutoff", 10);
53 high_cutoff_ = ps.getParameter<int>("high_cutoff", 512);
54 }
55
56 void analyze(const framework::Event& event) override;
57 void onProcessEnd() override;
58};
59
60} // namespace hcal
61
62#endif /* HCALPEDESTALANALYZER_H */
Base classes for all user event processing components to extend.
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:40
Class which represents the process under execution.
Definition Process.h:34
Class encapsulating parameters for configuring a processor.
Definition Parameters.h:26
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.
double sum_sq_
Sum of values squared.
std::vector< int > adcs_
collection of hits accumulated to produce appropriately-binned histograms
std::vector< int > rejects_
counts of various rejections