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
reco::CompositeRefCandidate::daughterRefVector
const daughters & daughterRefVector() const
references to daughtes
Definition: CompositeRefCandidate.h:63
reco::CompositeRefCandidate::clearDaughters
void clearDaughters()
clear daughter references
Definition: CompositeRefCandidate.h:59
edm::RefVector::clear
void clear()
Clear the vector.
Definition: RefVector.h:142
mps_fire.i
i
Definition: mps_fire.py:355
reco::LeafCandidate::Point
math::XYZPoint Point
point in the space
Definition: LeafCandidate.h:27
reco::LeafCandidate::status
int status() const final
status word
Definition: LeafCandidate.h:180
reco::CompositeRefCandidate::daughter
const Candidate * daughter(size_type) const override
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode)
Definition: CompositeRefCandidate.cc:10
reco::Candidate::PolarLorentzVector
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
Definition: Candidate.h:38
reco::CompositeRefCandidate::mothers
CandidateRefVector mothers
collection of references to daughters
Definition: CompositeRefCandidate.h:22
reco::CompositeRefCandidate::addDaughter
void addDaughter(const CandidateRef &)
add a daughter via a reference
Definition: CompositeRefCandidate.h:84
data-class-funcs.q
q
Definition: data-class-funcs.py:169
reco::Candidate::Charge
int Charge
electric charge type
Definition: Candidate.h:34
reco::CompositeRefCandidate::daughterRef
CandidateRef daughterRef(size_type i) const
reference to daughter at given position
Definition: CompositeRefCandidate.h:61
edm::RefVector
Definition: EDProductfwd.h:27
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
reco::CompositeRefCandidate::~CompositeRefCandidate
~CompositeRefCandidate() override
destructor
Definition: CompositeRefCandidate.cc:6
edm::Ref
Definition: AssociativeIterator.h:58
reco::CompositeRefCandidate
Definition: CompositeRefCandidate.h:17
reco::CompositeRefCandidate::dau
daughters dau
collection of references to daughters
Definition: CompositeRefCandidate.h:77
reco::CompositeRefCandidate::numberOfDaughters
size_t numberOfDaughters() const override
number of daughters
Definition: CompositeRefCandidate.cc:20
reco::CompositeRefCandidate::mom
daughters mom
collection of references to mothers
Definition: CompositeRefCandidate.h:79
LeafCandidate.h
reco::CompositeRefCandidate::numberOfMothers
size_t numberOfMothers() const override
number of mothers (zero or one in most of but not all the cases)
Definition: CompositeRefCandidate.cc:22
badGlobalMuonTaggersAOD_cff.vtx
vtx
Definition: badGlobalMuonTaggersAOD_cff.py:5
reco::CompositeRefCandidate::CompositeRefCandidate
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
Definition: CompositeRefCandidate.h:26
reco::CompositeRefCandidate::CompositeRefCandidate
CompositeRefCandidate(const Candidate &p)
constructor from a candidate
Definition: CompositeRefCandidate.h:42
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::CompositeRefCandidate::overlap
bool overlap(const Candidate &) const override
check overlap with another candidate
Definition: CompositeRefCandidate.cc:24
cand
Definition: decayParser.h:34
reco::CompositeRefCandidate::addMother
void addMother(const CandidateRef &)
add a daughter via a reference
Definition: CompositeRefCandidate.h:86
reco::LeafCandidate::p4
const LorentzVector & p4() const final
four-momentum Lorentz vector
Definition: LeafCandidate.h:114
edm::RefVector::push_back
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
Definition: RefVector.h:67
reco::Candidate
Definition: Candidate.h:27
reco::CompositeRefCandidate::motherRef
CandidateRef motherRef(size_type i=0) const
reference to mother at given position
Definition: CompositeRefCandidate.h:65
reco::CompositeRefCandidate::mother
const Candidate * mother(size_t i=0) const override
return pointer to mother
Definition: CompositeRefCandidate.cc:14
reco::CompositeRefCandidate::resetDaughters
void resetDaughters(const edm::ProductID &id)
set daughters product ID
Definition: CompositeRefCandidate.h:69
reco::CompositeRefCandidate::daughters
CandidateRefVector daughters
collection of references to daughters
Definition: CompositeRefCandidate.h:20
reco::CompositeRefCandidate::motherRefVector
const mothers & motherRefVector() const
references to mothers
Definition: CompositeRefCandidate.h:67
reco::LeafCandidate::p
double p() const final
magnitude of momentum vector
Definition: LeafCandidate.h:123
reco::LeafCandidate
Definition: LeafCandidate.h:16
reco::CompositeRefCandidate::CompositeRefCandidate
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
Definition: CompositeRefCandidate.h:34
reco::CompositeRefCandidate::clone
CompositeRefCandidate * clone() const override
returns a clone of the candidate
Definition: CompositeRefCandidate.cc:8
reco::Candidate::LorentzVector
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:36
reco::CompositeRefCandidate::CompositeRefCandidate
CompositeRefCandidate()
default constructor
Definition: CompositeRefCandidate.h:24
reco::Candidate::size_type
size_t size_type
Definition: Candidate.h:29
edm::ProductID
Definition: ProductID.h:27