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 ) { }
36  virtual CompositeRefBaseCandidate * clone() const;
38  virtual size_t numberOfDaughters() const;
40  virtual size_t numberOfMothers() const;
42  virtual const Candidate * daughter( size_type ) const;
44  virtual const Candidate * mother( size_type ) const;
46  virtual Candidate * daughter( size_type );
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  virtual bool overlap( const Candidate & ) const;
60  };
61 
63  dau.push_back( cand );
64  }
65 }
66 
67 #endif
virtual size_t numberOfDaughters() const
number of daughters
int Charge
electric charge type
Definition: Candidate.h:35
size_t size_type
Definition: Candidate.h:30
virtual size_t numberOfMothers() const
number of mothers
std::vector< CandidateBaseRef > daughters
collection of references to daughters
virtual CompositeRefBaseCandidate * clone() const
returns a clone of the candidate
virtual const Candidate * mother(size_type) const
return mother at a given position, i = 0, ... numberOfMothers() - 1 (read only mode) ...
virtual int status() const final
status word
CompositeRefBaseCandidate(const Candidate &c)
constructor from a particle
virtual bool overlap(const Candidate &) const
check overlap with another candidate
daughters dau
collection of references to daughters
virtual const Candidate * daughter(size_type) const
return daughter at a given position (throws an exception)
virtual int pdgId() const final
PDG identifier.
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
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
virtual const Candidate * daughter(size_type) const
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode) ...
void clearDaughters()
clear daughter references
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:37
fixed size matrix
math::XYZPoint Point
point in the space
Definition: Candidate.h:41
void addDaughter(const CandidateBaseRef &)
add a daughter via a reference
virtual const LorentzVector & p4() const final
four-momentum Lorentz vector
Definition: LeafCandidate.h:99
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