|
ATLAS Offline Software
|
Go to the documentation of this file.
5 #ifndef INDETTRACKPERFMON_TRACKMATCHINGLOOKUP_H
6 #define INDETTRACKPERFMON_TRACKMATCHINGLOOKUP_H
21 #include <unordered_map>
31 template<
typename T,
typename R=T >
37 typedef std::unordered_map< const T*, const R* >
mapTtoR_t;
38 typedef std::unordered_map< const R*, std::vector<const T*> >
mapRtoT_t;
76 std::string
printMaps(
const std::vector<const T*>& testVec,
77 const std::vector<const R*>& refVec,
78 std::string_view chainRoiName_s )
const;
176 float dist )
override {
178 return StatusCode::SUCCESS;
185 return StatusCode::SUCCESS;
191 return StatusCode::SUCCESS;
204 const std::vector< const xAOD::TrackParticle* >& testVec,
205 const std::vector< const xAOD::TrackParticle* >& refVec )
const override {
210 const std::vector< const xAOD::TrackParticle* >&,
211 const std::vector< const xAOD::TruthParticle* >& )
const override {
213 return std::string(
"--> No matches found");
217 const std::vector< const xAOD::TruthParticle* >&,
218 const std::vector< const xAOD::TrackParticle* >& )
const override {
220 return std::string(
"--> No matches found");
304 return StatusCode::SUCCESS;
309 float dist )
override {
311 return StatusCode::SUCCESS;
317 return StatusCode::SUCCESS;
330 const std::vector< const xAOD::TrackParticle* >&,
331 const std::vector< const xAOD::TrackParticle* >& )
const override {
333 return std::string(
"--> No matches found");
337 const std::vector< const xAOD::TrackParticle* >& testVec,
338 const std::vector< const xAOD::TruthParticle* >& refVec )
const override {
343 const std::vector< const xAOD::TruthParticle* >&,
344 const std::vector< const xAOD::TrackParticle* >& )
const override {
346 return std::string(
"--> No matches found");
429 return StatusCode::SUCCESS;
437 return StatusCode::SUCCESS;
442 float dist )
override {
444 return StatusCode::SUCCESS;
456 const std::vector< const xAOD::TrackParticle* >&,
457 const std::vector< const xAOD::TrackParticle* >& )
const override {
459 return std::string(
"--> No matches found");
463 const std::vector< const xAOD::TrackParticle* >&,
464 const std::vector< const xAOD::TruthParticle* >& )
const override {
466 return std::string(
"--> No matches found");
470 const std::vector< const xAOD::TruthParticle* >& testVec,
471 const std::vector< const xAOD::TrackParticle* >& refVec )
const override {
481 #endif // > !INDETTRACKPERFMON_TRACKMATCHINGLOOKUP_H
virtual const std::vector< const xAOD::TruthParticle * > & getMatchedTestTruths(const xAOD::TrackParticle &) const override
vec Truth <- Track
virtual std::string printInfo(const std::vector< const xAOD::TruthParticle * > &, const std::vector< const xAOD::TrackParticle * > &) const override
Truth -> Track.
virtual std::string printInfo(const std::vector< const xAOD::TrackParticle * > &testVec, const std::vector< const xAOD::TrackParticle * > &refVec) const override
printInfo
virtual bool isRefMatched(const xAOD::TrackParticle &r) const override
isRefMatched
virtual unsigned getNmatches(bool getRefN) const override
getNmatches
mapTtoR_t m_mapTestToRef
Mapping test to its uniquely associated reference.
virtual const xAOD::TruthParticle * getMatchedRefTruth(const xAOD::TrackParticle &) const override
Track -> Truth.
virtual const xAOD::TrackParticle * getMatchedRefTrack(const xAOD::TrackParticle &) const override
getMatchedRefTrack
virtual bool isRefMatched(const xAOD::TrackParticle &r) const override
isRefMatched
virtual const std::vector< const xAOD::TrackParticle * > & getMatchedTestTracks(const xAOD::TrackParticle &r) const override
getMatchedTestTracks
float getDist(const T &t) const
get distance parameter for matched test
virtual bool isTestMatched(const xAOD::TrackParticle &t) const override
isTestMatched
virtual StatusCode update(const xAOD::TrackParticle &t, const xAOD::TrackParticle &r, float dist) override
update
virtual const std::vector< const xAOD::TrackParticle * > & getMatchedTestTracks(const xAOD::TruthParticle &) const override
vec Track <- Truth
bool isRefInMaps(const R &r) const
return true if reference is matched
std::vector< const xAOD::TrackParticle * > m_nullTrackVec
null vectors
virtual const std::vector< const xAOD::TrackParticle * > & getMatchedTestTracks(const xAOD::TruthParticle &r) const override
vec Track <- Truth
virtual const xAOD::TruthParticle * getMatchedRefTruth(const xAOD::TrackParticle &t) const override
Track -> Truth.
~TrackMatchingLookup_trkTruth()=default
Destructor.
mapTtoDist_t m_mapTestToDist
Mapping test to its uniquely associated reference.
virtual StatusCode update(const xAOD::TrackParticle &, const xAOD::TrackParticle &, float) override
update
virtual const xAOD::TrackParticle * getMatchedRefTrack(const xAOD::TrackParticle &) const override
getMatchedRefTrack
virtual const xAOD::TrackParticle * getMatchedRefTrack(const xAOD::TrackParticle &t) const override
getMatchedRefTrack
TrackMatchingLookup_trkTruth(const std::string &anaTag_s)
Constructor.
virtual const std::vector< const xAOD::TrackParticle * > & getMatchedTestTracks(const xAOD::TrackParticle &) const override
getMatchedTestTracks
StatusCode updateMaps(const T &t, const R &r, float dist=0.)
update maps with a new entry
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
virtual StatusCode update(const xAOD::TruthParticle &, const xAOD::TrackParticle &, float) override
Truth -> Track.
virtual const xAOD::TrackParticle * getMatchedRefTrack(const xAOD::TruthParticle &) const override
Truth -> Track.
std::vector< const T * > m_nullTest
null Vectors
const std::string & chainRoiName() const
TrackMatchingLookup_truthTrk(const std::string &anaTag_s)
Constructor.
virtual bool isTestMatched(const xAOD::TruthParticle &) const override
TrackMatchingLookup_trk(const std::string &anaTag_s)
Constructor.
TrackMatchingLookupBase & operator=(const TrackMatchingLookupBase< T, R > &)=delete
= operator (disabled)
TrackParticle_v1 TrackParticle
Reference the current persistent version:
const std::string & anaTag() const
matching properties
virtual bool isRefMatched(const xAOD::TrackParticle &) const override
isRefMatched
virtual std::string printInfo(const std::vector< const xAOD::TruthParticle * > &, const std::vector< const xAOD::TrackParticle * > &) const override
Truth -> Track.
const std::vector< const T * > & getMatchedTest(const R &r) const
get matched test vector from map
std::vector< const xAOD::TruthParticle * > m_nullTruthVec
bool isTestInMaps(const T &t) const
return true if test is matched
virtual std::string printInfo(const std::vector< const xAOD::TrackParticle * > &, const std::vector< const xAOD::TrackParticle * > &) const override
printInfo
::StatusCode StatusCode
StatusCode definition for legacy code.
std::unordered_map< const R *, std::vector< const T * > > mapRtoT_t
Class describing a truth particle in the MC record.
virtual StatusCode update(const xAOD::TrackParticle &t, const xAOD::TruthParticle &r, float dist) override
Track -> Truth.
~TrackMatchingLookup_trk()=default
Destructor.
Class to provide easy MsgStream access and capabilities.
const R * getMatchedRef(const T &t) const
get matched reference from map
TrackMatchingLookupBase(const std::string &anaTag_s)
Constructor.
Interace for TrackMatchingLookup objects (templated)
virtual StatusCode update(const xAOD::TrackParticle &, const xAOD::TruthParticle &, float) override
Track -> Truth.
virtual const xAOD::TruthParticle * getMatchedRefTruth(const xAOD::TrackParticle &) const override
Track -> Truth.
virtual unsigned getNmatches(bool getRefN) const override
getNmatches
std::unordered_map< const T *, float > mapTtoDist_t
virtual bool isRefMatched(const xAOD::TruthParticle &r) const override
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
std::string m_anaTag
analysis tag
virtual StatusCode update(const xAOD::TruthParticle &, const xAOD::TrackParticle &, float) override
Truth -> Track.
virtual std::string printInfo(const std::vector< const xAOD::TrackParticle * > &, const std::vector< const xAOD::TruthParticle * > &) const override
Track -> Truth.
mapRtoT_t m_mapRefToTest
Mapping reference to its (possibly multiple) associated test(s)
std::unordered_map< const T *, const R * > mapTtoR_t
useful typedefs
virtual StatusCode update(const xAOD::TruthParticle &t, const xAOD::TrackParticle &r, float dist) override
Truth -> Track.
virtual std::string printInfo(const std::vector< const xAOD::TrackParticle * > &, const std::vector< const xAOD::TrackParticle * > &) const override
printInfo
virtual const std::vector< const xAOD::TruthParticle * > & getMatchedTestTruths(const xAOD::TrackParticle &) const override
vec Truth <- Track
virtual StatusCode update(const xAOD::TrackParticle &, const xAOD::TruthParticle &, float) override
Track -> Truth.
virtual bool isTestMatched(const xAOD::TrackParticle &t) const override
isTestMatched
virtual bool isTestMatched(const xAOD::TruthParticle &) const override
virtual const std::vector< const xAOD::TrackParticle * > & getMatchedTestTracks(const xAOD::TruthParticle &) const override
vec Track <- Truth
virtual bool isRefMatched(const xAOD::TruthParticle &) const override
#define ATH_MSG_WARNING(x)
virtual const xAOD::TrackParticle * getMatchedRefTrack(const xAOD::TruthParticle &t) const override
Truth -> Track.
virtual bool isTestMatched(const xAOD::TrackParticle &) const override
isTestMatched
virtual const xAOD::TrackParticle * getMatchedRefTrack(const xAOD::TruthParticle &) const override
Truth -> Track.
virtual const std::vector< const xAOD::TruthParticle * > & getMatchedTestTruths(const xAOD::TrackParticle &r) const override
vec Truth <- Track
virtual void clear() override
clear
virtual bool isTestMatched(const xAOD::TruthParticle &t) const override
virtual std::string printInfo(const std::vector< const xAOD::TruthParticle * > &testVec, const std::vector< const xAOD::TrackParticle * > &refVec) const override
Truth -> Track.
virtual StatusCode update(const xAOD::TrackParticle &, const xAOD::TrackParticle &, float) override
update
virtual void clear() override
clear
virtual unsigned getNmatches(bool getRefN) const override
getNmatches
Class describing a TrackParticle.
void clearMaps()
clear lookup tables
virtual bool isRefMatched(const xAOD::TruthParticle &) const override
virtual void clear() override
clear
~TrackMatchingLookup_truthTrk()=default
Destructor.
virtual std::string printInfo(const std::vector< const xAOD::TrackParticle * > &testVec, const std::vector< const xAOD::TruthParticle * > &refVec) const override
Track -> Truth.
virtual std::string printInfo(const std::vector< const xAOD::TrackParticle * > &, const std::vector< const xAOD::TruthParticle * > &) const override
Track -> Truth.
~TrackMatchingLookupBase()=default
Destructor.
unsigned getMapsSize(bool getRefN=false) const
get the overall number of matches
virtual const std::vector< const xAOD::TrackParticle * > & getMatchedTestTracks(const xAOD::TrackParticle &) const override
getMatchedTestTracks