#include <Associator_BestMatch.h>
|
template<typename Tp , typename Tq > |
std::map< int, int > | matcher (const std::vector< Tp * > &ref, const std::vector< Tq * > &test) |
|
Definition at line 80 of file Associator_BestMatch.h.
◆ map_type
◆ rmap_type
◆ Associator_BestDeltaRMatcher()
Associator_BestDeltaRMatcher::Associator_BestDeltaRMatcher |
( |
const std::string & |
name, |
|
|
double |
d |
|
) |
| |
|
inline |
◆ ~Associator_BestDeltaRMatcher()
virtual Associator_BestDeltaRMatcher::~Associator_BestDeltaRMatcher |
( |
| ) |
|
|
inlinevirtual |
◆ clear()
◆ clone()
◆ distance() [1/2]
template<typename T , typename S = T>
◆ distance() [2/2]
Definition at line 92 of file Associator_BestMatch.h.
93 double deta =
t0->eta()-
t1->eta();
94 double dphi =
t0->phi()-
t1->phi();
97 return std::sqrt( deta*deta + dphi*dphi );
◆ match() [1/2]
template<typename T , typename S = T>
virtual void BestMatcher< T, S >::match |
( |
const std::vector< T * > & |
ref, |
|
|
const std::vector< S * > & |
test |
|
) |
| |
|
inlinevirtualinherited |
◆ match() [2/2]
◆ matched() [1/2]
◆ matched() [2/2]
◆ matcher()
template<typename T , typename S = T>
template<typename Tp , typename Tq >
std::map<int, int> BestMatcher< T, S >::matcher |
( |
const std::vector< Tp * > & |
ref, |
|
|
const std::vector< Tq * > & |
test |
|
) |
| |
|
inlineprotectedinherited |
inserting into a multimatch sorts them into order as they are added so you get the list of best matches imediately NB: probably quicker to add them to a vector and then sort them afterward
now go through from best to worst, adding to another sorted set only the matches that do not use tracks already used by a better matching pair already found
set of unique track pairings NB: for some reason, using the multiset is faster than using a vector, even though we are only iterating through it later
hooray!! now print out the answer, make a map etc this isn't technically needed, could just use the set of "matched" objects, but hey ho
Definition at line 91 of file BestMatcher.h.
99 std::multiset<matched_>
m;
101 for (
unsigned int i=0 ;
i<
ref.size() ;
i++ ) {
103 for (
unsigned int j=0 ; j<
test.size() ; j++ ) {
106 m.insert( matched_(
d,
i, j) );
115 std::vector<bool> refused(
ref.size(),
false );
116 std::vector<bool> testused(
test.size(),
false );
122 std::multiset<matched_>
unique;
128 for ( ; mitr!=
m.end() ; mitr++ ) {
130 int rind = mitr->first();
131 int tind = mitr->second();
133 if ( refused[rind] )
continue;
134 if ( testused[tind] )
continue;
136 refused[rind] =
true;
137 testused[tind] =
true;
141 chi2 += (mitr->d()*mitr->d());
154 std::map<int, int> matches;
158 while ( mitr!=
unique.end() ) {
159 matches.insert( std::map<int, int>::value_type( mitr->first(), mitr->second() ) );
◆ revmatched() [1/2]
◆ revmatched() [2/2]
◆ size()
◆ m_d
template<typename T , typename S = T>
◆ mmatched
◆ mname
◆ mrevmatched
The documentation for this class was generated from the following file:
DataModel_detail::iterator< DVL > unique(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of unique for DataVector/List.