2#include "DQM/HCalDQM.h"
13 pe_veto_threshold = ps.
getParameter<
double>(
"pe_veto_threshold");
25 analyzeSimHits(hcalSimHits);
26 analyzeRecHits(hcalHits);
28void HCalDQM::analyzeSimHits(
const std::vector<ldmx::SimCalorimeterHit> &hits) {
29 const auto &geometry = getCondition<ldmx::HcalGeometry>(
32 std::map<ldmx::HcalID, double> simEnergyPerBar;
33 int hitMultiplicity{0};
35 for (
const auto &hit : hits) {
40 const auto energy{hit.getEdep()};
41 if (simEnergyPerBar.count(
id) == 0) {
42 simEnergyPerBar[id] = energy;
44 simEnergyPerBar[id] += energy;
46 const auto orientation{geometry.getScintillatorOrientation(
id)};
47 const auto layer{
id.layer()};
48 const auto strip{
id.strip()};
49 const auto pos{hit.getPosition()};
53 const auto t{hit.getTime()};
59 switch (orientation) {
60 case ldmx::HcalGeometry::ScintillatorOrientation::horizontal:
63 case ldmx::HcalGeometry::ScintillatorOrientation::vertical:
66 case ldmx::HcalGeometry::ScintillatorOrientation::depth:
75 double total_energy{0};
76 for (
const auto [
id, energy] : simEnergyPerBar) {
78 total_energy += energy;
82void HCalDQM::analyzeRecHits(
const std::vector<ldmx::HcalHit> &hits) {
83 const auto &geometry = getCondition<ldmx::HcalGeometry>(
90 int vetoableHitMultiplicity{0};
91 int hitMultiplicity{0};
95 const auto orientation{geometry.getScintillatorOrientation(
id)};
96 const auto section{
id.section()};
97 const auto layer{
id.layer()};
98 const auto strip{
id.strip()};
108 if (hitPassesVeto(hit, section)) {
112 vetoableHitMultiplicity++;
114 const auto pe{hit.getPE()};
115 const auto t{hit.getTime()};
116 const auto e{hit.getEnergy()};
117 const auto x{hit.getXPos()};
118 const auto y{hit.getYPos()};
119 const auto z{hit.getZPos()};
120 switch (orientation) {
121 case ldmx::HcalGeometry::ScintillatorOrientation::horizontal:
124 case ldmx::HcalGeometry::ScintillatorOrientation::vertical:
127 case ldmx::HcalGeometry::ScintillatorOrientation::depth:
151 histograms_.
fill(
"vetoable_hit_multiplicity", vetoableHitMultiplicity);
#define DECLARE_ANALYZER_NS(NS, CLASS)
Macro which allows the framework to construct an analyzer given its name during configuration.
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.
HistogramHelper histograms_
Interface class for making and filling histograms.
Implements an event buffer system for storing event data.
void fill(const std::string &name, const double &val)
Fill a 1D histogram.
Class which represents the process under execution.
Class encapsulating parameters for configuring a processor.
T getParameter(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.