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_;
53 std::set<const reco::Candidate *> momsIntersection, momDaughters,
tmp;
58 if ( dauMatch == 0 )
return 0;
61 for(
size_t i = 0;
i < mothers; ++
i ) {
63 if ( mom != 0 && mom->
pdgId() == dauMatch->
pdgId() &&
68 momDaughters.insert( mom );
71 if ( momDaughters.size() == 0 )
return 0;
73 if ( momsIntersection.size() == 0 ) momsIntersection = momDaughters;
76 set_intersection( momsIntersection.begin(), momsIntersection.end(),
77 momDaughters.begin(), momDaughters.end(),
78 inserter( tmp, tmp.begin() ) );
79 swap( momsIntersection, tmp );
81 if ( momsIntersection.size() == 0 )
return 0;
84 if ( momsIntersection.size() > 1 )
return 0;
86 return * momsIntersection.begin();
90 for(
typename std::vector<const map_type *>::const_iterator
m = maps_.begin();
91 m != maps_.end(); ++
m ) {
92 for(
typename map_type::const_iterator
i = (*m)->begin();
i != (*m)->end(); ++
i ) {
93 if ( & *
i->key == & c )
void swap(ora::Record &rh, ora::Record &lh)
virtual const Candidate * mother(size_type i=0) const =0
return pointer to mother
virtual int status() const =0
status word
virtual size_type numberOfMothers() const =0
number of mothers (zero or one in most of but not all the cases)
FastCandMatcher(const map_vector &maps)
constructor
virtual size_type numberOfDaughters() const =0
number of daughters
virtual bool hasMasterClone() const =0
edm::AssociationMap< edm::OneToOne< C, reco::CandidateCollection > > map_type
map type
virtual const_iterator end() const =0
last daughter const_iterator
virtual int pdgId() const =0
PDG identifier.
std::vector< std::vector< double > > tmp
virtual const_iterator begin() const =0
first daughter const_iterator
std::vector< const map_type * > map_vector
map vector
const reco::Candidate * operator()(const reco::Candidate &) const
get match from transient reference
const std::vector< const map_type * > & maps() const
std::vector< const map_type * > maps_
pointers to stored maps
virtual const CandidateBaseRef & masterClone() const =0