ATLAS Offline Software
TrackMatchingLookup.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_TRACKMATCHINGLOOKUP_H
6 #define INDETTRACKPERFMON_TRACKMATCHINGLOOKUP_H
7 
19 
21 #include <unordered_map>
22 
23 // local includes
24 #include "ITrackMatchingLookup.h"
25 
26 namespace IDTPM {
27 
31  template< typename T, typename R=T >
33 
34  public:
35 
37  typedef std::unordered_map< const T*, const R* > mapTtoR_t;
38  typedef std::unordered_map< const R*, std::vector<const T*> > mapRtoT_t;
39  typedef std::unordered_map< const T*, float > mapTtoDist_t;
40 
42  TrackMatchingLookupBase( const std::string& anaTag_s );
43 
46 
49 
51  unsigned getMapsSize( bool getRefN = false ) const {
52  return getRefN ? m_mapRefToTest.size() : m_mapTestToRef.size(); }
53 
55  const R* getMatchedRef( const T& t ) const;
56 
58  const std::vector<const T*>& getMatchedTest( const R& r ) const;
59 
61  float getDist( const T& t ) const;
62 
64  bool isTestInMaps( const T& t ) const;
65 
67  bool isRefInMaps( const R& r ) const;
68 
70  StatusCode updateMaps( const T& t, const R& r, float dist = 0. );
71 
73  void clearMaps();
74 
76  std::string printMaps( const std::vector<const T*>& testVec,
77  const std::vector<const R*>& refVec,
78  std::string_view chainRoiName_s ) const;
79 
80  private:
81 
83  std::string m_anaTag;
84 
87 
90 
93 
95  std::vector<const T*> m_nullTest{};
96 
97  }; // class TrackMatchingLookupBase
98 
99 
104  public TrackMatchingLookupBase< xAOD::TrackParticle >,
105  public virtual ITrackMatchingLookup {
106 
107  public:
108 
110  TrackMatchingLookup_trk( const std::string& anaTag_s ) :
111  TrackMatchingLookupBase< xAOD::TrackParticle >( anaTag_s ) {
112  anaTag( anaTag_s );
113  }
114 
117 
119  virtual unsigned getNmatches( bool getRefN ) const override { return getMapsSize( getRefN ); }
120 
123  const xAOD::TrackParticle& t ) const override { return getMatchedRef(t); }
124 
126  const xAOD::TruthParticle& ) const override {
127  ATH_MSG_WARNING( "getMatchedRefTrack: Truth->Track disabled" );
128  return nullptr;
129  }
130 
132  const xAOD::TrackParticle& ) const override {
133  ATH_MSG_WARNING( "getMatchedRefTruth: Track->Truth disabled" );
134  return nullptr;
135  }
136 
138  virtual const std::vector< const xAOD::TrackParticle* >& getMatchedTestTracks(
139  const xAOD::TrackParticle& r ) const override { return getMatchedTest(r); }
140 
141  virtual const std::vector< const xAOD::TrackParticle* >& getMatchedTestTracks(
142  const xAOD::TruthParticle& ) const override {
143  ATH_MSG_WARNING( "getMatchedTestTracks: Tracks<-Truth disabled" );
144  return m_nullTrackVec;
145  }
146 
147  virtual const std::vector< const xAOD::TruthParticle* >& getMatchedTestTruths(
148  const xAOD::TrackParticle& ) const override {
149  ATH_MSG_WARNING( "getMatchedTestTruths: Truths<-Track disabled" );
150  return m_nullTruthVec;
151  }
152 
154  virtual bool isTestMatched( const xAOD::TrackParticle& t ) const override {
155  return isTestInMaps(t);
156  }
157 
158  virtual bool isTestMatched( const xAOD::TruthParticle& ) const override {
159  ATH_MSG_WARNING( "isTestMatched: Truth->X disabled" );
160  return false;
161  }
162 
164  virtual bool isRefMatched( const xAOD::TrackParticle& r ) const override {
165  return isRefInMaps(r);
166  }
167 
168  virtual bool isRefMatched( const xAOD::TruthParticle& ) const override {
169  ATH_MSG_WARNING( "isRefMatched: X<-Truth disabled" );
170  return false;
171  }
172 
175  const xAOD::TrackParticle& r,
176  float dist ) override {
177  ATH_CHECK( updateMaps( t, r, dist ) );
178  return StatusCode::SUCCESS;
179  }
180 
182  const xAOD::TruthParticle&,
183  float ) override {
184  ATH_MSG_WARNING( "update: Track->Truth disabled" );
185  return StatusCode::SUCCESS;
186  }
187 
189  const xAOD::TrackParticle&,
190  float ) override {
191  return StatusCode::SUCCESS;
192  ATH_MSG_WARNING( "update: Truth->Track disabled" );
193  }
194 
196  virtual void clear() override {
197  ATH_MSG_DEBUG( "Deleting whole cache..." );
198  chainRoiName("");
199  clearMaps();
200  }
201 
203  virtual std::string printInfo(
204  const std::vector< const xAOD::TrackParticle* >& testVec,
205  const std::vector< const xAOD::TrackParticle* >& refVec ) const override {
206  return printMaps( testVec, refVec, chainRoiName() );
207  }
208 
209  virtual std::string printInfo(
210  const std::vector< const xAOD::TrackParticle* >&,
211  const std::vector< const xAOD::TruthParticle* >& ) const override {
212  ATH_MSG_WARNING( "printInfo: Track->Truth matches disabled" );
213  return std::string("--> No matches found");
214  }
215 
216  virtual std::string printInfo(
217  const std::vector< const xAOD::TruthParticle* >&,
218  const std::vector< const xAOD::TrackParticle* >& ) const override {
219  ATH_MSG_WARNING( "printInfo: Truth->Track matches disabled" );
220  return std::string("--> No matches found");
221  }
222 
223  }; // class TrackMatchingLookup_trk
224 
225 
230  public TrackMatchingLookupBase< xAOD::TrackParticle, xAOD::TruthParticle >,
231  public virtual ITrackMatchingLookup {
232 
233  public:
234 
236  TrackMatchingLookup_trkTruth( const std::string& anaTag_s ) :
238  anaTag( anaTag_s );
239  }
240 
243 
245  virtual unsigned getNmatches( bool getRefN ) const override { return getMapsSize( getRefN ); }
246 
249  const xAOD::TrackParticle& ) const override {
250  ATH_MSG_WARNING( "getMatchedRefTrack: Track->Track disabled" );
251  return nullptr;
252  }
253 
255  const xAOD::TruthParticle& ) const override {
256  ATH_MSG_WARNING( "getMatchedRefTrack: Truth->Track disabled" );
257  return nullptr;
258  }
259 
261  const xAOD::TrackParticle& t) const override { return getMatchedRef(t); }
262 
264  virtual const std::vector< const xAOD::TrackParticle* >& getMatchedTestTracks(
265  const xAOD::TrackParticle& ) const override {
266  ATH_MSG_WARNING( "getMatchedTestTracks: Track<-Track disabled" );
267  return m_nullTrackVec;
268  }
269 
270  virtual const std::vector< const xAOD::TrackParticle* >& getMatchedTestTracks(
271  const xAOD::TruthParticle& r ) const override { return getMatchedTest(r); }
272 
273  virtual const std::vector< const xAOD::TruthParticle* >& getMatchedTestTruths(
274  const xAOD::TrackParticle& ) const override {
275  ATH_MSG_WARNING( "getMatchedTestTruths: Truths<-Track disabled" );
276  return m_nullTruthVec;
277  }
278 
280  virtual bool isTestMatched( const xAOD::TrackParticle& t ) const override {
281  return isTestInMaps(t);
282  }
283 
284  virtual bool isTestMatched( const xAOD::TruthParticle& ) const override {
285  ATH_MSG_WARNING( "isTestMatched: Truth->X disabled" );
286  return false;
287  }
288 
290  virtual bool isRefMatched( const xAOD::TrackParticle& ) const override {
291  ATH_MSG_WARNING( "isRefMatched: X<-Track disabled" );
292  return false;
293  }
294 
295  virtual bool isRefMatched( const xAOD::TruthParticle& r ) const override {
296  return isRefInMaps(r);
297  }
298 
301  const xAOD::TrackParticle&,
302  float ) override {
303  ATH_MSG_WARNING( "update: Track->Track disabled" );
304  return StatusCode::SUCCESS;
305  }
306 
308  const xAOD::TruthParticle& r,
309  float dist ) override {
310  ATH_CHECK( updateMaps( t, r, dist ) );
311  return StatusCode::SUCCESS;
312  }
313 
315  const xAOD::TrackParticle&,
316  float ) override {
317  return StatusCode::SUCCESS;
318  ATH_MSG_WARNING( "update: Truth->Track disabled" );
319  }
320 
322  virtual void clear() override {
323  ATH_MSG_DEBUG( "Deleting whole cache..." );
324  chainRoiName("");
325  clearMaps();
326  }
327 
329  virtual std::string printInfo(
330  const std::vector< const xAOD::TrackParticle* >&,
331  const std::vector< const xAOD::TrackParticle* >& ) const override {
332  ATH_MSG_WARNING( "printInfo: Track->Track matches disabled" );
333  return std::string("--> No matches found");
334  }
335 
336  virtual std::string printInfo(
337  const std::vector< const xAOD::TrackParticle* >& testVec,
338  const std::vector< const xAOD::TruthParticle* >& refVec ) const override {
339  return printMaps( testVec, refVec, chainRoiName() );
340  }
341 
342  virtual std::string printInfo(
343  const std::vector< const xAOD::TruthParticle* >&,
344  const std::vector< const xAOD::TrackParticle* >& ) const override {
345  ATH_MSG_WARNING( "printInfo: Truth->Track matches disabled" );
346  return std::string("--> No matches found");
347  }
348 
349  }; // class TrackMatchingLookup_trkTruth
350 
351 
356  public TrackMatchingLookupBase< xAOD::TruthParticle, xAOD::TrackParticle >,
357  public virtual ITrackMatchingLookup {
358 
359  public:
360 
362  TrackMatchingLookup_truthTrk( const std::string& anaTag_s ) :
364  anaTag( anaTag_s );
365  }
366 
369 
371  virtual unsigned getNmatches( bool getRefN ) const override { return getMapsSize( getRefN ); }
372 
375  const xAOD::TrackParticle& ) const override {
376  ATH_MSG_WARNING( "getMatchedRefTrack: Track->Track disabled" );
377  return nullptr;
378  }
379 
381  const xAOD::TruthParticle& t ) const override { return getMatchedRef(t); }
382 
384  const xAOD::TrackParticle& ) const override {
385  ATH_MSG_WARNING( "getMatchedRefTruth: Track->Truth disabled" );
386  return nullptr;
387  }
388 
390  virtual const std::vector< const xAOD::TrackParticle* >& getMatchedTestTracks(
391  const xAOD::TrackParticle& ) const override {
392  ATH_MSG_WARNING( "getMatchedTestTruths: Track<-Track disabled" );
393  return m_nullTrackVec;
394  }
395 
396  virtual const std::vector< const xAOD::TrackParticle* >& getMatchedTestTracks(
397  const xAOD::TruthParticle& ) const override {
398  ATH_MSG_WARNING( "getMatchedTestTracks: Tracks<-Truth disabled" );
399  return m_nullTrackVec;
400  }
401 
402  virtual const std::vector< const xAOD::TruthParticle* >& getMatchedTestTruths(
403  const xAOD::TrackParticle& r ) const override { return getMatchedTest(r); }
404 
406  virtual bool isTestMatched( const xAOD::TrackParticle& ) const override {
407  ATH_MSG_WARNING( "isTestMatched: Track->X disabled" );
408  return false;
409  }
410 
411  virtual bool isTestMatched( const xAOD::TruthParticle& t ) const override {
412  return isTestInMaps(t);
413  }
414 
416  virtual bool isRefMatched( const xAOD::TrackParticle& r ) const override {
417  return isRefInMaps(r);
418  }
419 
420  virtual bool isRefMatched( const xAOD::TruthParticle& ) const override {
421  ATH_MSG_WARNING( "isRefMatched: X<-Truth disabled" );
422  return false;
423  }
424 
427  const xAOD::TrackParticle&,
428  float ) override {
429  return StatusCode::SUCCESS;
430  ATH_MSG_WARNING( "update: Track->Track disabled" );
431  }
432 
434  const xAOD::TruthParticle&,
435  float ) override {
436  ATH_MSG_WARNING( "update: Track->Truth disabled" );
437  return StatusCode::SUCCESS;
438  }
439 
441  const xAOD::TrackParticle& r,
442  float dist ) override {
443  ATH_CHECK( updateMaps( t, r, dist ) );
444  return StatusCode::SUCCESS;
445  }
446 
448  virtual void clear() override {
449  ATH_MSG_DEBUG( "Deleting whole cache..." );
450  chainRoiName("");
451  clearMaps();
452  }
453 
455  virtual std::string printInfo(
456  const std::vector< const xAOD::TrackParticle* >&,
457  const std::vector< const xAOD::TrackParticle* >& ) const override {
458  ATH_MSG_WARNING( "printInfo: Track->Track matches disabled" );
459  return std::string("--> No matches found");
460  }
461 
462  virtual std::string printInfo(
463  const std::vector< const xAOD::TrackParticle* >&,
464  const std::vector< const xAOD::TruthParticle* >& ) const override {
465  ATH_MSG_WARNING( "printInfo: Track->Truth matches disabled" );
466  return std::string("--> No matches found");
467  }
468 
469  virtual std::string printInfo(
470  const std::vector< const xAOD::TruthParticle* >& testVec,
471  const std::vector< const xAOD::TrackParticle* >& refVec ) const override {
472  return printMaps( testVec, refVec, chainRoiName() );
473  }
474 
475  }; // class TrackMatchingLookup_truthTrk
476 
477 } // namespace IDTPM
478 
479 #include "TrackMatchingLookup.icc"
480 
481 #endif // > !INDETTRACKPERFMON_TRACKMATCHINGLOOKUP_H
IDTPM::TrackMatchingLookup_trk::getMatchedTestTruths
virtual const std::vector< const xAOD::TruthParticle * > & getMatchedTestTruths(const xAOD::TrackParticle &) const override
vec Truth <- Track
Definition: TrackMatchingLookup.h:147
IDTPM::TrackMatchingLookup_trkTruth::printInfo
virtual std::string printInfo(const std::vector< const xAOD::TruthParticle * > &, const std::vector< const xAOD::TrackParticle * > &) const override
Truth -> Track.
Definition: TrackMatchingLookup.h:342
beamspotman.r
def r
Definition: beamspotman.py:676
IDTPM::TrackMatchingLookup_trk::printInfo
virtual std::string printInfo(const std::vector< const xAOD::TrackParticle * > &testVec, const std::vector< const xAOD::TrackParticle * > &refVec) const override
printInfo
Definition: TrackMatchingLookup.h:203
IDTPM::TrackMatchingLookup_truthTrk::isRefMatched
virtual bool isRefMatched(const xAOD::TrackParticle &r) const override
isRefMatched
Definition: TrackMatchingLookup.h:416
IDTPM::TrackMatchingLookup_truthTrk::getNmatches
virtual unsigned getNmatches(bool getRefN) const override
getNmatches
Definition: TrackMatchingLookup.h:371
IDTPM::TrackMatchingLookupBase::m_mapTestToRef
mapTtoR_t m_mapTestToRef
Mapping test to its uniquely associated reference.
Definition: TrackMatchingLookup.h:86
IDTPM::TrackMatchingLookup_truthTrk::getMatchedRefTruth
virtual const xAOD::TruthParticle * getMatchedRefTruth(const xAOD::TrackParticle &) const override
Track -> Truth.
Definition: TrackMatchingLookup.h:383
IDTPM::TrackMatchingLookup_truthTrk::getMatchedRefTrack
virtual const xAOD::TrackParticle * getMatchedRefTrack(const xAOD::TrackParticle &) const override
getMatchedRefTrack
Definition: TrackMatchingLookup.h:374
IDTPM::TrackMatchingLookup_trk::isRefMatched
virtual bool isRefMatched(const xAOD::TrackParticle &r) const override
isRefMatched
Definition: TrackMatchingLookup.h:164
IDTPM::TrackMatchingLookup_trk::getMatchedTestTracks
virtual const std::vector< const xAOD::TrackParticle * > & getMatchedTestTracks(const xAOD::TrackParticle &r) const override
getMatchedTestTracks
Definition: TrackMatchingLookup.h:138
IDTPM::TrackMatchingLookupBase::getDist
float getDist(const T &t) const
get distance parameter for matched test
AthCheckMacros.h
IDTPM::TrackMatchingLookup_trk::isTestMatched
virtual bool isTestMatched(const xAOD::TrackParticle &t) const override
isTestMatched
Definition: TrackMatchingLookup.h:154
IDTPM::TrackMatchingLookup_trkTruth
Definition: TrackMatchingLookup.h:231
IDTPM::TrackMatchingLookup_trk::update
virtual StatusCode update(const xAOD::TrackParticle &t, const xAOD::TrackParticle &r, float dist) override
update
Definition: TrackMatchingLookup.h:174
IDTPM::TrackMatchingLookup_truthTrk::getMatchedTestTracks
virtual const std::vector< const xAOD::TrackParticle * > & getMatchedTestTracks(const xAOD::TruthParticle &) const override
vec Track <- Truth
Definition: TrackMatchingLookup.h:396
IDTPM::TrackMatchingLookupBase::isRefInMaps
bool isRefInMaps(const R &r) const
return true if reference is matched
IDTPM::ITrackMatchingLookup::m_nullTrackVec
std::vector< const xAOD::TrackParticle * > m_nullTrackVec
null vectors
Definition: ITrackMatchingLookup.h:150
IDTPM::TrackMatchingLookup_trkTruth::getMatchedTestTracks
virtual const std::vector< const xAOD::TrackParticle * > & getMatchedTestTracks(const xAOD::TruthParticle &r) const override
vec Track <- Truth
Definition: TrackMatchingLookup.h:270
IDTPM::TrackMatchingLookup_trkTruth::getMatchedRefTruth
virtual const xAOD::TruthParticle * getMatchedRefTruth(const xAOD::TrackParticle &t) const override
Track -> Truth.
Definition: TrackMatchingLookup.h:260
IDTPM::TrackMatchingLookup_trkTruth::~TrackMatchingLookup_trkTruth
~TrackMatchingLookup_trkTruth()=default
Destructor.
IDTPM::TrackMatchingLookupBase::m_mapTestToDist
mapTtoDist_t m_mapTestToDist
Mapping test to its uniquely associated reference.
Definition: TrackMatchingLookup.h:92
IDTPM::TrackMatchingLookup_trkTruth::update
virtual StatusCode update(const xAOD::TrackParticle &, const xAOD::TrackParticle &, float) override
update
Definition: TrackMatchingLookup.h:300
IDTPM::TrackMatchingLookup_trkTruth::getMatchedRefTrack
virtual const xAOD::TrackParticle * getMatchedRefTrack(const xAOD::TrackParticle &) const override
getMatchedRefTrack
Definition: TrackMatchingLookup.h:248
IDTPM::TrackMatchingLookup_trk::getMatchedRefTrack
virtual const xAOD::TrackParticle * getMatchedRefTrack(const xAOD::TrackParticle &t) const override
getMatchedRefTrack
Definition: TrackMatchingLookup.h:122
IDTPM::TrackMatchingLookup_trkTruth::TrackMatchingLookup_trkTruth
TrackMatchingLookup_trkTruth(const std::string &anaTag_s)
Constructor.
Definition: TrackMatchingLookup.h:236
IDTPM::TrackMatchingLookup_truthTrk::getMatchedTestTracks
virtual const std::vector< const xAOD::TrackParticle * > & getMatchedTestTracks(const xAOD::TrackParticle &) const override
getMatchedTestTracks
Definition: TrackMatchingLookup.h:390
IDTPM::TrackMatchingLookupBase::updateMaps
StatusCode updateMaps(const T &t, const R &r, float dist=0.)
update maps with a new entry
TruthParticle
Definition: PhysicsAnalysis/TruthParticleID/McParticleEvent/McParticleEvent/TruthParticle.h:58
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition: ICaloAffectedTool.h:24
IDTPM::TrackMatchingLookup_trk::update
virtual StatusCode update(const xAOD::TruthParticle &, const xAOD::TrackParticle &, float) override
Truth -> Track.
Definition: TrackMatchingLookup.h:188
IDTPM::TrackMatchingLookup_trk::getMatchedRefTrack
virtual const xAOD::TrackParticle * getMatchedRefTrack(const xAOD::TruthParticle &) const override
Truth -> Track.
Definition: TrackMatchingLookup.h:125
IDTPM::TrackMatchingLookupBase::m_nullTest
std::vector< const T * > m_nullTest
null Vectors
Definition: TrackMatchingLookup.h:95
IDTPM::ITrackMatchingLookup::chainRoiName
const std::string & chainRoiName() const
Definition: ITrackMatchingLookup.h:45
IDTPM::TrackMatchingLookup_truthTrk::TrackMatchingLookup_truthTrk
TrackMatchingLookup_truthTrk(const std::string &anaTag_s)
Constructor.
Definition: TrackMatchingLookup.h:362
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
IDTPM::TrackMatchingLookup_trk::isTestMatched
virtual bool isTestMatched(const xAOD::TruthParticle &) const override
Definition: TrackMatchingLookup.h:158
IDTPM::TrackMatchingLookup_trk::TrackMatchingLookup_trk
TrackMatchingLookup_trk(const std::string &anaTag_s)
Constructor.
Definition: TrackMatchingLookup.h:110
IDTPM::TrackMatchingLookupBase::operator=
TrackMatchingLookupBase & operator=(const TrackMatchingLookupBase< T, R > &)=delete
= operator (disabled)
xAOD::TrackParticle
TrackParticle_v1 TrackParticle
Reference the current persistent version:
Definition: Event/xAOD/xAODTracking/xAODTracking/TrackParticle.h:13
IDTPM::ITrackMatchingLookup::anaTag
const std::string & anaTag() const
matching properties
Definition: ITrackMatchingLookup.h:41
TrackMatchingLookup.icc
IDTPM::TrackMatchingLookup_trkTruth::isRefMatched
virtual bool isRefMatched(const xAOD::TrackParticle &) const override
isRefMatched
Definition: TrackMatchingLookup.h:290
IDTPM::TrackMatchingLookup_trk::printInfo
virtual std::string printInfo(const std::vector< const xAOD::TruthParticle * > &, const std::vector< const xAOD::TrackParticle * > &) const override
Truth -> Track.
Definition: TrackMatchingLookup.h:216
IDTPM::TrackMatchingLookupBase::getMatchedTest
const std::vector< const T * > & getMatchedTest(const R &r) const
get matched test vector from map
IDTPM::ITrackMatchingLookup::m_nullTruthVec
std::vector< const xAOD::TruthParticle * > m_nullTruthVec
Definition: ITrackMatchingLookup.h:151
IDTPM::TrackMatchingLookupBase::isTestInMaps
bool isTestInMaps(const T &t) const
return true if test is matched
IDTPM::TrackMatchingLookup_trkTruth::printInfo
virtual std::string printInfo(const std::vector< const xAOD::TrackParticle * > &, const std::vector< const xAOD::TrackParticle * > &) const override
printInfo
Definition: TrackMatchingLookup.h:329
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
IDTPM::TrackMatchingLookupBase::mapRtoT_t
std::unordered_map< const R *, std::vector< const T * > > mapRtoT_t
Definition: TrackMatchingLookup.h:38
xAOD::TruthParticle_v1
Class describing a truth particle in the MC record.
Definition: TruthParticle_v1.h:37
IDTPM::TrackMatchingLookup_trkTruth::update
virtual StatusCode update(const xAOD::TrackParticle &t, const xAOD::TruthParticle &r, float dist) override
Track -> Truth.
Definition: TrackMatchingLookup.h:307
IDTPM::TrackMatchingLookup_trk::~TrackMatchingLookup_trk
~TrackMatchingLookup_trk()=default
Destructor.
AthMessaging
Class to provide easy MsgStream access and capabilities.
Definition: AthMessaging.h:55
IDTPM::TrackMatchingLookupBase::getMatchedRef
const R * getMatchedRef(const T &t) const
get matched reference from map
IDTPM::TrackMatchingLookupBase::TrackMatchingLookupBase
TrackMatchingLookupBase(const std::string &anaTag_s)
Constructor.
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
ITrackMatchingLookup.h
Interace for TrackMatchingLookup objects (templated)
IDTPM::TrackMatchingLookup_trk::update
virtual StatusCode update(const xAOD::TrackParticle &, const xAOD::TruthParticle &, float) override
Track -> Truth.
Definition: TrackMatchingLookup.h:181
IDTPM::TrackMatchingLookup_trk::getMatchedRefTruth
virtual const xAOD::TruthParticle * getMatchedRefTruth(const xAOD::TrackParticle &) const override
Track -> Truth.
Definition: TrackMatchingLookup.h:131
IDTPM::TrackMatchingLookup_trkTruth::getNmatches
virtual unsigned getNmatches(bool getRefN) const override
getNmatches
Definition: TrackMatchingLookup.h:245
IDTPM::TrackMatchingLookupBase::mapTtoDist_t
std::unordered_map< const T *, float > mapTtoDist_t
Definition: TrackMatchingLookup.h:39
IDTPM::TrackMatchingLookup_trkTruth::isRefMatched
virtual bool isRefMatched(const xAOD::TruthParticle &r) const override
Definition: TrackMatchingLookup.h:295
IDTPM::TrackMatchingLookupBase::printMaps
std::string printMaps(const std::vector< const T * > &testVec, const std::vector< const R * > &refVec, std::string_view chainRoiName_s) const
print info about matching and reverse matchings
IDTPM::TrackMatchingLookupBase::m_anaTag
std::string m_anaTag
analysis tag
Definition: TrackMatchingLookup.h:83
IDTPM::TrackMatchingLookup_trkTruth::update
virtual StatusCode update(const xAOD::TruthParticle &, const xAOD::TrackParticle &, float) override
Truth -> Track.
Definition: TrackMatchingLookup.h:314
IDTPM::TrackMatchingLookup_trk::printInfo
virtual std::string printInfo(const std::vector< const xAOD::TrackParticle * > &, const std::vector< const xAOD::TruthParticle * > &) const override
Track -> Truth.
Definition: TrackMatchingLookup.h:209
IDTPM::TrackMatchingLookupBase::m_mapRefToTest
mapRtoT_t m_mapRefToTest
Mapping reference to its (possibly multiple) associated test(s)
Definition: TrackMatchingLookup.h:89
IDTPM::TrackMatchingLookupBase::mapTtoR_t
std::unordered_map< const T *, const R * > mapTtoR_t
useful typedefs
Definition: TrackMatchingLookup.h:37
IDTPM::TrackMatchingLookup_truthTrk::update
virtual StatusCode update(const xAOD::TruthParticle &t, const xAOD::TrackParticle &r, float dist) override
Truth -> Track.
Definition: TrackMatchingLookup.h:440
IDTPM::TrackMatchingLookup_truthTrk
Definition: TrackMatchingLookup.h:357
IDTPM::TrackMatchingLookup_truthTrk::printInfo
virtual std::string printInfo(const std::vector< const xAOD::TrackParticle * > &, const std::vector< const xAOD::TrackParticle * > &) const override
printInfo
Definition: TrackMatchingLookup.h:455
IDTPM::TrackMatchingLookup_trkTruth::getMatchedTestTruths
virtual const std::vector< const xAOD::TruthParticle * > & getMatchedTestTruths(const xAOD::TrackParticle &) const override
vec Truth <- Track
Definition: TrackMatchingLookup.h:273
IDTPM::TrackMatchingLookup_truthTrk::update
virtual StatusCode update(const xAOD::TrackParticle &, const xAOD::TruthParticle &, float) override
Track -> Truth.
Definition: TrackMatchingLookup.h:433
IDTPM::TrackMatchingLookup_trkTruth::isTestMatched
virtual bool isTestMatched(const xAOD::TrackParticle &t) const override
isTestMatched
Definition: TrackMatchingLookup.h:280
IDTPM::TrackMatchingLookup_trkTruth::isTestMatched
virtual bool isTestMatched(const xAOD::TruthParticle &) const override
Definition: TrackMatchingLookup.h:284
IDTPM::TrackMatchingLookup_trk::getMatchedTestTracks
virtual const std::vector< const xAOD::TrackParticle * > & getMatchedTestTracks(const xAOD::TruthParticle &) const override
vec Track <- Truth
Definition: TrackMatchingLookup.h:141
IDTPM::TrackMatchingLookup_truthTrk::isRefMatched
virtual bool isRefMatched(const xAOD::TruthParticle &) const override
Definition: TrackMatchingLookup.h:420
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
IDTPM::TrackMatchingLookup_truthTrk::getMatchedRefTrack
virtual const xAOD::TrackParticle * getMatchedRefTrack(const xAOD::TruthParticle &t) const override
Truth -> Track.
Definition: TrackMatchingLookup.h:380
IDTPM::TrackMatchingLookup_truthTrk::isTestMatched
virtual bool isTestMatched(const xAOD::TrackParticle &) const override
isTestMatched
Definition: TrackMatchingLookup.h:406
IDTPM::TrackMatchingLookup_trkTruth::getMatchedRefTrack
virtual const xAOD::TrackParticle * getMatchedRefTrack(const xAOD::TruthParticle &) const override
Truth -> Track.
Definition: TrackMatchingLookup.h:254
IDTPM::TrackMatchingLookup_trk
Definition: TrackMatchingLookup.h:105
AthMessaging.h
IDTPM::TrackMatchingLookup_truthTrk::getMatchedTestTruths
virtual const std::vector< const xAOD::TruthParticle * > & getMatchedTestTruths(const xAOD::TrackParticle &r) const override
vec Truth <- Track
Definition: TrackMatchingLookup.h:402
IDTPM::TrackMatchingLookup_trk::clear
virtual void clear() override
clear
Definition: TrackMatchingLookup.h:196
IDTPM::TrackMatchingLookup_truthTrk::isTestMatched
virtual bool isTestMatched(const xAOD::TruthParticle &t) const override
Definition: TrackMatchingLookup.h:411
IDTPM::TrackMatchingLookup_truthTrk::printInfo
virtual std::string printInfo(const std::vector< const xAOD::TruthParticle * > &testVec, const std::vector< const xAOD::TrackParticle * > &refVec) const override
Truth -> Track.
Definition: TrackMatchingLookup.h:469
IDTPM::TrackMatchingLookup_truthTrk::update
virtual StatusCode update(const xAOD::TrackParticle &, const xAOD::TrackParticle &, float) override
update
Definition: TrackMatchingLookup.h:426
IDTPM::TrackMatchingLookup_truthTrk::clear
virtual void clear() override
clear
Definition: TrackMatchingLookup.h:448
IDTPM::TrackMatchingLookup_trk::getNmatches
virtual unsigned getNmatches(bool getRefN) const override
getNmatches
Definition: TrackMatchingLookup.h:119
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
IDTPM::TrackMatchingLookupBase::clearMaps
void clearMaps()
clear lookup tables
IDTPM::TrackMatchingLookup_trk::isRefMatched
virtual bool isRefMatched(const xAOD::TruthParticle &) const override
Definition: TrackMatchingLookup.h:168
IDTPM::ITrackMatchingLookup
Definition: ITrackMatchingLookup.h:30
IDTPM
Athena include(s).
Definition: IPlotsDefinitionSvc.h:25
IDTPM::TrackMatchingLookup_trkTruth::clear
virtual void clear() override
clear
Definition: TrackMatchingLookup.h:322
IDTPM::TrackMatchingLookup_truthTrk::~TrackMatchingLookup_truthTrk
~TrackMatchingLookup_truthTrk()=default
Destructor.
IDTPM::TrackMatchingLookup_trkTruth::printInfo
virtual std::string printInfo(const std::vector< const xAOD::TrackParticle * > &testVec, const std::vector< const xAOD::TruthParticle * > &refVec) const override
Track -> Truth.
Definition: TrackMatchingLookup.h:336
IDTPM::TrackMatchingLookup_truthTrk::printInfo
virtual std::string printInfo(const std::vector< const xAOD::TrackParticle * > &, const std::vector< const xAOD::TruthParticle * > &) const override
Track -> Truth.
Definition: TrackMatchingLookup.h:462
IDTPM::TrackMatchingLookupBase::~TrackMatchingLookupBase
~TrackMatchingLookupBase()=default
Destructor.
IDTPM::TrackMatchingLookupBase
Definition: TrackMatchingLookup.h:32
IDTPM::TrackMatchingLookupBase::getMapsSize
unsigned getMapsSize(bool getRefN=false) const
get the overall number of matches
Definition: TrackMatchingLookup.h:51
IDTPM::TrackMatchingLookup_trkTruth::getMatchedTestTracks
virtual const std::vector< const xAOD::TrackParticle * > & getMatchedTestTracks(const xAOD::TrackParticle &) const override
getMatchedTestTracks
Definition: TrackMatchingLookup.h:264