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_;
49 if (
c.hasMasterClone() )
50 return (*
this)( *
c.masterClone() );
51 unsigned int nDau =
c.numberOfDaughters();
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() ) );
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();
93 m != maps_.end(); ++
m ) {
95 if ( & *
i->key == &
c )