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
15 namespace reco {
16 
18  public:
20  typedef std::vector<CandidatePtr> daughters;
22  typedef std::vector<CandidatePtr> mothers;
26  CompositePtrCandidate( 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  CompositePtrCandidate( 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 CompositePtrCandidate( const Candidate & p ) : LeafCandidate( p ) { }
36  virtual ~CompositePtrCandidate();
38  virtual CompositePtrCandidate * clone() const;
40  virtual size_t numberOfDaughters() const;
42  virtual size_t numberOfMothers() const;
44  virtual const Candidate * daughter( size_type ) const;
45  using reco::LeafCandidate::daughter; // avoid hiding the base
47  virtual Candidate * daughter( size_type );
49  void addDaughter( const CandidatePtr & );
51  void clearDaughters() { dau.clear(); }
53  CandidatePtr daughterPtr( size_type i ) const { return dau[ i ]; }
55  const daughters & daughterPtrVector() const { return dau; }
57  virtual const Candidate * mother( size_t i = 0 ) const;
62  virtual size_type numberOfSourceCandidatePtrs() const ;
67  virtual CandidatePtr sourceCandidatePtr( size_type i ) const;
68 
69  private:
73  virtual bool overlap( const Candidate & ) const;
74  };
75 
76  inline void CompositePtrCandidate::addDaughter( const CandidatePtr & cand ) {
77  dau.push_back( cand );
78  }
79 
80 }
81 
82 #endif
int Charge
electric charge type
Definition: Candidate.h:35
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:30
CandidatePtr daughterPtr(size_type i) const
reference to daughter at given position
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
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
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:37
void clearDaughters()
clear daughter references
virtual size_t numberOfMothers() const
number of mothers
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:41
virtual const LorentzVector & p4() const
four-momentum Lorentz vector
Definition: LeafCandidate.h:99
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:27
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
Definition: Candidate.h:39