CMS 3D CMS Logo

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  ~CompositePtrCandidate() override;
38  CompositePtrCandidate * clone() const override;
40  size_t numberOfDaughters() const override;
42  size_t numberOfMothers() const override;
44  const Candidate * daughter( size_type ) const override;
45  using reco::LeafCandidate::daughter; // avoid hiding the base
47  Candidate * daughter( size_type ) override;
49  void addDaughter( const CandidatePtr & );
51  virtual void clearDaughters() { dau.clear(); }
53  virtual CandidatePtr daughterPtr( size_type i ) const { return dau[ i ]; }
55  virtual const daughters & daughterPtrVector() const { return dau; }
57  const Candidate * mother( size_t i = 0 ) const override;
62  size_type numberOfSourceCandidatePtrs() const override ;
67  CandidatePtr sourceCandidatePtr( size_type i ) const override;
68 
69  private:
71  daughters dau;
73  bool overlap( const Candidate & ) const override;
74  };
75 
77  dau.push_back( cand );
78  }
79 
80 }
81 
82 #endif
bool overlap(const Candidate &) const override
check overlap with another candidate
int pdgId() const final
PDG identifier.
int Charge
electric charge type
Definition: Candidate.h:35
CompositePtrCandidate()
default constructor
size_t size_type
Definition: Candidate.h:30
size_type numberOfSourceCandidatePtrs() const override
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
virtual const daughters & daughterPtrVector() const
references to daughtes
size_t numberOfDaughters() const override
number of daughters
daughters dau
collection of references to daughters
~CompositePtrCandidate() override
destructor
CompositePtrCandidate(const Candidate &p)
constructor from a Candidate
const LorentzVector & p4() const final
four-momentum Lorentz vector
Definition: LeafCandidate.h:99
const Candidate * mother(size_t i=0) const override
return pointer to mother
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 void clearDaughters()
clear daughter references
std::vector< CandidatePtr > daughters
collection of references to daughters
double p() const final
magnitude of momentum vector
const Candidate * daughter(size_type) const override
return daughter at a given position (throws an exception)
const Candidate * daughter(size_type) const override
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode) ...
virtual CandidatePtr daughterPtr(size_type i) const
reference to daughter at given position
std::vector< CandidatePtr > mothers
collection of references to daughters
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:37
CompositePtrCandidate * clone() const override
returns a clone of the candidate
fixed size matrix
Structure Point Contains parameters of Gaussian fits to DMRs.
Definition: DMRtrends.cc:55
CandidatePtr sourceCandidatePtr(size_type i) const override
int status() const final
status word
void addDaughter(const CandidatePtr &)
add a daughter via a reference
size_t numberOfMothers() const override
number of mothers
math::XYZPoint Point
point in the space
Definition: LeafCandidate.h:27
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
Definition: Candidate.h:39