CMS 3D CMS Logo

CompositeRefCandidate.h
Go to the documentation of this file.
1 #ifndef Candidate_CompositeRefCandidate_h
2 #define Candidate_CompositeRefCandidate_h
15 namespace reco {
16 
18  public:
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  ~CompositeRefCandidate() override;
46  CompositeRefCandidate* clone() const override;
48  size_t numberOfDaughters() const override;
50  const Candidate* daughter(size_type) const override;
52  Candidate* daughter(size_type) override;
53  using reco::LeafCandidate::daughter; // avoid hiding the base
55  void addDaughter(const CandidateRef&);
57  void addMother(const CandidateRef&);
59  void clearDaughters() { dau.clear(); }
61  CandidateRef daughterRef(size_type i) const { return dau[i]; }
63  const daughters& daughterRefVector() const { return dau; }
65  CandidateRef motherRef(size_type i = 0) const { return mom[i]; }
67  const mothers& motherRefVector() const { return mom; }
69  void resetDaughters(const edm::ProductID& id) { dau = daughters(id); }
71  size_t numberOfMothers() const override;
73  const Candidate* mother(size_t i = 0) const override;
74 
75  private:
81  bool overlap(const Candidate&) const override;
82  };
83 
85 
87 } // namespace reco
88 
89 #endif
int Charge
electric charge type
Definition: Candidate.h:34
const daughters & daughterRefVector() const
references to daughtes
void clearDaughters()
clear daughter references
CandidateRefVector mothers
collection of references to daughters
size_t size_type
Definition: Candidate.h:29
const Candidate * daughter(size_type) const override
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode) ...
~CompositeRefCandidate() override
destructor
void addDaughter(const CandidateRef &)
add a daughter via a reference
int status() const final
status word
CandidateRef daughterRef(size_type i) const
reference to daughter at given position
const LorentzVector & p4() const final
four-momentum Lorentz vector
size_t numberOfDaughters() const override
number of daughters
int pdgId() const final
PDG identifier.
const Candidate * daughter(size_type) const override
return daughter at a given position (throws an exception)
size_t numberOfMothers() const override
number of mothers (zero or one in most of but not all the cases)
double p() const final
magnitude of momentum vector
daughters dau
collection of references to daughters
CompositeRefCandidate(const Candidate &p)
constructor from a candidate
daughters mom
collection of references to mothers
bool overlap(const Candidate &) const override
check overlap with another candidate
CompositeRefCandidate(Charge q, const LorentzVector &p4, const Point &vtx=Point(0, 0, 0), int pdgId=0, int status=0, bool integerCharge=true)
constructor from values
void addMother(const CandidateRef &)
add a daughter via a reference
const Candidate * mother(size_t i=0) const override
return pointer to mother
void clear()
Clear the vector.
Definition: RefVector.h:142
void resetDaughters(const edm::ProductID &id)
set daughters product ID
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:36
CandidateRef motherRef(size_type i=0) const
reference to mother at given position
fixed size matrix
Structure Point Contains parameters of Gaussian fits to DMRs.
Definition: DMRtrends.cc:57
CompositeRefCandidate(Charge q, const PolarLorentzVector &p4, const Point &vtx=Point(0, 0, 0), int pdgId=0, int status=0, bool integerCharge=true)
constructor from values
CompositeRefCandidate * clone() const override
returns a clone of the candidate
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
Definition: RefVector.h:67
CandidateRefVector daughters
collection of references to daughters
const mothers & motherRefVector() const
references to mothers
math::XYZPoint Point
point in the space
Definition: LeafCandidate.h:27
CompositeRefCandidate()
default constructor
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
Definition: Candidate.h:38