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
10namespace tracking::dqm {
11
12enum PIDBins {
13 kminus = -4,
14 antiproton,
15 piminus,
16 positron,
17 electron,
18 piplus,
19 proton,
20 kplus
21};
22
24 public:
25 TrackingRecoDQM(const std::string& name, framework::Process& process)
26 : framework::Analyzer(name, process) {};
27
29 ~TrackingRecoDQM() = default;
30
31 void analyze(const framework::Event& event) override;
32
33 void trackMonitoring(const std::vector<ldmx::Track>& tracks,
34 const std::vector<ldmx::Measurement>& measurements,
35 const std::string title, const bool& doDetail,
36 const bool& doTruth);
37
38 void efficiencyPlots(const std::vector<ldmx::Track>& tracks,
39 const std::vector<ldmx::Measurement>& measurements,
40 const std::string& title);
41
49 void trackStateMonitoring(const std::vector<ldmx::Track>& tracks,
50 ldmx::TrackStateType ts_type,
51 const std::string& ts_title);
58 void configure(framework::config::Parameters& parameters) override;
59
60 void onProcessEnd() override;
61
62 void sortTracks(const std::vector<ldmx::Track>& tracks,
63 std::vector<ldmx::Track>& uniqueTracks,
64 std::vector<ldmx::Track>& duplicateTracks,
65 std::vector<ldmx::Track>& fakeTracks);
66
67 private:
68 std::string track_collection_;
69 std::string truth_collection_;
70 std::string measurement_collection_;
71 std::string measurement_passname_;
72
73 std::string ecal_sp_coll_name_;
74 std::string ecal_sp_passname_;
75 std::string target_sp_coll_name_;
76 std::string target_sp_passname_;
77 std::string track_collection_events_passname_;
78 std::string track_passname_;
79 std::string truth_events_passname_;
80 std::string truth_passname_;
81
82 std::string title_{"tagger_trk_"};
83 double track_prob_cut_{0.5};
84 std::string subdetector_{"Tagger"};
85 bool do_truth_comparison_{false};
86 std::vector<std::string> track_states_;
87
88 // Truth Track collection
89 std::shared_ptr<std::vector<ldmx::Track>> truth_track_collection_{nullptr};
90
91 // Ecal scoring plane hits_
92 std::shared_ptr<std::vector<ldmx::SimTrackerHit>> ecal_scoring_hits_{nullptr};
93
94 // Target scoring plane hits_
95 std::shared_ptr<std::vector<ldmx::SimTrackerHit>> target_scoring_hits_{
96 nullptr};
97
98 // If I have truth information, sort the tracks vector according to their
99 // trackID and truthProb
100 // real tracks (truth_prob > cut), unique
101 std::vector<ldmx::Track> unique_tracks_;
102 // real tracks (truth_prob > cut), duplicated
103 std::vector<ldmx::Track> duplicate_tracks_;
104 // fake tracks (truth_prob < cut)
105 std::vector<ldmx::Track> fake_tracks_;
106
107 // PID mapping
108 std::map<int, int> pidmap_;
109};
110} // 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.
virtual void process(Event &event) final
Processing an event for an Analyzer is calling analyze.
Implements an event buffer system for storing event data.
Definition Event.h:40
Class which represents the process under execution.
Definition Process.h:34
Class encapsulating parameters for configuring a processor.
Definition Parameters.h:26
~TrackingRecoDQM()=default
Destructor.
void trackStateMonitoring(const std::vector< ldmx::Track > &tracks, ldmx::TrackStateType ts_type, const std::string &ts_title)
Monitoring plots for tracks extrapolated to the ECAL Scoring plane.
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.