CMS 3D CMS Logo

CompositeRefBaseCandidate.h
Go to the documentation of this file.
1 #ifndef Candidate_CompositeRefBaseCandidate_h
2 #define Candidate_CompositeRefBaseCandidate_h
15 namespace reco {
16 
18  public:
20  typedef std::vector<CandidateBaseRef> daughters;
24  CompositeRefBaseCandidate( Charge q, const LorentzVector & p4, const Point & vtx = Point( 0, 0, 0 ),
25  int pdgId = 0, int status = 0, bool integerCharge = true ) :
26  LeafCandidate( q, p4, vtx, pdgId, status, integerCharge ) { }
28  CompositeRefBaseCandidate( Charge q, const PolarLorentzVector & p4, const Point & vtx = Point( 0, 0, 0 ),
29  int pdgId = 0, int status = 0, bool integerCharge = true ) :
30  LeafCandidate( q, p4, vtx, pdgId, status, integerCharge ) { }
32  explicit CompositeRefBaseCandidate( const Candidate & c ) : LeafCandidate( c ) { }
34  ~CompositeRefBaseCandidate() override;
36  CompositeRefBaseCandidate * clone() const override;
38  size_t numberOfDaughters() const override;
40  size_t numberOfMothers() const override;
42  const Candidate * daughter( size_type ) const override;
44  const Candidate * mother( size_type ) const override;
46  Candidate * daughter( size_type ) override;
47  using reco::LeafCandidate::daughter; // avoid hiding the base
49  void addDaughter( const CandidateBaseRef & );
51  void clearDaughters() { dau.clear(); }
53  CandidateBaseRef daughterRef( size_type i ) const { return dau[ i ]; }
54 
55  private:
57  daughters dau;
59  bool overlap( const Candidate & ) const override;
60  };
61 
63  dau.push_back( cand );
64  }
65 }
66 
67 #endif
int pdgId() const final
PDG identifier.
int Charge
electric charge type
Definition: Candidate.h:35
size_t size_type
Definition: Candidate.h:30
std::vector< CandidateBaseRef > daughters
collection of references to daughters
CompositeRefBaseCandidate(const Candidate &c)
constructor from a particle
const Candidate * daughter(size_type) const override
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode) ...
daughters dau
collection of references to daughters
CompositeRefBaseCandidate * clone() const override
returns a clone of the candidate
~CompositeRefBaseCandidate() override
destructor
CompositeRefBaseCandidate(Charge q, const LorentzVector &p4, const Point &vtx=Point(0, 0, 0), int pdgId=0, int status=0, bool integerCharge=true)
constructor from values
const LorentzVector & p4() const final
four-momentum Lorentz vector
Definition: LeafCandidate.h:99
CompositeRefBaseCandidate()
default constructor
CompositeRefBaseCandidate(Charge q, const PolarLorentzVector &p4, const Point &vtx=Point(0, 0, 0), int pdgId=0, int status=0, bool integerCharge=true)
constructor from values
bool overlap(const Candidate &) const override
check overlap with another candidate
const Candidate * daughter(size_type) const override
return daughter at a given position (throws an exception)
size_t numberOfDaughters() const override
number of daughters
void clearDaughters()
clear daughter references
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:37
fixed size matrix
Structure Point Contains parameters of Gaussian fits to DMRs.
Definition: DMRtrends.cc:55
int status() const final
status word
void addDaughter(const CandidateBaseRef &)
add a daughter via a reference
const Candidate * mother(size_type) const override
return mother at a given position, i = 0, ... numberOfMothers() - 1 (read only mode) ...
size_t numberOfMothers() const override
number of mothers
CandidateBaseRef daughterRef(size_type i) const
reference to daughter at given position
math::XYZPoint Point
point in the space
Definition: LeafCandidate.h:27
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
Definition: Candidate.h:39