ATLAS Offline Software
ITrackMatchingLookup.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef INDETTRACKPERFMON_ITRACKMATCHINGLOOKUP_H
6 #define INDETTRACKPERFMON_ITRACKMATCHINGLOOKUP_H
7 
18 
20 #include <string>
21 #include <vector>
22 
26 
27 
28 namespace IDTPM {
29 
31 
32  public:
33 
35  virtual ~ITrackMatchingLookup() = default;
36 
38  virtual unsigned getNmatches( bool getRefN = false ) const = 0;
39 
41  const std::string& anaTag() const { return m_anaTag; }
42  void anaTag( std::string_view anaTag_s ) {
43  m_anaTag = anaTag_s;
44  }
45  const std::string& chainRoiName() const { return m_chainRoiName; }
46  void chainRoiName( std::string_view chainRoiName_s ) {
47  m_chainRoiName = chainRoiName_s;
48  }
49 
53  const xAOD::TrackParticle& t ) const = 0;
56  const xAOD::TruthParticle& t ) const = 0;
59  const xAOD::TrackParticle& t ) const = 0;
62  const xAOD::TruthParticle& ) const { return nullptr; };
63 
66  virtual const std::vector< const xAOD::TrackParticle* >& getMatchedTestTracks(
67  const xAOD::TrackParticle& r ) const = 0;
69  virtual const std::vector< const xAOD::TrackParticle* >& getMatchedTestTracks(
70  const xAOD::TruthParticle& r ) const = 0;
72  virtual const std::vector< const xAOD::TruthParticle* >& getMatchedTestTruths(
73  const xAOD::TrackParticle& r ) const = 0;
75  const std::vector< const xAOD::TruthParticle* >& getMatchedTestTruths(
76  const xAOD::TruthParticle& ) const { return m_nullTruthVec; }
77 
82  const xAOD::TrackParticle& r ) const
83  {
84  const std::vector< const xAOD::TrackParticle* >& vec =
86  return vec.empty() ? nullptr : vec[0];
87  }
90  const xAOD::TruthParticle& r ) const
91  {
92  const std::vector< const xAOD::TrackParticle* >& vec =
94  return vec.empty() ? nullptr : vec[0];
95  }
98  const xAOD::TrackParticle& r ) const
99  {
100  const std::vector< const xAOD::TruthParticle* >& vec =
102  return vec.empty() ? nullptr : vec[0];
103  }
106  const xAOD::TruthParticle& ) const { return nullptr; };
107 
109  virtual bool isTestMatched( const xAOD::TrackParticle& t ) const = 0;
110  virtual bool isTestMatched( const xAOD::TruthParticle& t ) const = 0;
111 
113  virtual bool isRefMatched( const xAOD::TrackParticle& r ) const = 0;
114  virtual bool isRefMatched( const xAOD::TruthParticle& r ) const = 0;
115 
119  const xAOD::TrackParticle& r,
120  float dist = 0. ) = 0;
123  const xAOD::TruthParticle& r,
124  float dist = 0. ) = 0;
127  const xAOD::TrackParticle& r,
128  float dist = 0. ) = 0;
129 
131  virtual void clear() = 0;
132 
135  virtual std::string printInfo(
136  const std::vector< const xAOD::TrackParticle* >& testVec,
137  const std::vector< const xAOD::TrackParticle* >& refVec ) const = 0;
139  virtual std::string printInfo(
140  const std::vector< const xAOD::TrackParticle* >& testVec,
141  const std::vector< const xAOD::TruthParticle* >& refVec ) const = 0;
143  virtual std::string printInfo(
144  const std::vector< const xAOD::TruthParticle* >& testVec,
145  const std::vector< const xAOD::TrackParticle* >& refVec ) const = 0;
146 
147  protected:
148 
150  std::vector< const xAOD::TrackParticle* > m_nullTrackVec{};
151  std::vector< const xAOD::TruthParticle* > m_nullTruthVec{};
152 
153  private:
154 
156  std::string m_anaTag;
157  std::string m_chainRoiName;
158 
159 
160  }; // class ITrackMatchingLookup
161 
162 } // namespace IDTPM
163 
164 #endif // > !INDETTRACKPERFMON_ITRACKMATCHINGLOOKUP_H
beamspotman.r
def r
Definition: beamspotman.py:676
IDTPM::ITrackMatchingLookup::m_nullTrackVec
std::vector< const xAOD::TrackParticle * > m_nullTrackVec
null vectors
Definition: ITrackMatchingLookup.h:150
IDTPM::ITrackMatchingLookup::update
virtual StatusCode update(const xAOD::TruthParticle &t, const xAOD::TrackParticle &r, float dist=0.)=0
Truth -> Track.
IDTPM::ITrackMatchingLookup::getMatchedTestTruths
virtual const std::vector< const xAOD::TruthParticle * > & getMatchedTestTruths(const xAOD::TrackParticle &r) const =0
vec Truth <- Track
IDTPM::ITrackMatchingLookup::anaTag
void anaTag(std::string_view anaTag_s)
Definition: ITrackMatchingLookup.h:42
IDTPM::ITrackMatchingLookup::chainRoiName
const std::string & chainRoiName() const
Definition: ITrackMatchingLookup.h:45
vec
std::vector< size_t > vec
Definition: CombinationsGeneratorTest.cxx:12
IDTPM::ITrackMatchingLookup::getMatchedRefTruth
const xAOD::TruthParticle * getMatchedRefTruth(const xAOD::TruthParticle &) const
Truth -> Truth // to avoid compilation errors.
Definition: ITrackMatchingLookup.h:61
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
IDTPM::ITrackMatchingLookup::getMatchedTestTracks
virtual const std::vector< const xAOD::TrackParticle * > & getMatchedTestTracks(const xAOD::TruthParticle &r) const =0
vec Track <- Truth
IDTPM::ITrackMatchingLookup::getMatchedRefTrack
virtual const xAOD::TrackParticle * getMatchedRefTrack(const xAOD::TrackParticle &t) const =0
get matched reference (1 to 1) Track -> Track
IDTPM::ITrackMatchingLookup::isRefMatched
virtual bool isRefMatched(const xAOD::TruthParticle &r) const =0
IDTPM::ITrackMatchingLookup::getBestMatchedTestTruth
virtual const xAOD::TruthParticle * getBestMatchedTestTruth(const xAOD::TrackParticle &r) const
best Truth <- Track
Definition: ITrackMatchingLookup.h:97
IDTPM::ITrackMatchingLookup::getMatchedRefTruth
virtual const xAOD::TruthParticle * getMatchedRefTruth(const xAOD::TrackParticle &t) const =0
Track -> Truth.
IDTPM::ITrackMatchingLookup::anaTag
const std::string & anaTag() const
matching properties
Definition: ITrackMatchingLookup.h:41
IDTPM::ITrackMatchingLookup::getMatchedRefTrack
virtual const xAOD::TrackParticle * getMatchedRefTrack(const xAOD::TruthParticle &t) const =0
Truth -> Track.
IDTPM::ITrackMatchingLookup::update
virtual StatusCode update(const xAOD::TrackParticle &t, const xAOD::TruthParticle &r, float dist=0.)=0
Track -> Truth.
IDTPM::ITrackMatchingLookup::getMatchedTestTruths
const std::vector< const xAOD::TruthParticle * > & getMatchedTestTruths(const xAOD::TruthParticle &) const
vec Truth <- Truth // to avoid compilation errors
Definition: ITrackMatchingLookup.h:75
IDTPM::ITrackMatchingLookup::getMatchedTestTracks
virtual const std::vector< const xAOD::TrackParticle * > & getMatchedTestTracks(const xAOD::TrackParticle &r) const =0
get matched test vector (1 to 1+) vec Track <- Track
IDTPM::ITrackMatchingLookup::m_anaTag
std::string m_anaTag
Lookup table properties.
Definition: ITrackMatchingLookup.h:156
IDTPM::ITrackMatchingLookup::m_nullTruthVec
std::vector< const xAOD::TruthParticle * > m_nullTruthVec
Definition: ITrackMatchingLookup.h:151
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
xAOD::TruthParticle_v1
Class describing a truth particle in the MC record.
Definition: TruthParticle_v1.h:37
IDTPM::ITrackMatchingLookup::isTestMatched
virtual bool isTestMatched(const xAOD::TrackParticle &t) const =0
return true if test is matched
IDTPM::ITrackMatchingLookup::printInfo
virtual std::string printInfo(const std::vector< const xAOD::TrackParticle * > &testVec, const std::vector< const xAOD::TrackParticle * > &refVec) const =0
print info about matching and reverse matchings Track -> Track
IDTPM::ITrackMatchingLookup::isRefMatched
virtual bool isRefMatched(const xAOD::TrackParticle &r) const =0
return true if reference is matched
StatusCode.h
IDTPM::ITrackMatchingLookup::getBestMatchedTestTrack
const xAOD::TrackParticle * getBestMatchedTestTrack(const xAOD::TrackParticle &r) const
get best matched test, i.e.
Definition: ITrackMatchingLookup.h:81
IDTPM::ITrackMatchingLookup::printInfo
virtual std::string printInfo(const std::vector< const xAOD::TrackParticle * > &testVec, const std::vector< const xAOD::TruthParticle * > &refVec) const =0
Track -> Truth.
IDTPM::ITrackMatchingLookup::clear
virtual void clear()=0
clear lookup tables
TrackParticle.h
IDTPM::ITrackMatchingLookup::m_chainRoiName
std::string m_chainRoiName
Definition: ITrackMatchingLookup.h:157
IDTPM::ITrackMatchingLookup::getNmatches
virtual unsigned getNmatches(bool getRefN=false) const =0
get overall number of matches
IDTPM::ITrackMatchingLookup::printInfo
virtual std::string printInfo(const std::vector< const xAOD::TruthParticle * > &testVec, const std::vector< const xAOD::TrackParticle * > &refVec) const =0
Truth -> Track.
IDTPM::ITrackMatchingLookup::~ITrackMatchingLookup
virtual ~ITrackMatchingLookup()=default
Destructor.
IDTPM::ITrackMatchingLookup::update
virtual StatusCode update(const xAOD::TrackParticle &t, const xAOD::TrackParticle &r, float dist=0.)=0
update lookup tables with a new entry Track -> Track
IDTPM::ITrackMatchingLookup::isTestMatched
virtual bool isTestMatched(const xAOD::TruthParticle &t) const =0
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
IDTPM::ITrackMatchingLookup
Definition: ITrackMatchingLookup.h:30
IDTPM::ITrackMatchingLookup::getBestMatchedTestTruth
const xAOD::TruthParticle * getBestMatchedTestTruth(const xAOD::TruthParticle &) const
best Truth <- Truth // to avoid compilation errors
Definition: ITrackMatchingLookup.h:105
IDTPM
Athena include(s).
Definition: IPlotsDefinitionSvc.h:25
TruthParticle.h
IDTPM::ITrackMatchingLookup::chainRoiName
void chainRoiName(std::string_view chainRoiName_s)
Definition: ITrackMatchingLookup.h:46
IDTPM::ITrackMatchingLookup::getBestMatchedTestTrack
const xAOD::TrackParticle * getBestMatchedTestTrack(const xAOD::TruthParticle &r) const
best Track <- Truth
Definition: ITrackMatchingLookup.h:89