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 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:
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
int i
Definition: DBlmapReader.cc:9
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) ...
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 int status() const final
status word
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) ...
void clearDaughters()
clear daughter references
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:37
virtual int pdgId() const final
PDG identifier.
math::XYZPoint Point
point in the space
Definition: Candidate.h:41
void addDaughter(const CandidateBaseRef &)
add a daughter via a reference
CandidateBaseRef daughterRef(size_type i) const
reference to daughter at given position
virtual const LorentzVector & p4() const final
four-momentum Lorentz vector
Definition: LeafCandidate.h:99
math::XYZPoint Point
point in the space
Definition: LeafCandidate.h:27
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
Definition: Candidate.h:39