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
17 
18 namespace reco {
19 
21  public:
23  typedef std::vector<CandidatePtr> daughters;
25  typedef std::vector<CandidatePtr> mothers;
29  CompositePtrCandidate( Charge q, const LorentzVector & 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  CompositePtrCandidate( Charge q, const PolarLorentzVector & p4, const Point & vtx = Point( 0, 0, 0 ),
34  int pdgId = 0, int status = 0, bool integerCharge = true ) :
35  LeafCandidate( q, p4, vtx, pdgId, status, integerCharge ) { }
37  explicit CompositePtrCandidate( const Candidate & p ) : LeafCandidate( p ) { }
39  virtual ~CompositePtrCandidate();
41  virtual CompositePtrCandidate * clone() const;
43  virtual const_iterator begin() const;
45  virtual const_iterator end() const;
47  virtual iterator begin();
49  virtual iterator end();
51  virtual size_t numberOfDaughters() const;
53  virtual size_t numberOfMothers() const;
55  virtual const Candidate * daughter( size_type ) const;
56  using reco::LeafCandidate::daughter; // avoid hiding the base
58  virtual Candidate * daughter( size_type );
60  void addDaughter( const CandidatePtr & );
62  void clearDaughters() { dau.clear(); }
64  CandidatePtr daughterPtr( size_type i ) const { return dau[ i ]; }
66  const daughters & daughterPtrVector() const { return dau; }
68  virtual const Candidate * mother( size_t i = 0 ) const;
73  virtual size_type numberOfSourceCandidatePtrs() const ;
78  virtual CandidatePtr sourceCandidatePtr( size_type i ) const;
79 
80  private:
88  virtual bool overlap( const Candidate & ) const;
89  };
90 
91  inline void CompositePtrCandidate::addDaughter( const CandidatePtr & cand ) {
92  dau.push_back( cand );
93  }
94 
95 }
96 
97 #endif
candidate::iterator_imp_specific_dummy< daughters > iterator_imp_specific
iterator implementation
int Charge
electric charge type
Definition: Candidate.h:37
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:32
CandidatePtr daughterPtr(size_type i) const
reference to daughter at given position
candidate::const_iterator const_iterator
Definition: Candidate.h:33
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:34
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:39
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:43
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:29
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
Definition: Candidate.h:41