CMS 3D CMS Logo

List of all members | Public Member Functions
OverlapChecker Class Reference

#include <OverlapChecker.h>

Public Member Functions

bool operator() (const reco::Candidate &, const reco::Candidate &) const
 return true if two candidates overlap More...
 

Detailed Description

Functor that checks the overlap of two Candidate objects

Author
Luca Lista, INFN

Definition at line 17 of file OverlapChecker.h.

Member Function Documentation

◆ operator()()

bool OverlapChecker::operator() ( const reco::Candidate c1,
const reco::Candidate c2 
) const

return true if two candidates overlap

Definition at line 5 of file OverlapChecker.cc.

5  {
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 }

References b1, b2, reco::Candidate::begin(), alignmentValidation::c1, StorageManager_cfg::e1, reco::Candidate::end(), reco::Candidate::hasMasterClone(), testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, reco::Candidate::masterClone(), and reco::Candidate::numberOfDaughters().

testProducerWithPsetDescEmpty_cfi.i2
i2
Definition: testProducerWithPsetDescEmpty_cfi.py:46
testProducerWithPsetDescEmpty_cfi.i1
i1
Definition: testProducerWithPsetDescEmpty_cfi.py:45
reco::candidate::const_iterator
Definition: const_iterator.h:14
b2
static constexpr float b2
Definition: L1EGammaCrystalsEmulatorProducer.cc:83
b1
static constexpr float b1
Definition: L1EGammaCrystalsEmulatorProducer.cc:83
reco::Candidate::numberOfDaughters
virtual size_type numberOfDaughters() const =0
number of daughters
reco::Candidate::hasMasterClone
virtual bool hasMasterClone() const =0
reco::Candidate::end
const_iterator end() const
last daughter const_iterator
Definition: Candidate.h:145
StorageManager_cfg.e1
e1
Definition: StorageManager_cfg.py:16
alignmentValidation.c1
c1
do drawing
Definition: alignmentValidation.py:1025
reco::Candidate::masterClone
virtual const CandidateBaseRef & masterClone() const =0
reco::Candidate::begin
const_iterator begin() const
first daughter const_iterator
Definition: Candidate.h:143