Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #include "DataFormats/Candidate/interface/CompositeRefCandidate.h"
0002 #include "FWCore/Utilities/interface/Exception.h"
0003 
0004 using namespace reco;
0005 
0006 CompositeRefCandidate::~CompositeRefCandidate() {}
0007 
0008 CompositeRefCandidate* CompositeRefCandidate::clone() const { return new CompositeRefCandidate(*this); }
0009 
0010 const Candidate* CompositeRefCandidate::daughter(size_type i) const {
0011   return (i < numberOfDaughters()) ? &*dau[i] : nullptr;  // i >= 0, since i is unsigned

0012 }
0013 
0014 const Candidate* CompositeRefCandidate::mother(size_type i) const {
0015   return (i < numberOfMothers()) ? &*mom[i] : nullptr;  // i >= 0, since i is unsigned

0016 }
0017 
0018 Candidate* CompositeRefCandidate::daughter(size_type i) { return nullptr; }
0019 
0020 size_t CompositeRefCandidate::numberOfDaughters() const { return dau.size(); }
0021 
0022 size_t CompositeRefCandidate::numberOfMothers() const { return mom.size(); }
0023 
0024 bool CompositeRefCandidate::overlap(const Candidate& c2) const {
0025   throw cms::Exception("Error") << "can't check overlap internally for CompositeRefCanddate";
0026 }