LDMX Software
TruthMatchingTool.h
1#pragma once
2#include "Acts/EventData/VectorTrackContainer.hpp"
3#include "SimCore/Event/SimParticle.h"
4#include "Tracking/Event/Measurement.h"
5#include "Tracking/Event/Track.h"
6#include "Tracking/Reco/TruthMatchingTool.h"
7
8namespace tracking {
9namespace sim {
10
12 public:
13 struct TruthInfo {
14 int trackID;
15 double truthProb;
16 int pdgID;
17 };
18
19 TruthMatchingTool() = default;
20
28 TruthMatchingTool(const std::map<int, ldmx::SimParticle>& particleMap,
29 const std::vector<ldmx::Measurement>& measurements) {
30 setup(particleMap, measurements);
31 };
32
33 void setup(const std::map<int, ldmx::SimParticle>& particleMap,
34 const std::vector<ldmx::Measurement>& measurements) {
35 map_ = particleMap;
36 measurements_ = measurements;
37 configured_ = true;
38 }
39
44 ~TruthMatchingTool() = default;
45
47 TruthInfo Evaluate(
48 const std::unordered_map<unsigned int, unsigned int>& trk_trackIDs,
49 int n_meas);
50 TruthInfo TruthMatch(const std::vector<ldmx::Measurement>& vmeas);
51
52 bool configured() { return configured_; }
53
54 private:
55 std::map<int, ldmx::SimParticle> map_;
56 std::vector<ldmx::Measurement> measurements_;
57 bool debug_{false};
58 std::shared_ptr<tracking::sim::TruthMatchingTool> truthMatchingTool = nullptr;
59 bool configured_{false};
60};
61
62} // namespace sim
63} // namespace tracking
Implementation of a track object.
Definition Track.h:52
TruthInfo TruthMatch(const ldmx::Track &trk)
Performs the truth matching by checking all the trackIDs associated to the measurements on track.
TruthMatchingTool(const std::map< int, ldmx::SimParticle > &particleMap, const std::vector< ldmx::Measurement > &measurements)
Constructor.
~TruthMatchingTool()=default
Destructor.
The measurement calibrator can be a function or a class/struct able to retrieve the sim hits containe...