LDMX Software
TrackerDigiDQM.cxx
1#include "Tracking/dqm/TrackerDigiDQM.h"
2
3#include "Tracking/Event/Measurement.h"
4
5namespace tracking::dqm {
6
8 output_measurements_passname_ =
9 parameters.get<std::string>("output_measurements_passname");
10 measurements_passname_ = parameters.get<std::string>("measurements_passname");
11}
12
14 if (!event.exists("OutputMeasurements", output_measurements_passname_))
15 return;
16 auto measurements{event.getCollection<ldmx::Measurement>(
17 "OutputMeasurements", measurements_passname_)};
18
19 for (auto& measurement : measurements) {
20 auto global_position{measurement.getGlobalPosition()};
21 auto local_position{measurement.getLocalPosition()};
22 auto layer_id{measurement.getLayerID()};
23 auto time{measurement.getTime()};
24
25 histograms_.fill("global_yz_l" + std::to_string(layer_id),
26 global_position[1], global_position[2]);
27 histograms_.fill("global_xy", global_position[0], global_position[1]);
28
29 histograms_.fill("local_uv_l" + std::to_string(layer_id), local_position[0],
30 local_position[1]);
31
32 histograms_.fill("time_l" + std::to_string(layer_id), time);
33 }
34}
35} // namespace tracking::dqm
36
#define DECLARE_ANALYZER(CLASS)
Macro which allows the framework to construct an analyzer given its name during configuration.
HistogramPool histograms_
helper object for making and filling histograms
Implements an event buffer system for storing event data.
Definition Event.h:40
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:107
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
void analyze(const framework::Event &event) override
Process the event and make histograms or summaries.
void configure(framework::config::Parameters &parameters) override
Callback for the EventProcessor to configure itself from the given set of parameters.