2#include "DQM/HCalDQM.h"
17 pe_veto_threshold_ = ps.
get<
double>(
"pe_veto_threshold");
18 section_ = ps.
get<
int>(
"section");
19 max_hit_time_ = ps.
get<
double>(
"max_hit_time");
24 const auto& hcal_hits{
29 analyzeSimHits(hcal_sim_hits);
30 analyzeRecHits(hcal_hits);
32void HCalDQM::analyzeSimHits(
const std::vector<ldmx::SimCalorimeterHit>& hits) {
36 std::map<ldmx::HcalID, double> sim_energy_per_bar;
37 int hit_multiplicity{0};
39 for (
const auto& hit : hits) {
44 const auto energy{hit.getEdep()};
45 if (sim_energy_per_bar.count(
id) == 0) {
46 sim_energy_per_bar[id] = energy;
48 sim_energy_per_bar[id] += energy;
50 const auto orientation{geometry.getScintillatorOrientation(
id)};
51 const auto layer{
id.layer()};
52 const auto strip{
id.strip()};
53 const auto pos{hit.getPosition()};
57 const auto t{hit.getTime()};
63 switch (orientation) {
64 case ldmx::HcalGeometry::ScintillatorOrientation::horizontal:
67 case ldmx::HcalGeometry::ScintillatorOrientation::vertical:
70 case ldmx::HcalGeometry::ScintillatorOrientation::depth:
79 double total_energy{0};
80 for (
const auto [
id, energy] : sim_energy_per_bar) {
82 total_energy += energy;
86void HCalDQM::analyzeRecHits(
const std::vector<ldmx::HcalHit>& hits) {
92 float max_pe_time{-1};
94 float max_pe_adc_time{-1};
96 int vetoable_hit_multiplicity{0};
97 int hit_multiplicity{0};
101 const auto orientation{geometry.getScintillatorOrientation(
id)};
102 const auto section{
id.section()};
103 const auto layer{
id.layer()};
104 const auto strip{
id.strip()};
114 if (hitPassesVeto(hit, section)) {
118 vetoable_hit_multiplicity++;
120 const auto pe{hit.getPE()};
121 const auto t{hit.getTime()};
122 const auto e{hit.getEnergy()};
123 const auto x{hit.getXPos()};
124 const auto y{hit.getYPos()};
125 const auto z{hit.getZPos()};
126 switch (orientation) {
127 case ldmx::HcalGeometry::ScintillatorOrientation::horizontal:
130 case ldmx::HcalGeometry::ScintillatorOrientation::vertical:
133 case ldmx::HcalGeometry::ScintillatorOrientation::depth:
146 if (hit.getIsADC()) {
147 if (pe > max_pe_adc) {
168 histograms_.
fill(
"vetoable_hit_multiplicity", vetoable_hit_multiplicity);
#define DECLARE_ANALYZER(CLASS)
Macro which allows the framework to construct an analyzer given its name during configuration.
Class that translates HCal ID into positions of strip hits.
std::string sim_pass_name_
Hcal Sim Hits pass name.
HCalDQM(const std::string &name, framework::Process &process)
Constructor.
void analyze(const framework::Event &event) override
Process the event and make histograms ro summaries.
std::string rec_pass_name_
Hcal Rec Hits pass name.
void configure(framework::config::Parameters ¶meters) override
Configure the processor using the given user specified parameters.
std::string rec_coll_name_
Hcal Rec Hits collection name.
std::string sim_coll_name_
Hcal Sim Hits collection name.
const T & getCondition(const std::string &condition_name)
Access a conditions object for the current event.
HistogramPool histograms_
helper object for making and filling histograms
Implements an event buffer system for storing event data.
void fill(const std::string &name, const T &val)
Fill a 1D histogram.
Class which represents the process under execution.
Class encapsulating parameters for configuring a processor.
const T & get(const std::string &name) const
Retrieve the parameter of the given name.
static constexpr const char * CONDITIONS_OBJECT_NAME
Conditions object: The name of the python configuration calling this class (Hcal/python/HcalGeometry....
Stores reconstructed hit information from the HCAL.
Implements detector ids for HCal subdetector.
Stores simulated calorimeter hit information.
All classes in the ldmx-sw project use this namespace.