CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CompositeRefCandidate.h
Go to the documentation of this file.
1 #ifndef Candidate_CompositeRefCandidate_h
2 #define Candidate_CompositeRefCandidate_h
16 
17 namespace reco {
18 
20  public:
28  CompositeRefCandidate( 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  CompositeRefCandidate( 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 CompositeRefCandidate( const Candidate & p ) : LeafCandidate( p ) { }
38  virtual ~CompositeRefCandidate();
40  virtual CompositeRefCandidate * 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 const Candidate * daughter( size_type ) const;
54  virtual Candidate * daughter( size_type );
55  using reco::LeafCandidate::daughter; // avoid hiding the base
57  void addDaughter( const CandidateRef & );
59  void addMother( const CandidateRef & );
61  void clearDaughters() { dau.clear(); }
63  CandidateRef daughterRef( size_type i ) const { return dau[ i ]; }
65  const daughters & daughterRefVector() const { return dau; }
67  CandidateRef motherRef( size_type i = 0 ) const { return mom[ i ]; }
69  const mothers & motherRefVector() const { return mom; }
71  void resetDaughters( const edm::ProductID & id ) { dau = daughters( id ); }
73  virtual size_t numberOfMothers() const;
75  virtual const Candidate * mother( size_t i = 0 ) const;
76 
77  private:
87  virtual bool overlap( const Candidate & ) const;
88  };
89 
90  inline void CompositeRefCandidate::addDaughter( const CandidateRef & cand ) {
91  dau.push_back( cand );
92  }
93 
94  inline void CompositeRefCandidate::addMother( const CandidateRef & cand ) {
95  mom.push_back( cand );
96  }
97 }
98 
99 #endif
int Charge
electric charge type
Definition: Candidate.h:39
int i
Definition: DBlmapReader.cc:9
void clearDaughters()
clear daughter references
CandidateRefVector mothers
collection of references to daughters
size_t size_type
Definition: Candidate.h:34
virtual double p() const GCC11_FINAL
magnitude of momentum vector
virtual const LorentzVector & p4() const GCC11_FINAL
four-momentum Lorentz vector
virtual const_iterator begin() const
first daughter const_iterator
CandidateRef daughterRef(size_type i) const
reference to daughter at given position
candidate::const_iterator const_iterator
Definition: Candidate.h:35
virtual CompositeRefCandidate * clone() const
returns a clone of the candidate
virtual int pdgId() const GCC11_FINAL
PDG identifier.
void addDaughter(const CandidateRef &)
add a daughter via a reference
const mothers & motherRefVector() const
references to mothers
candidate::iterator_imp_specific_dummy< daughters > iterator_imp_specific
iterator implementation
virtual const Candidate * daughter(size_type) const
return daughter at a given position (throws an exception)
const daughters & daughterRefVector() const
references to daughtes
daughters dau
collection of references to daughters
virtual int status() const GCC11_FINAL
status word
virtual const Candidate * mother(size_t i=0) const
return pointer to mother
CompositeRefCandidate(const Candidate &p)
constructor from a candidate
daughters mom
collection of references to mothers
virtual size_t numberOfMothers() const
number of mothers (zero or one in most of but not all the cases)
CompositeRefCandidate(Charge q, const LorentzVector &p4, const Point &vtx=Point(0, 0, 0), int pdgId=0, int status=0, bool integerCharge=true)
constructor from values
void addMother(const CandidateRef &)
add a daughter via a reference
candidate::iterator iterator
Definition: Candidate.h:36
void clear()
Clear the vector.
Definition: RefVector.h:133
void resetDaughters(const edm::ProductID &id)
set daughters product ID
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:41
virtual size_t numberOfDaughters() const
number of daughters
virtual const_iterator end() const
last daughter const_iterator
virtual bool overlap(const Candidate &) const
check overlap with another candidate
CompositeRefCandidate(Charge q, const PolarLorentzVector &p4, const Point &vtx=Point(0, 0, 0), int pdgId=0, int status=0, bool integerCharge=true)
constructor from values
void push_back(value_type const &ref)
Add a Ref&lt;C, T&gt; to the RefVector.
Definition: RefVector.h:64
math::XYZPoint Point
point in the space
Definition: Candidate.h:45
CandidateRefVector daughters
collection of references to daughters
virtual const Candidate * daughter(size_type) const
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode) ...
virtual ~CompositeRefCandidate()
destructor
candidate::const_iterator_imp_specific< daughters > const_iterator_imp_specific
const iterator implementation
CandidateRef motherRef(size_type i=0) const
reference to mother at given position
math::XYZPoint Point
point in the space
Definition: LeafCandidate.h:32
CompositeRefCandidate()
default constructor
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
Definition: Candidate.h:43