LDMX Software
EcalRecHitDQM.cxx
1#include "DQM/EcalRecHitDQM.h"
2
3#include "DetDescr/EcalID.h"
4#include "Ecal/Event/EcalHit.h"
5
6namespace dqm {
7
9 rec_hit_coll_ = ps.get<std::string>("rec_hit_coll");
10 rec_hit_pass_ = ps.get<std::string>("rec_hit_pass");
11 mip_si_energy_ = ps.get<double>("mip_si_energy");
12}
13
16 histograms_.create("n_hits", "Rec Hits per Event", 50, -0.5, 49.5);
17 histograms_.create("amplitude", "Amplitude [MIPs]", 100, 0, 4);
18 histograms_.create("time", "Hit Time [ns]", 100, -100, 100);
19 histograms_.create("layer", "Layer", 34, -0.5, 33.5);
20 histograms_.create("cell", "Cell", 432, -0.5, 431.5);
21}
22
24 const auto& hits{
25 event.getCollection<ldmx::EcalHit>(rec_hit_coll_, rec_hit_pass_)};
26 histograms_.fill("n_hits", hits.size());
27 for (const auto& hit : hits) {
28 ldmx::EcalID id(hit.getID());
29 histograms_.fill("amplitude", hit.getAmplitude() / mip_si_energy_);
30 histograms_.fill("time", hit.getTime());
31 histograms_.fill("layer", id.layer());
32 histograms_.fill("cell", id.cell());
33 }
34}
35
36} // namespace dqm
37
Class that defines an ECal detector ID with a cell number.
#define DECLARE_ANALYZER(CLASS)
Macro which allows the framework to construct an analyzer given its name during configuration.
Histograms of ECal rec hits that need no simulation truth, e.g.
void configure(framework::config::Parameters &parameters) override
configure the input names
double mip_si_energy_
Si energy of one MIP [MeV], converts the hit amplitude to MIPs.
std::string rec_hit_coll_
name of the rec hit collection
void analyze(const framework::Event &event) override
fill the histograms
std::string rec_hit_pass_
pass of the rec hits
void onProcessStart() override
create the histograms
HistogramPool histograms_
helper object for making and filling histograms
TDirectory * getHistoDirectory()
Access/create a directory in the histogram file for this event processor to create histograms and ana...
Implements an event buffer system for storing event data.
Definition Event.h:40
void create(const config::Parameters &p)
Create a histogram from the input configuration parameters.
void fill(const std::string &name, const T &val)
Fill a 1D histogram.
Class encapsulating parameters for configuring a processor.
Definition Parameters.h:26
const T & get(const std::string &name) const
Retrieve the parameter of the given name.
Definition Parameters.h:75
Stores reconstructed hit information from the ECAL.
Definition EcalHit.h:19
Extension of DetectorID providing access to ECal layers and cell numbers in a hex grid.
Definition EcalID.h:20