#include <CandMatcherNew.h>
Public Types | |
typedef edm::Association< C > | map_type |
map type | |
typedef edm::Association< C > | map_type |
map type | |
typedef std::vector< const map_type * > | map_vector |
typedef std::vector< const map_type * > | map_vector |
typedef edm::Association< C > ::reference_type | reference_type |
ref type | |
typedef edm::Association< C > ::reference_type | reference_type |
ref type | |
Public Member Functions | |
CandMatcher (const map_vector &maps) | |
constructor | |
CandMatcher (const map_type &map) | |
constructor | |
CandMatcher (const map_vector &maps) | |
constructor | |
CandMatcher (const map_type &map) | |
constructor | |
reference_type | operator[] (const reco::Candidate &) const |
get match from transient reference | |
reference_type | operator[] (const reco::Candidate &) const |
get match from transient reference | |
map_type::refprod_type | ref () const |
reference to matched collection | |
map_type::refprod_type | ref () const |
reference to matched collection | |
virtual | ~CandMatcher () |
destructor | |
virtual | ~CandMatcher () |
destructor | |
Protected Attributes | |
map_type | map_ |
match map at leaf level |
Definition at line 19 of file CandMatcherNew.h.
typedef edm::Association<C> reco::utilsNew::CandMatcher< C >::map_type |
map type
Definition at line 22 of file CandMatcherNew.h.
typedef edm::Association<C> reco::utilsNew::CandMatcher< C >::map_type |
map type
Definition at line 22 of file CandMatcherNew.h.
typedef std::vector<const map_type *> reco::utilsNew::CandMatcher< C >::map_vector |
Definition at line 25 of file CandMatcherNew.h.
typedef std::vector<const map_type *> reco::utilsNew::CandMatcher< C >::map_vector |
Definition at line 25 of file CandMatcherNew.h.
typedef edm::Association<C>::reference_type reco::utilsNew::CandMatcher< C >::reference_type |
ref type
Definition at line 24 of file CandMatcherNew.h.
typedef edm::Association<C>::reference_type reco::utilsNew::CandMatcher< C >::reference_type |
ref type
Definition at line 24 of file CandMatcherNew.h.
reco::utilsNew::CandMatcher< C >::CandMatcher | ( | const map_vector & | maps | ) | [explicit] |
constructor
reco::utilsNew::CandMatcher< C >::CandMatcher | ( | const map_type & | map | ) | [explicit] |
constructor
CandMatcher< C >::~CandMatcher | ( | ) | [virtual] |
reco::utilsNew::CandMatcher< C >::CandMatcher | ( | const map_vector & | maps | ) | [explicit] |
constructor
reco::utilsNew::CandMatcher< C >::CandMatcher | ( | const map_type & | map | ) | [explicit] |
constructor
virtual reco::utilsNew::CandMatcher< C >::~CandMatcher | ( | ) | [virtual] |
destructor
CandMatcher< C >::reference_type CandMatcher< C >::operator[] | ( | const reco::Candidate & | c | ) | const |
get match from transient reference
Definition at line 60 of file CandMatcherNew.h.
References reco::Candidate::daughter(), reco::Candidate::hasMasterClone(), i, UserOptions_cff::idx, edm::Ref< C, T, F >::isNull(), edm::Ref< C, T, F >::key(), m, funct::master(), reco::Candidate::masterClone(), reco::Candidate::numberOfDaughters(), dt_dqm_sourceclient_common_cff::reco, reco::swap(), and tmp.
{ using namespace reco; using namespace std; if (c.hasMasterClone()) { CandidateBaseRef master = c.masterClone(); return master->numberOfDaughters() == 0 ? map_[master] : (*this)[*master]; } size_t nDau = c.numberOfDaughters(); if(nDau == 0) return reference_type(); set<size_t> momIdx, common, tmp; for(size_t i = 0; i < nDau; ++ i) { const Candidate & d = * c.daughter(i); reference_type m = (*this)[d]; if (m.isNull()) return reference_type(); momIdx.clear(); while(m->numberOfMothers() == 1) { m = m->motherRef(); momIdx.insert(m.key()); } if(momIdx.size() == 0) return reference_type(); if (common.size() == 0) common = momIdx; else { tmp.clear(); set_intersection(common.begin(), common.end(), momIdx.begin(), momIdx.end(), inserter(tmp, tmp.begin())); swap(common, tmp); } if (common.size() == 0) return reference_type(); } size_t idx = * max_element(common.begin(), common.end()); return reference_type(map_.ref(), idx); }
reference_type reco::utilsNew::CandMatcher< C >::operator[] | ( | const reco::Candidate & | ) | const |
get match from transient reference
map_type::refprod_type reco::utilsNew::CandMatcher< C >::ref | ( | ) | const [inline] |
reference to matched collection
Definition at line 35 of file CandMatcherNew.h.
References reco::utilsNew::CandMatcher< C >::map_, and edm::Association< C >::ref().
map_type::refprod_type reco::utilsNew::CandMatcher< C >::ref | ( | ) | const [inline] |
reference to matched collection
Definition at line 35 of file CandMatcherNew.h.
References reco::utilsNew::CandMatcher< C >::map_, and edm::Association< C >::ref().
Referenced by reco::modulesNew::MCTruthCompositeMatcher::produce().
map_type CandMatcher< C1, C2 >::map_ [protected] |
match map at leaf level
Definition at line 38 of file CandMatcherNew.h.
Referenced by reco::utilsNew::CandMatcher< C >::ref().