LDMX Software
TrigScintTrackDQM.cxx
1#include "DQM/TrigScintTrackDQM.h"
2
3namespace dqm {
4
6 framework::Process &process)
7 : framework::Analyzer(name, process) {}
8
10
13
14 histograms_.create("centroid", "Track channel centroid", 500, 0, 100);
16 "n_tracks", "TrigScint track multiplicity in the pad/event", 25, 0, 25);
17 histograms_.create("n_clusters", "N_{clusters} forming the track", 4, 0, 4);
18 histograms_.create("residual", "Track residual [channels]", 100, 0., 2.);
19 histograms_.create("beamEfrac",
20 "Track edep fraction associated with beam electron", 101,
21 0., 1.01);
22 histograms_.create("x", "Track x position", 1000, -100, 100);
23 histograms_.create("y", "Track y position", 1000, -100, 100);
24 histograms_.create("z", "Track z position", 1000, -900, 100);
25
26 // TODO: implement getting a list of the constructed histograms, to iterate
27 // through and set overflow boolean.
28}
29
31 trackCollectionName_ = ps.getParameter<std::string>("track_collection");
32 passName_ = ps.getParameter<std::string>("passName").c_str();
33
34 ldmx_log(info) << "In TrigScintTrackDQM::configure, got parameters "
35 << trackCollectionName_ << " and " << passName_;
36}
37
39 // Get the collection of TrigScintTrack digitized tracks if the exists
40 const std::vector<ldmx::TrigScintTrack> TrigScintTracks =
41 event.getCollection<ldmx::TrigScintTrack>(trackCollectionName_,
42 passName_);
43
44 // Loop through all TrigScint tracks in the event
45 for (const ldmx::TrigScintTrack &track : TrigScintTracks) {
46 histograms_.fill("centroid", track.getCentroid());
47 histograms_.fill("residual", track.getResidual());
48 histograms_.fill("n_clusters", track.getNclusters());
49 histograms_.fill("beamEfrac", track.getBeamEfrac());
50
51 histograms_.fill("x", track.getCentroidX());
52 histograms_.fill("y", track.getCentroidY());
53 histograms_.fill("z", track.getCentroidZ());
54 }
55
56 histograms_.fill("n_tracks", TrigScintTracks.size());
57}
58
59} // namespace dqm
60
61DECLARE_ANALYZER_NS(dqm, TrigScintTrackDQM)
#define DECLARE_ANALYZER_NS(NS, CLASS)
Macro which allows the framework to construct an analyzer given its name during configuration.
std::string trackCollectionName_
Name of trigger pad track collection.
void configure(framework::config::Parameters &pSet)
Configure the processor using the given user specified parameters.
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.
TDirectory * getHistoDirectory()
Access/create a directory in the histogram file for this event processor to create histograms and ana...
HistogramHelper histograms_
Interface class for making and filling histograms.
Implements an event buffer system for storing event data.
Definition Event.h:41
void fill(const std::string &name, const double &val)
Fill a 1D histogram.
Definition Histograms.h:166
void create(const std::string &name, const std::string &xLabel, const double &bins, const double &xmin, const double &xmax)
Create a ROOT 1D histogram of type TH1F and pool it for later use.
Class which represents the process under execution.
Definition Process.h:36
Class encapsulating parameters for configuring a processor.
Definition Parameters.h:27
T getParameter(const std::string &name) const
Retrieve the parameter of the given name.
Definition Parameters.h:89
Represents a track of trigger scintillator clusters.
All classes in the ldmx-sw project use this namespace.
Definition PerfDict.cxx:45