CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
OverlapChecker.cc
Go to the documentation of this file.
3 using namespace reco;
4 
5 bool OverlapChecker::operator()( const Candidate & c1, const Candidate & c2 ) const {
6  typedef Candidate::const_iterator iterator;
7  if( c1.numberOfDaughters() == 0 ) {
8  if ( c2.numberOfDaughters() == 0 ) {
9  if( c2.hasMasterClone() )
10  return c1.overlap( *(c2.masterClone()) );
11  else
12  return c1.overlap( c2 );
13  }
14  iterator b2 = c2.begin(), e2 = c2.end();
15  for( iterator i2 = b2; i2 != e2; ++ i2 ) {
16  if( operator()( c1, * i2 ) ) {
17  return true;
18  }
19  }
20  return false;
21  }
22  iterator b1 = c1.begin(), e1 = c1.end();
23  for( iterator i1 = b1; i1 != e1; ++ i1 ) {
24  if( operator()( * i1, c2 ) ) {
25  return true;
26  }
27  }
28  return false;
29 }
30 
tuple c2
Definition: counter.py:145
virtual size_type numberOfDaughters() const =0
number of daughters
virtual bool hasMasterClone() const =0
const_iterator end() const
last daughter const_iterator
Definition: Candidate.h:146
const_iterator begin() const
first daughter const_iterator
Definition: Candidate.h:144
virtual bool overlap(const Candidate &) const =0
check overlap with another Candidate
bool operator()(const reco::Candidate &, const reco::Candidate &) const
return true if two candidates overlap
virtual const CandidateBaseRef & masterClone() const =0