LDMX Software
TrigScintTrackDQM.cxx
1#include "DQM/TrigScintTrackDQM.h"
2
3namespace dqm {
4
6 framework::Process &process)
7 : framework::Analyzer(name, process) {}
8
11
12 histograms_.create("centroid", "Track channel centroid", 500, 0, 100);
14 "n_tracks", "TrigScint track multiplicity in the pad/event", 25, 0, 25);
15 histograms_.create("n_clusters", "n_{clusters} forming the track", 4, 0, 4);
16 histograms_.create("residual", "Track residual [channels]", 100, 0., 2.);
17 histograms_.create("beamEfrac",
18 "Track edep fraction associated with beam electron", 101,
19 0., 1.01);
20 histograms_.create("x", "Track x position [mm]", 1000, -100, 100);
21 histograms_.create("y", "Track y position [mm]", 1000, -100, 100);
22 histograms_.create("z", "Track z position [mm]", 1000, -900, 100);
23
24 // TODO: implement getting a list of the constructed histograms, to iterate
25 // through and set overflow boolean.
26}
27
29 track_collection_name_ = ps.get<std::string>("track_collection");
30 pass_name_ = ps.get<std::string>("passName").c_str();
31
32 ldmx_log(debug) << "Collection name = " << track_collection_name_
33 << " pass name =" << pass_name_;
34}
35
37 // Get the collection of TrigScintTrack digitized tracks if the exists
38 const std::vector<ldmx::TrigScintTrack> trig_scint_tracks =
40 pass_name_);
41
42 // Loop through all TrigScint tracks in the event
43 for (const ldmx::TrigScintTrack &track : trig_scint_tracks) {
44 histograms_.fill("centroid", track.getCentroid());
45 histograms_.fill("residual", track.getResidual());
46 histograms_.fill("n_clusters", track.getNclusters());
47 histograms_.fill("beamEfrac", track.getBeamEfrac());
48
49 histograms_.fill("x", track.getCentroidX());
50 histograms_.fill("y", track.getCentroidY());
51 histograms_.fill("z", track.getCentroidZ());
52 }
53
54 histograms_.fill("n_tracks", trig_scint_tracks.size());
55}
56
57} // namespace dqm
58
#define DECLARE_ANALYZER(CLASS)
Macro which allows the framework to construct an analyzer given its name during configuration.
void configure(framework::config::Parameters &pSet)
Configure the processor using the given user specified parameters.
std::string track_collection_name_
Name of trigger pad track collection.
TrigScintTrackDQM(const std::string &name, framework::Process &process)
Constructor.
void analyze(const framework::Event &event)
Process the event and make histograms ro summaries.
void onProcessStart()
Method executed before processing of events begins.
HistogramPool histograms_
helper object for making and filling histograms
TDirectory * getHistoDirectory()
Access/create a directory in the histogram file for this event processor to create histograms and ana...
Implements an event buffer system for storing event data.
Definition Event.h:42
void create(const config::Parameters &p)
Create a histogram from the input configuration parameters.
void fill(const std::string &name, const T &val)
Fill a 1D histogram.
Class which represents the process under execution.
Definition Process.h:36
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
Represents a track of trigger scintillator clusters.
All classes in the ldmx-sw project use this namespace.