CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CompositePtrCandidate.h
Go to the documentation of this file.
1 #ifndef Candidate_CompositePtrCandidate_h
2 #define Candidate_CompositePtrCandidate_h
16 
17 namespace reco {
18 
20  public:
22  typedef std::vector<CandidatePtr> daughters;
24  typedef std::vector<CandidatePtr> mothers;
28  CompositePtrCandidate( Charge q, const LorentzVector & 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  CompositePtrCandidate( Charge q, const PolarLorentzVector & p4, const Point & vtx = Point( 0, 0, 0 ),
33  int pdgId = 0, int status = 0, bool integerCharge = true ) :
34  LeafCandidate( q, p4, vtx, pdgId, status, integerCharge ) { }
36  explicit CompositePtrCandidate( const Candidate & p ) : LeafCandidate( p ) { }
38  virtual ~CompositePtrCandidate();
40  virtual CompositePtrCandidate * clone() const;
42  virtual const_iterator begin() const;
44  virtual const_iterator end() const;
46  virtual iterator begin();
48  virtual iterator end();
50  virtual size_t numberOfDaughters() const;
52  virtual size_t numberOfMothers() const;
54  virtual const Candidate * daughter( size_type ) const;
55  using reco::LeafCandidate::daughter; // avoid hiding the base
57  virtual Candidate * daughter( size_type );
59  void addDaughter( const CandidatePtr & );
61  void clearDaughters() { dau.clear(); }
63  CandidatePtr daughterPtr( size_type i ) const { return dau[ i ]; }
65  const daughters & daughterPtrVector() const { return dau; }
67  virtual const Candidate * mother( size_t i = 0 ) const;
72  virtual size_type numberOfSourceCandidatePtrs() const ;
77  virtual CandidatePtr sourceCandidatePtr( size_type i ) const;
78 
79  private:
87  virtual bool overlap( const Candidate & ) const;
88  };
89 
90  inline void CompositePtrCandidate::addDaughter( const CandidatePtr & cand ) {
91  dau.push_back( cand );
92  }
93 
94 }
95 
96 #endif
candidate::iterator_imp_specific_dummy< daughters > iterator_imp_specific
iterator implementation
int Charge
electric charge type
Definition: Candidate.h:39
int i
Definition: DBlmapReader.cc:9
virtual int pdgId() const
PDG identifier.
virtual double p() const
magnitude of momentum vector
CompositePtrCandidate()
default constructor
size_t size_type
Definition: Candidate.h:34
CandidatePtr daughterPtr(size_type i) const
reference to daughter at given position
candidate::const_iterator const_iterator
Definition: Candidate.h:35
virtual int status() const
status word
CompositePtrCandidate(Charge q, const LorentzVector &p4, const Point &vtx=Point(0, 0, 0), int pdgId=0, int status=0, bool integerCharge=true)
constructor from values
daughters dau
collection of references to daughters
virtual CompositePtrCandidate * clone() const
returns a clone of the candidate
virtual size_t numberOfDaughters() const
number of daughters
virtual const Candidate * daughter(size_type) const
return daughter at a given position (throws an exception)
virtual CandidatePtr sourceCandidatePtr(size_type i) const
CompositePtrCandidate(const Candidate &p)
constructor from a Candidate
virtual size_type numberOfSourceCandidatePtrs() const
CompositePtrCandidate(Charge q, const PolarLorentzVector &p4, const Point &vtx=Point(0, 0, 0), int pdgId=0, int status=0, bool integerCharge=true)
constructor from values
candidate::const_iterator_imp_specific< daughters > const_iterator_imp_specific
const iterator implementation
virtual const Candidate * mother(size_t i=0) const
return pointer to mother
virtual ~CompositePtrCandidate()
destructor
std::vector< CandidatePtr > daughters
collection of references to daughters
candidate::iterator iterator
Definition: Candidate.h:36
virtual const_iterator begin() const
first daughter const_iterator
virtual bool overlap(const Candidate &) const
check overlap with another candidate
std::vector< CandidatePtr > mothers
collection of references to daughters
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:41
void clearDaughters()
clear daughter references
virtual size_t numberOfMothers() const
number of mothers
virtual const_iterator end() const
last daughter const_iterator
const daughters & daughterPtrVector() const
references to daughtes
void addDaughter(const CandidatePtr &)
add a daughter via a reference
math::XYZPoint Point
point in the space
Definition: Candidate.h:45
virtual const LorentzVector & p4() const
four-momentum Lorentz vector
virtual const Candidate * daughter(size_type) const
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode) ...
math::XYZPoint Point
point in the space
Definition: LeafCandidate.h:32
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
Definition: Candidate.h:43