1 #ifndef CandUtils_FastCandMatcher_h 2 #define CandUtils_FastCandMatcher_h 29 const std::vector<const map_type *> &
maps()
const {
return maps_; }
32 std::vector<const map_type *>
maps_;
55 set<const reco::Candidate *> momsIntersection, momDaughters,
tmp;
58 const Candidate * dauMatch = (*this)( * dau );
60 if ( dauMatch == 0 )
return 0;
63 for(
size_t i = 0;
i < mothers; ++
i ) {
65 if ( mom != 0 && mom->
pdgId() == dauMatch->
pdgId() &&
70 momDaughters.insert( mom );
73 if ( momDaughters.size() == 0 )
return 0;
75 if ( momsIntersection.size() == 0 ) momsIntersection = momDaughters;
78 set_intersection( momsIntersection.begin(), momsIntersection.end(),
79 momDaughters.begin(), momDaughters.end(),
80 inserter( tmp, tmp.begin() ) );
81 swap( momsIntersection, tmp );
83 if ( momsIntersection.size() == 0 )
return 0;
86 if ( momsIntersection.size() > 1 )
return 0;
88 return * momsIntersection.begin();
92 for(
typename std::vector<const map_type *>::const_iterator
m =
maps_.begin();
95 if ( & *
i->key == & c )
std::vector< const map_type * > maps_
pointers to stored maps
virtual const Candidate * mother(size_type i=0) const =0
return pointer to mother
void swap(Association< C > &lhs, Association< C > &rhs)
FastCandMatcher(const map_vector &maps)
constructor
virtual int status() const =0
status word
edm::AssociationMap< edm::OneToOne< C, reco::CandidateCollection > > map_type
map type
virtual int pdgId() const =0
PDG identifier.
const_iterator end() const
last daughter const_iterator
virtual size_type numberOfMothers() const =0
number of mothers (zero or one in most of but not all the cases)
virtual const CandidateBaseRef & masterClone() const =0
std::vector< std::vector< double > > tmp
const_iterator begin() const
first daughter const_iterator
std::vector< const map_type * > map_vector
map vector
virtual size_type numberOfDaughters() const =0
number of daughters
const reco::Candidate * operator()(const reco::Candidate &) const
get match from transient reference
const std::vector< const map_type * > & maps() const
virtual bool hasMasterClone() const =0