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