LDMX Software
QIEAnalyzer.h
Go to the documentation of this file.
1
7#ifndef TRIGSCINT_QIEANALYZER_H
8#define TRIGSCINT_QIEANALYZER_H
9
10// LDMX Framework
11#include "Framework/Configure/Parameters.h"
12#include "Framework/EventProcessor.h" //Needed to declare processor
13#include "TH1.h"
14#include "TH2.h"
16
17namespace trigscint {
18
24 public:
26 const std::string& name,
27 framework::Process& process); // : framework::Analyzer(name, process) {}
28 virtual ~QIEAnalyzer() = default;
29 void configure(framework::config::Parameters& parameters) override;
30
31 void analyze(const framework::Event& event) override;
32
33 void onProcessStart() override;
34
35 void onProcessEnd() override;
36
37 float convertToID(float yVal) { return (yVal + y_offset_) * y_to_id_factor_; }
38
39 private:
40 std::vector<std::vector<TH1F*> > v_charge_vs_time_;
41
42 // configurable parameters
43 std::string input_col_;
44 std::string input_pass_name_{""};
45 std::vector<double> peds_;
46 std::vector<double> gain_;
47 int start_sample_{0};
48
49 // plotting stuff
50 int n_ev_{200};
51 int n_channels_{16};
52 // int nTrkMax{100};
53
54 // match nev, nchan above
55 TH1F* h_out_[200][16];
56 TH1F* h_pe_[16];
57 TH2F* h_pe_vs_t_[16];
58 TH2F* h_ped_subtracted_avg_q_vs_t_[16];
59 TH2F* h_ped_subtracted_tot_q_vs_ped_[16];
60 TH2F* h_ped_subtracted_tot_q_vs_n_[16];
61 TH2F* h_tot_q_vs_ped_[16];
62 TH2F* h_ped_subtracted_pe_vs_n_[16];
63 TH2F* h_ped_subtracted_pe_vs_t_[16];
64 TH2F* h_avg_q_vs_t_[16];
65
66 TH2F* h_tdc_fire_chan_vs_event_;
67 double y_offset_{35.};
68 double y_to_id_factor_{50. / 80.};
69};
70} // namespace trigscint
71
72#endif /* TRIGSCINT_QIEANALYZER_H */
Base classes for all user event processing components to extend.
Class that stores full reconstructed (linearized) readout QIE sample from the TS.
Base class for a module which does not produce a data product.
virtual void process(Event &event) final
Processing an event for an Analyzer is calling analyze.
Implements an event buffer system for storing event data.
Definition Event.h:42
Class which represents the process under execution.
Definition Process.h:36
Class encapsulating parameters for configuring a processor.
Definition Parameters.h:29
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 onProcessStart() override
Callback for the EventProcessor to take any necessary action when the processing of events starts,...
void configure(framework::config::Parameters &parameters) override
Callback for the EventProcessor to configure itself from the given set of parameters.