#include <OverlapChecker.h>
Public Member Functions | |
bool | operator() (const reco::Candidate &, const reco::Candidate &) const |
return true if two candidates overlap |
Functor that checks the overlap of two Candidate objects
Definition at line 19 of file OverlapChecker.h.
bool OverlapChecker::operator() | ( | const reco::Candidate & | c1, |
const reco::Candidate & | c2 | ||
) | const |
return true if two candidates overlap
Definition at line 6 of file OverlapChecker.cc.
References reco::Candidate::begin(), reco::Candidate::end(), reco::Candidate::hasMasterClone(), reco::Candidate::masterClone(), reco::Candidate::numberOfDaughters(), and reco::Candidate::overlap().
{ typedef Candidate::const_iterator iterator; if( c1.numberOfDaughters() == 0 ) { if ( c2.numberOfDaughters() == 0 ) { if( c2.hasMasterClone() ) return c1.overlap( *(c2.masterClone()) ); else return c1.overlap( c2 ); } iterator b2 = c2.begin(), e2 = c2.end(); for( iterator i2 = b2; i2 != e2; ++ i2 ) { if( operator()( c1, * i2 ) ) { return true; } } return false; } iterator b1 = c1.begin(), e1 = c1.end(); for( iterator i1 = b1; i1 != e1; ++ i1 ) { if( operator()( * i1, c2 ) ) { return true; } } return false; }