ATLAS Offline Software
Loading...
Searching...
No Matches
StableMatchingBase.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_STABLEMATCHINGBASE_H
6#define INDETTRACKPERFMON_STABLEMATCHINGBASE_H
7
14
16#include "AsgTools/AsgTool.h"
17
19#include "ITrackMatchingTool.h"
21#include "TrackMatchingLookup.h"
22
23#include <vector>
24#include <algorithm>
25
26namespace IDTPM {
27
31 template< typename T, typename R=T >
33 public:
34
36 StableMatchingBase( const std::string& name ) :
37 asg::AsgTool( name ) { };
38
40 virtual StatusCode matchVectors(const std::vector< const T* >& vTest,
41 const std::vector< const R* >& vRef,
42 ITrackMatchingLookup& matches ) const;
43
44 // Override this in derived classes
45 virtual float distance(const T& t, const R& r) const = 0;
46
47 protected:
48
49 // Helper methods (implemented in StableMatchingBase.icc)
50 void buildDistanceMatrix(const std::vector<const T*>& vTest,
51 const std::vector<const R*>& vRef,
52 std::vector<std::vector<float>>& dist) const;
53
54 void buildPreferenceLists(const std::vector<std::vector<float>>& dist,
55 std::vector<std::vector<int>>& testPrefs,
56 std::vector<std::vector<int>>& refRankings) const;
57
58 void galeShapley(const std::vector<std::vector<int>>& testPrefs,
59 const std::vector<std::vector<int>>& refRankings,
60 const std::vector<std::vector<float>>& dist,
61 std::vector<int>& testMatch,
62 std::vector<int>& refMatch) const;
63 };
64
65} // namespace IDTPM
66
68#endif // > !INDETTRACKPERFMON_STABLEMATCHINGBASE_H
interface for track matching tools in this package
Class to hold for each event collections needed in the TrkAnalsis.
Look-up table (templated) class to store (internally to IDTPM) all the matches between test and refer...
void galeShapley(const std::vector< std::vector< int > > &testPrefs, const std::vector< std::vector< int > > &refRankings, const std::vector< std::vector< float > > &dist, std::vector< int > &testMatch, std::vector< int > &refMatch) const
virtual float distance(const T &t, const R &r) const =0
void buildPreferenceLists(const std::vector< std::vector< float > > &dist, std::vector< std::vector< int > > &testPrefs, std::vector< std::vector< int > > &refRankings) const
StableMatchingBase(const std::string &name)
Constructor.
virtual StatusCode matchVectors(const std::vector< const T * > &vTest, const std::vector< const R * > &vRef, ITrackMatchingLookup &matches) const
matchVectors
void buildDistanceMatrix(const std::vector< const T * > &vTest, const std::vector< const R * > &vRef, std::vector< std::vector< float > > &dist) const
Base class for the dual-use tool implementation classes.
Definition AsgTool.h:47
AsgTool(const std::string &name)
Constructor specifying the tool instance's name.
Definition AsgTool.cxx:58
int r
Definition globals.cxx:22
Athena include(s).