LDMX Software
StraightTracksDQM.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/StraightTrack.h"
9
10namespace tracking::dqm {
11
13 public:
14 StraightTracksDQM(const std::string& name, framework::Process& process)
15 : framework::Analyzer(name, process){};
16
18 ~StraightTracksDQM() = default;
19
20 void analyze(const framework::Event& event) override;
21
22 // Track monitoring for non-unique tracks (no truth comparison)
23 void trackMonitoring(const std::vector<ldmx::StraightTrack>& tracks,
24 const std::vector<ldmx::Measurement>& measurements,
25 const std::string title, const bool& do_detail);
26
27 // Track monitoring for unique tracks (has a truth comparison)
28 void trackMonitoringUnique(const std::vector<ldmx::StraightTrack>& tracks,
29 const std::vector<ldmx::Measurement>& measurements,
30 const std::string title, const bool& do_detail,
31 const bool& do_truth);
32
33 void configure(framework::config::Parameters& parameters) override;
34
35 // Distinguish which tracks are unique, duplicates, fake
36 void sortTracks(const std::vector<ldmx::StraightTrack>& tracks,
37 std::vector<ldmx::StraightTrack>& unique_tracks,
38 std::vector<ldmx::StraightTrack>& duplicate_tracks,
39 std::vector<ldmx::StraightTrack>& fake_tracks);
40
41 // Helper Functions: propogate track parameter error into calculation of
42 // angles and ecal_locs. I use error propagation based on partial derivatives
43 // of functions that determine theta/phi/loc
44 double thetaAngleError(double m_x, double m_y,
45 const std::vector<double>& covariance_vector);
46 double phiAngleError(double m_x,
47 const std::vector<double>& covariance_vector);
48 double locError(double var_slope, double var_intercept,
49 double cov_slope_intercept, double z_pos);
50
51 private:
52 std::string track_collection_{"LinearRecoilTracks"};
53 std::string truth_collection_{"LinearRecoilTruthTracks"};
54 std::string measurement_collection_{"DigiRecoilSimHits"};
55 std::string title_{"recoil_lin_trk_"};
56 std::string input_pass_name_{""};
57 double track_prob_cut_{0.5};
58 std::string subdetector_{"Recoil"};
59 bool do_truth_comparison_{false};
60
61 // Truth Track collection
62 std::shared_ptr<ldmx::StraightTracks> truth_track_collection_{nullptr};
63
64 // If I have truth information, sort the tracks vector according to their
65 // trackID and truthProb
66 // real tracks (truth_prob > cut), unique
67 std::vector<ldmx::StraightTrack> unique_tracks_;
68 // real tracks (truth_prob > cut), duplicated
69 std::vector<ldmx::StraightTrack> duplicate_tracks_;
70 // fake tracks (truth_prob < cut)
71 std::vector<ldmx::StraightTrack> fake_tracks_;
72};
73} // 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:42
Class which represents the process under execution.
Definition Process.h:36
Class encapsulating parameters for configuring a processor.
Definition Parameters.h:29
void configure(framework::config::Parameters &parameters) override
Callback for the EventProcessor to configure itself from the given set of parameters.
~StraightTracksDQM()=default
Destructor.
void analyze(const framework::Event &event) override
Process the event and make histograms or summaries.