LDMX Software
TrackingRecoDQM.h
1#pragma once
2
3#include "Framework/Configure/Parameters.h"
4#include "Framework/Event.h"
7#include "Tracking/Event/Measurement.h"
8#include "Tracking/Event/Track.h"
9#include "Tracking/Event/TruthTrack.h"
10
11namespace tracking::dqm {
12
13enum PIDBins {
14 kminus = -4,
15 antiproton,
16 piminus,
17 positron,
18 electron,
19 piplus,
20 proton,
21 kplus
22};
23
25 public:
26 TrackingRecoDQM(const std::string& name, framework::Process& process)
27 : framework::Analyzer(name, process){};
28
30 ~TrackingRecoDQM() = default;
31
32 void analyze(const framework::Event& event) override;
33
34 void TrackMonitoring(const std::vector<ldmx::Track>& tracks,
35 const std::vector<ldmx::Measurement>& measurements,
36 const std::string title, const bool& doDetail,
37 const bool& doTruth);
38
39 void EfficiencyPlots(const std::vector<ldmx::Track>& tracks,
40 const std::vector<ldmx::Measurement>& measurements,
41 const std::string& title);
42
50 void TrackStateMonitoring(const ldmx::Tracks& tracks,
51 ldmx::TrackStateType ts_type,
52 const std::string& ts_title);
59 void configure(framework::config::Parameters& parameters) override;
60
61 void onProcessEnd() override;
62
63 void sortTracks(const std::vector<ldmx::Track>& tracks,
64 std::vector<ldmx::Track>& uniqueTracks,
65 std::vector<ldmx::Track>& duplicateTracks,
66 std::vector<ldmx::Track>& fakeTracks);
67
68 private:
69 std::string trackCollection_{"TruthTracks"};
70 std::string truthCollection_{"TaggerTruthTracks"};
71 std::string measurementCollection_{"DigiTaggerSimHits"};
72 std::string title_{"tagger_trk_"};
73 double trackProb_cut_{0.5};
74 std::string subdetector_{"Tagger"};
75 bool doTruthComparison{false};
76 bool debug_{false};
77 std::vector<std::string> trackStates_;
78
79 // Truth Track collection
80 std::shared_ptr<ldmx::Tracks> truthTrackCollection_{nullptr};
81
82 // Ecal scoring plane hits
83 std::shared_ptr<std::vector<ldmx::SimTrackerHit>> ecal_scoring_hits_{nullptr};
84
85 // Target scoring plane hits
86 std::shared_ptr<std::vector<ldmx::SimTrackerHit>> target_scoring_hits_{
87 nullptr};
88
89 // If I have truth information, sort the tracks vector according to their
90 // trackID and truthProb
91 // real tracks (truth_prob > cut), unique
92 std::vector<ldmx::Track> uniqueTracks_;
93 // real tracks (truth_prob > cut), duplicated
94 std::vector<ldmx::Track> duplicateTracks_;
95 // fake tracks (truth_prob < cut)
96 std::vector<ldmx::Track> fakeTracks_;
97
98 // PID mapping
99 std::map<int, int> pidmap;
100};
101} // namespace tracking::dqm
Base classes for all user event processing components to extend.
Class implementing an event buffer system for storing event data.
Class which encapsulates information from a hit in a simulated tracking detector.
Base class for a module which does not produce a data product.
Implements an event buffer system for storing event data.
Definition Event.h:41
Class which represents the process under execution.
Definition Process.h:36
Class encapsulating parameters for configuring a processor.
Definition Parameters.h:27
void TrackStateMonitoring(const ldmx::Tracks &tracks, ldmx::TrackStateType ts_type, const std::string &ts_title)
Monitoring plots for tracks extrapolated to the ECAL Scoring plane.
~TrackingRecoDQM()=default
Destructor.
void onProcessEnd() override
Callback for the EventProcessor to take any necessary action when the processing of events finishes,...
void configure(framework::config::Parameters &parameters) override
Configure the analyzer using the given user specified parameters.
void analyze(const framework::Event &event) override
Process the event and make histograms or summaries.