|
|
Go to the documentation of this file. 1 #ifndef RecoBTag_Analysis_Matching_h
2 #define RecoBTag_Analysis_Matching_h
12 template <
typename Delta>
17 template <
typename V1,
typename V2,
class Separation>
18 Matching(
const V1 &v1,
const V2 &v2, Separation separation)
21 for (
typename V1::const_iterator iter1 = v1.begin(); iter1 != v1.end(); ++iter1, ++
i) {
23 for (
typename V2::const_iterator iter2 = v2.begin(); iter2 != v2.end(); ++iter2, ++
j)
24 matrix(
i,
j) = separation(*iter1, *iter2);
41 template <
class SortComparator>
58 template <
class SortComparator,
class CutCriterion>
59 std::vector<Match>
match(SortComparator sortComparator = SortComparator(),
60 CutCriterion cutCriterion = CutCriterion()) {
69 for (
typename std::vector<index_type>::const_iterator iter =
matches.begin(); iter !=
matches.end(); ++iter) {
75 if (!cutCriterion(
matrix[*iter]))
86 template <
class SortComparator>
87 inline std::vector<Match>
match() {
88 return match<SortComparator, AlwaysTrue>();
91 inline std::vector<Match>
match() {
return match<std::less<Delta>,
AlwaysTrue>(); }
103 #endif // GeneratorEvent_Analysis_Matching_h
bool isMatched2nd(index_type index)
SimpleMatrix< Delta > matrix
size_type col(size_type index) const
bool isMatched1st(index_type index)
std::vector< bool > matched1
std::vector< Match > match()
bool operator()(index_type i1, index_type i2) const
std::vector< Match > match(SortComparator sortComparator=SortComparator(), CutCriterion cutCriterion=CutCriterion())
Delta delta(Match match) const
std::vector< bool > matched2
SimpleMatrix< Delta >::size_type index_type
Comparator(const SimpleMatrix< Delta > &matrix, SortComparator &sort)
bool operator()(Delta dummy)
size_type row(size_type index) const
std::vector< Match > match()
Matching::index_type index_type
Matching(const V1 &v1, const V2 &v2, Separation separation)
Match(index_type i1, index_type i2)
const SimpleMatrix< Delta > & matrix
Delta delta(index_type index1, index_type index2) const
Matching::index_type index_type