LDMX Software
TrackerDigiDQM.cxx
1#include "Tracking/dqm/TrackerDigiDQM.h"
2
3#include "SimCore/Event/SimParticle.h"
4#include "Tracking/Event/Measurement.h"
5
6namespace tracking::dqm {
7
9 if (!event.exists("OutputMeasurements")) return;
10 auto measurements{
11 event.getCollection<ldmx::Measurement>("OutputMeasurements")};
12
13 for (auto& measurement : measurements) {
14 auto global_position{measurement.getGlobalPosition()};
15 auto local_position{measurement.getLocalPosition()};
16 auto layer_id{measurement.getLayerID()};
17 auto time{measurement.getTime()};
18
19 histograms_.fill("global_yz_l" + std::to_string(layer_id),
20 global_position[1], global_position[2]);
21 histograms_.fill("global_xy", global_position[0], global_position[1]);
22
23 histograms_.fill("local_uv_l" + std::to_string(layer_id), local_position[0],
24 local_position[1]);
25
26 histograms_.fill("time_l" + std::to_string(layer_id), time);
27 }
28}
29} // namespace tracking::dqm
30
31DECLARE_ANALYZER_NS(tracking::dqm, TrackerDigiDQM)
#define DECLARE_ANALYZER_NS(NS, CLASS)
Macro which allows the framework to construct an analyzer given its name during configuration.
HistogramHelper histograms_
Interface class for making and filling histograms.
Implements an event buffer system for storing event data.
Definition Event.h:41
bool exists(const std::string &name, const std::string &passName="", bool unique=true) const
Check for the existence of an object or collection with the given name and pass name in the event.
Definition Event.cxx:92
void fill(const std::string &name, const double &val)
Fill a 1D histogram.
Definition Histograms.h:166
std::array< float, 3 > getGlobalPosition() const
Definition Measurement.h:47
void analyze(const framework::Event &event) override
Process the event and make histograms or summaries.