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 output_measurements_passname_ =
10 parameters.get<std::string>("output_measurements_passname");
11 measurements_passname_ = parameters.get<std::string>("measurements_passname");
12}
13
15 if (!event.exists("OutputMeasurements", output_measurements_passname_))
16 return;
17 auto measurements{event.getCollection<ldmx::Measurement>(
18 "OutputMeasurements", measurements_passname_)};
19
20 for (auto& measurement : measurements) {
21 auto global_position{measurement.getGlobalPosition()};
22 auto local_position{measurement.getLocalPosition()};
23 auto layer_id{measurement.getLayerID()};
24 auto time{measurement.getTime()};
25
26 histograms_.fill("global_yz_l" + std::to_string(layer_id),
27 global_position[1], global_position[2]);
28 histograms_.fill("global_xy", global_position[0], global_position[1]);
29
30 histograms_.fill("local_uv_l" + std::to_string(layer_id), local_position[0],
31 local_position[1]);
32
33 histograms_.fill("time_l" + std::to_string(layer_id), time);
34 }
35}
36} // namespace tracking::dqm
37
#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:42
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 T &val)
Fill a 1D histogram.
Class encapsulating parameters for configuring a processor.
Definition Parameters.h:29
const T & get(const std::string &name) const
Retrieve the parameter of the given name.
Definition Parameters.h:78
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.