CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CompositeRefBaseCandidate.h
Go to the documentation of this file.
1 #ifndef Candidate_CompositeRefBaseCandidate_h
2 #define Candidate_CompositeRefBaseCandidate_h
15 
16 namespace reco {
17 
19  public:
21  typedef std::vector<CandidateBaseRef> daughters;
25  CompositeRefBaseCandidate( Charge q, const LorentzVector & p4, const Point & vtx = Point( 0, 0, 0 ),
26  int pdgId = 0, int status = 0, bool integerCharge = true ) :
27  LeafCandidate( q, p4, vtx, pdgId, status, integerCharge ) { }
29  CompositeRefBaseCandidate( Charge q, const PolarLorentzVector & p4, const Point & vtx = Point( 0, 0, 0 ),
30  int pdgId = 0, int status = 0, bool integerCharge = true ) :
31  LeafCandidate( q, p4, vtx, pdgId, status, integerCharge ) { }
33  explicit CompositeRefBaseCandidate( const Candidate & c ) : LeafCandidate( c ) { }
37  virtual CompositeRefBaseCandidate * clone() const;
39  virtual const_iterator begin() const;
41  virtual const_iterator end() const;
43  virtual iterator begin();
45  virtual iterator end();
47  virtual size_t numberOfDaughters() const;
49  virtual size_t numberOfMothers() const;
51  virtual const Candidate * daughter( size_type ) const;
53  virtual const Candidate * mother( size_type ) const;
55  virtual Candidate * daughter( size_type );
56  using reco::LeafCandidate::daughter; // avoid hiding the base
58  void addDaughter( const CandidateBaseRef & );
60  void clearDaughters() { dau.clear(); }
62  CandidateBaseRef daughterRef( size_type i ) const { return dau[ i ]; }
63 
64  private:
72  virtual bool overlap( const Candidate & ) const;
73  };
74 
76  dau.push_back( cand );
77  }
78 }
79 
80 #endif
virtual size_t numberOfDaughters() const
number of daughters
int Charge
electric charge type
Definition: Candidate.h:39
int i
Definition: DBlmapReader.cc:9
size_t size_type
Definition: Candidate.h:34
virtual const LorentzVector & p4() const GCC11_FINAL
four-momentum Lorentz vector
virtual size_t numberOfMothers() const
number of mothers
candidate::const_iterator const_iterator
Definition: Candidate.h:35
virtual const_iterator begin() const
first daughter const_iterator
virtual int pdgId() const GCC11_FINAL
PDG identifier.
std::vector< CandidateBaseRef > daughters
collection of references to daughters
virtual CompositeRefBaseCandidate * clone() const
returns a clone of the candidate
candidate::iterator_imp_specific_dummy< daughters > iterator_imp_specific
iterator implementation
virtual const Candidate * mother(size_type) const
return mother at a given position, i = 0, ... numberOfMothers() - 1 (read only mode) ...
CompositeRefBaseCandidate(const Candidate &c)
constructor from a particle
virtual const_iterator end() const
last daughter const_iterator
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 status() const GCC11_FINAL
status word
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) ...
candidate::iterator iterator
Definition: Candidate.h:36
void clearDaughters()
clear daughter references
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:41
math::XYZPoint Point
point in the space
Definition: Candidate.h:45
void addDaughter(const CandidateBaseRef &)
add a daughter via a reference
CandidateBaseRef daughterRef(size_type i) const
reference to daughter at given position
math::XYZPoint Point
point in the space
Definition: LeafCandidate.h:32
candidate::const_iterator_imp_specific< daughters > const_iterator_imp_specific
const iterator implementation
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
Definition: Candidate.h:43