CMS 3D CMS Logo

CompositePtrCandidate.h
Go to the documentation of this file.
1 #ifndef Candidate_CompositePtrCandidate_h
2 #define Candidate_CompositePtrCandidate_h
15 namespace reco {
16 
18  public:
20  typedef std::vector<CandidatePtr> daughters;
22  typedef std::vector<CandidatePtr> mothers;
27  const LorentzVector& p4,
28  const Point& vtx = Point(0, 0, 0),
29  int pdgId = 0,
30  int status = 0,
31  bool integerCharge = true)
32  : LeafCandidate(q, p4, vtx, pdgId, status, integerCharge) {}
35  const PolarLorentzVector& p4,
36  const Point& vtx = Point(0, 0, 0),
37  int pdgId = 0,
38  int status = 0,
39  bool integerCharge = true)
40  : LeafCandidate(q, p4, vtx, pdgId, status, integerCharge) {}
44  ~CompositePtrCandidate() override;
46  CompositePtrCandidate* clone() const override;
48  size_t numberOfDaughters() const override;
50  size_t numberOfMothers() const override;
52  const Candidate* daughter(size_type) const override;
53  using reco::LeafCandidate::daughter; // avoid hiding the base
55  Candidate* daughter(size_type) override;
57  void addDaughter(const CandidatePtr&);
59  virtual void clearDaughters() { dau.clear(); }
61  virtual CandidatePtr daughterPtr(size_type i) const { return dau[i]; }
63  virtual const daughters& daughterPtrVector() const { return dau; }
65  const Candidate* mother(size_t i = 0) const override;
70  size_type numberOfSourceCandidatePtrs() const override;
76 
77  private:
81  bool overlap(const Candidate&) const override;
82  };
83 
84  inline void CompositePtrCandidate::addDaughter(const CandidatePtr& cand) { dau.push_back(cand); }
85 
86 } // namespace reco
87 
88 #endif
mps_fire.i
i
Definition: mps_fire.py:355
reco::CompositePtrCandidate::mother
const Candidate * mother(size_t i=0) const override
return pointer to mother
Definition: CompositePtrCandidate.cc:14
reco::LeafCandidate::Point
math::XYZPoint Point
point in the space
Definition: LeafCandidate.h:27
reco::CompositePtrCandidate::sourceCandidatePtr
CandidatePtr sourceCandidatePtr(size_type i) const override
Definition: CompositePtrCandidate.cc:24
reco::CompositePtrCandidate::CompositePtrCandidate
CompositePtrCandidate()
default constructor
Definition: CompositePtrCandidate.h:24
reco::LeafCandidate::status
int status() const final
status word
Definition: LeafCandidate.h:180
reco::Candidate::PolarLorentzVector
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
Definition: Candidate.h:38
data-class-funcs.q
q
Definition: data-class-funcs.py:169
reco::Candidate::Charge
int Charge
electric charge type
Definition: Candidate.h:34
reco::CompositePtrCandidate::daughterPtrVector
virtual const daughters & daughterPtrVector() const
references to daughtes
Definition: CompositePtrCandidate.h:63
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
reco::CompositePtrCandidate::CompositePtrCandidate
CompositePtrCandidate(Charge q, const LorentzVector &p4, const Point &vtx=Point(0, 0, 0), int pdgId=0, int status=0, bool integerCharge=true)
constructor from values
Definition: CompositePtrCandidate.h:26
reco::CompositePtrCandidate::dau
daughters dau
collection of references to daughters
Definition: CompositePtrCandidate.h:79
reco::CompositePtrCandidate::~CompositePtrCandidate
~CompositePtrCandidate() override
destructor
Definition: CompositePtrCandidate.cc:6
LeafCandidate.h
badGlobalMuonTaggersAOD_cff.vtx
vtx
Definition: badGlobalMuonTaggersAOD_cff.py:5
Point
Structure Point Contains parameters of Gaussian fits to DMRs.
Definition: DMRtrends.cc:57
reco::LeafCandidate::daughter
const Candidate * daughter(size_type) const override
return daughter at a given position (throws an exception)
Definition: LeafCandidate.cc:29
reco::LeafCandidate::pdgId
int pdgId() const final
PDG identifier.
Definition: LeafCandidate.h:176
reco::CompositePtrCandidate::CompositePtrCandidate
CompositePtrCandidate(const Candidate &p)
constructor from a Candidate
Definition: CompositePtrCandidate.h:42
cand
Definition: decayParser.h:34
reco::CompositePtrCandidate::CompositePtrCandidate
CompositePtrCandidate(Charge q, const PolarLorentzVector &p4, const Point &vtx=Point(0, 0, 0), int pdgId=0, int status=0, bool integerCharge=true)
constructor from values
Definition: CompositePtrCandidate.h:34
reco::LeafCandidate::p4
const LorentzVector & p4() const final
four-momentum Lorentz vector
Definition: LeafCandidate.h:114
reco::CompositePtrCandidate::clearDaughters
virtual void clearDaughters()
clear daughter references
Definition: CompositePtrCandidate.h:59
reco::CompositePtrCandidate::mothers
std::vector< CandidatePtr > mothers
collection of references to daughters
Definition: CompositePtrCandidate.h:22
reco::CompositePtrCandidate::numberOfMothers
size_t numberOfMothers() const override
number of mothers
Definition: CompositePtrCandidate.cc:20
reco::CompositePtrCandidate::daughters
std::vector< CandidatePtr > daughters
collection of references to daughters
Definition: CompositePtrCandidate.h:20
reco::CompositePtrCandidate::numberOfDaughters
size_t numberOfDaughters() const override
number of daughters
Definition: CompositePtrCandidate.cc:18
edm::Ptr< Candidate >
reco::Candidate
Definition: Candidate.h:27
reco::LeafCandidate::p
double p() const final
magnitude of momentum vector
Definition: LeafCandidate.h:123
reco::CompositePtrCandidate
Definition: CompositePtrCandidate.h:17
reco::CompositePtrCandidate::overlap
bool overlap(const Candidate &) const override
check overlap with another candidate
Definition: CompositePtrCandidate.cc:26
reco::CompositePtrCandidate::daughter
const Candidate * daughter(size_type) const override
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode)
Definition: CompositePtrCandidate.cc:10
reco::LeafCandidate
Definition: LeafCandidate.h:16
reco::CompositePtrCandidate::addDaughter
void addDaughter(const CandidatePtr &)
add a daughter via a reference
Definition: CompositePtrCandidate.h:84
reco::Candidate::LorentzVector
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:36
reco::Candidate::size_type
size_t size_type
Definition: Candidate.h:29
reco::CompositePtrCandidate::clone
CompositePtrCandidate * clone() const override
returns a clone of the candidate
Definition: CompositePtrCandidate.cc:8
reco::CompositePtrCandidate::numberOfSourceCandidatePtrs
size_type numberOfSourceCandidatePtrs() const override
Definition: CompositePtrCandidate.cc:22
reco::CompositePtrCandidate::daughterPtr
virtual CandidatePtr daughterPtr(size_type i) const
reference to daughter at given position
Definition: CompositePtrCandidate.h:61