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
16 
17 namespace reco {
18 
20  public:
22  typedef std::vector<CandidateBaseRef> daughters;
26  CompositeRefBaseCandidate( Charge q, const LorentzVector & p4, const Point & vtx = Point( 0, 0, 0 ),
27  int pdgId = 0, int status = 0, bool integerCharge = true ) :
28  LeafCandidate( q, p4, vtx, pdgId, status, integerCharge ) { }
30  CompositeRefBaseCandidate( Charge q, const PolarLorentzVector & p4, const Point & vtx = Point( 0, 0, 0 ),
31  int pdgId = 0, int status = 0, bool integerCharge = true ) :
32  LeafCandidate( q, p4, vtx, pdgId, status, integerCharge ) { }
34  explicit CompositeRefBaseCandidate( const Candidate & c ) : LeafCandidate( c ) { }
38  virtual CompositeRefBaseCandidate * clone() const;
40  virtual const_iterator begin() const;
42  virtual const_iterator end() const;
44  virtual iterator begin();
46  virtual iterator end();
48  virtual size_t numberOfDaughters() const;
50  virtual size_t numberOfMothers() const;
52  virtual const Candidate * daughter( size_type ) const;
54  virtual const Candidate * mother( size_type ) const;
56  virtual Candidate * daughter( size_type );
57  using reco::LeafCandidate::daughter; // avoid hiding the base
59  void addDaughter( const CandidateBaseRef & );
61  void clearDaughters() { dau.clear(); }
63  CandidateBaseRef daughterRef( size_type i ) const { return dau[ i ]; }
64 
65  private:
73  virtual bool overlap( const Candidate & ) const;
74  };
75 
77  dau.push_back( cand );
78  }
79 }
80 
81 #endif
virtual size_t numberOfDaughters() const
number of daughters
int Charge
electric charge type
Definition: Candidate.h:36
int i
Definition: DBlmapReader.cc:9
virtual int pdgId() const
PDG identifier.
size_t size_type
Definition: Candidate.h:31
virtual size_t numberOfMothers() const
number of mothers
candidate::const_iterator const_iterator
Definition: Candidate.h:32
virtual const_iterator begin() const
first daughter const_iterator
virtual int status() const
status word
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)
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:33
void clearDaughters()
clear daughter references
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:38
math::XYZPoint Point
point in the space
Definition: Candidate.h:42
void addDaughter(const CandidateBaseRef &)
add a daughter via a reference
virtual const LorentzVector & p4() const
four-momentum Lorentz vector
CandidateBaseRef daughterRef(size_type i) const
reference to daughter at given position
math::XYZPoint Point
point in the space
Definition: LeafCandidate.h:29
candidate::const_iterator_imp_specific< daughters > const_iterator_imp_specific
const iterator implementation
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
Definition: Candidate.h:40