#include <GeneratorInterface/LHEInterface/src/Matching.h>
Public Types | |
typedef SimpleMatrix< Delta > ::size_type | index_type |
Public Member Functions | |
Delta | delta (Match match) const |
Delta | delta (index_type index1, index_type index2) const |
bool | isMatched1st (index_type index) |
bool | isMatched2nd (index_type index) |
std::vector< Match > | match () |
template<class SortComparator> | |
std::vector< Match > | match () |
template<class SortComparator, class CutCriterion> | |
std::vector< Match > | match (SortComparator sortComparator=SortComparator(), CutCriterion cutCriterion=CutCriterion()) |
template<typename V1, typename V2, class Separation> | |
Matching (const V1 &v1, const V2 &v2, Separation separation) | |
Private Attributes | |
std::vector< bool > | matched1 |
std::vector< bool > | matched2 |
SimpleMatrix< Delta > | matrix |
Classes | |
struct | AlwaysTrue |
struct | Comparator |
struct | Match |
Definition at line 14 of file Matching.h.
typedef SimpleMatrix<Delta>::size_type lhef::Matching< Delta >::index_type |
Definition at line 16 of file Matching.h.
lhef::Matching< Delta >::Matching | ( | const V1 & | v1, | |
const V2 & | v2, | |||
Separation | separation | |||
) | [inline] |
Definition at line 19 of file Matching.h.
References i, j, and lhef::Matching< Delta >::matrix.
00019 : 00020 matrix(v1.size(), v2.size()), 00021 matched1(v1.size(), false), 00022 matched2(v2.size(), false) 00023 { 00024 index_type i = 0; 00025 for(typename V1::const_iterator iter1 = v1.begin(); 00026 iter1 != v1.end(); ++iter1, i++) { 00027 index_type j = 0; 00028 for(typename V2::const_iterator iter2 = v2.begin(); 00029 iter2 != v2.end(); ++iter2, j++) 00030 matrix(i, j) = separation(*iter1, *iter2); 00031 00032 } 00033 }
Delta lhef::Matching< Delta >::delta | ( | Match | match | ) | const [inline] |
Definition at line 47 of file Matching.h.
References lhef::Matching< Delta >::Match::index1, lhef::Matching< Delta >::Match::index2, and lhef::Matching< Delta >::matrix.
Delta lhef::Matching< Delta >::delta | ( | index_type | index1, | |
index_type | index2 | |||
) | const [inline] |
Definition at line 44 of file Matching.h.
References lhef::Matching< Delta >::matrix.
00045 { return matrix(index1, index2); }
bool lhef::Matching< Delta >::isMatched1st | ( | index_type | index | ) | [inline] |
bool lhef::Matching< Delta >::isMatched2nd | ( | index_type | index | ) | [inline] |
std::vector<Match> lhef::Matching< Delta >::match | ( | ) | [inline] |
std::vector<Match> lhef::Matching< Delta >::match | ( | ) | [inline] |
std::vector<Match> lhef::Matching< Delta >::match | ( | SortComparator | sortComparator = SortComparator() , |
|
CutCriterion | cutCriterion = CutCriterion() | |||
) | [inline] |
Definition at line 72 of file Matching.h.
References parsecf::pyparsing::col(), i, iter, lhef::Matching< Delta >::matched1, lhef::Matching< Delta >::matched2, lhef::Matching< Delta >::matrix, min, HLT_VtxMuL3::result, row, lhef::SimpleMatrix< T >::size(), and python::multivaluedict::sort().
00075 { 00076 std::vector<index_type> matches(matrix.size()); 00077 for(index_type i = 0; i != matrix.size(); i++) 00078 matches[i] = i; 00079 00080 std::sort(matches.begin(), matches.end(), 00081 Comparator<SortComparator>(matrix, sortComparator)); 00082 00083 std::vector<Match> result; 00084 result.reserve(std::min(matrix.rows(), matrix.cols())); 00085 for(typename std::vector<index_type>::const_iterator iter = 00086 matches.begin(); iter != matches.end(); ++iter) { 00087 00088 index_type row = matrix.row(*iter); 00089 index_type col = matrix.col(*iter); 00090 if (matched1[row] || matched2[col]) 00091 continue; 00092 00093 if (!cutCriterion(matrix[*iter])) 00094 continue; 00095 00096 matched1[row] = true; 00097 matched2[col] = true; 00098 result.push_back(Match(row, col)); 00099 } 00100 00101 return result; 00102 }
std::vector<bool> lhef::Matching< Delta >::matched1 [private] |
Definition at line 116 of file Matching.h.
Referenced by lhef::Matching< Delta >::isMatched1st(), and lhef::Matching< Delta >::match().
std::vector<bool> lhef::Matching< Delta >::matched2 [private] |
Definition at line 116 of file Matching.h.
Referenced by lhef::Matching< Delta >::isMatched2nd(), and lhef::Matching< Delta >::match().
SimpleMatrix<Delta> lhef::Matching< Delta >::matrix [private] |
Definition at line 115 of file Matching.h.
Referenced by lhef::Matching< Delta >::delta(), lhef::Matching< Delta >::match(), and lhef::Matching< Delta >::Matching().