Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:03:49

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

0012 }
0013 
0014 const Candidate* CompositePtrCandidate::mother(size_type i) const { return nullptr; }
0015 
0016 Candidate* CompositePtrCandidate::daughter(size_type i) { return nullptr; }
0017 
0018 size_t CompositePtrCandidate::numberOfDaughters() const { return dau.size(); }
0019 
0020 size_t CompositePtrCandidate::numberOfMothers() const { return 0; }
0021 
0022 size_t CompositePtrCandidate::numberOfSourceCandidatePtrs() const { return numberOfDaughters(); }
0023 
0024 CandidatePtr CompositePtrCandidate::sourceCandidatePtr(size_type i) const { return daughterPtr(i); }
0025 
0026 bool CompositePtrCandidate::overlap(const Candidate& c2) const {
0027   throw cms::Exception("Error") << "can't check overlap internally for CompositePtrCanddate";
0028 }