LDMX Software
TrigScintTrackDQM.cxx
1#include "DQM/TrigScintTrackDQM.h"
2
3#include "TrigScint/Event/TrigScintTrack.h"
4
5namespace dqm {
6
8 framework::Process& process)
9 : framework::Analyzer(name, process) {}
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 [mm]", 1000, -100, 100);
23 histograms_.create("y", "Track y position [mm]", 1000, -100, 100);
24 histograms_.create("z", "Track z position [mm]", 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 track_collection_name_ = ps.get<std::string>("track_collection");
32 pass_name_ = ps.get<std::string>("pass_name").c_str();
33
34 ldmx_log(debug) << "Collection name = " << track_collection_name_
35 << " pass name =" << pass_name_;
36}
37
39 // Get the collection of TrigScintTrack digitized tracks if the exists
40 if (not event.exists(track_collection_name_, pass_name_)) return;
41 const std::vector<ldmx::TrigScintTrack> trig_scint_tracks =
43 pass_name_);
44
45 // Loop through all TrigScint tracks in the event
46 for (const ldmx::TrigScintTrack& track : trig_scint_tracks) {
47 histograms_.fill("centroid", track.getCentroid());
48 histograms_.fill("residual", track.getResidual());
49 histograms_.fill("n_clusters", track.getNclusters());
50 histograms_.fill("beamEfrac", track.getBeamEfrac());
51
52 histograms_.fill("x", track.getCentroidX());
53 histograms_.fill("y", track.getCentroidY());
54 histograms_.fill("z", track.getCentroidZ());
55 }
56
57 histograms_.fill("n_tracks", trig_scint_tracks.size());
58}
59
60} // namespace dqm
61
#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: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 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:34
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
Represents a track of trigger scintillator clusters.
All classes in the ldmx-sw project use this namespace.