Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:52:55

0001 #include "DataFormats/Candidate/interface/OverlapChecker.h"
0002 #include "DataFormats/Candidate/interface/Candidate.h"
0003 using namespace reco;
0004 
0005 bool OverlapChecker::operator()(const Candidate& c1, const Candidate& c2) const {
0006   typedef Candidate::const_iterator iterator;
0007   if (c1.numberOfDaughters() == 0) {
0008     if (c2.numberOfDaughters() == 0) {
0009       if (c2.hasMasterClone())
0010         return c1.overlap(*(c2.masterClone()));
0011       else
0012         return c1.overlap(c2);
0013     }
0014     iterator b2 = c2.begin(), e2 = c2.end();
0015     for (iterator i2 = b2; i2 != e2; ++i2) {
0016       if (operator()(c1, *i2)) {
0017         return true;
0018       }
0019     }
0020     return false;
0021   }
0022   iterator b1 = c1.begin(), e1 = c1.end();
0023   for (iterator i1 = b1; i1 != e1; ++i1) {
0024     if (operator()(*i1, c2)) {
0025       return true;
0026     }
0027   }
0028   return false;
0029 }