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
17 
18 namespace reco {
19 
21  public:
29  CompositeRefCandidate( 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  CompositeRefCandidate( 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 CompositeRefCandidate( const Candidate & p ) : LeafCandidate( p ) { }
39  virtual ~CompositeRefCandidate();
41  virtual CompositeRefCandidate * 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 const Candidate * daughter( size_type ) const;
55  virtual Candidate * daughter( size_type );
56  using reco::LeafCandidate::daughter; // avoid hiding the base
58  void addDaughter( const CandidateRef & );
60  void addMother( const CandidateRef & );
62  void clearDaughters() { dau.clear(); }
64  CandidateRef daughterRef( size_type i ) const { return dau[ i ]; }
66  const daughters & daughterRefVector() const { return dau; }
68  CandidateRef motherRef( size_type i = 0 ) const { return mom[ i ]; }
70  const mothers & motherRefVector() const { return mom; }
72  void resetDaughters( const edm::ProductID & id ) { dau = daughters( id ); }
74  virtual size_t numberOfMothers() const;
76  virtual const Candidate * mother( size_t i = 0 ) const;
77 
78  private:
88  virtual bool overlap( const Candidate & ) const;
89  };
90 
91  inline void CompositeRefCandidate::addDaughter( const CandidateRef & cand ) {
92  dau.push_back( cand );
93  }
94 
95  inline void CompositeRefCandidate::addMother( const CandidateRef & cand ) {
96  mom.push_back( cand );
97  }
98 }
99 
100 #endif
int Charge
electric charge type
Definition: Candidate.h:36
int i
Definition: DBlmapReader.cc:9
virtual int pdgId() const
PDG identifier.
virtual double p() const
magnitude of momentum vector
void clearDaughters()
clear daughter references
CandidateRefVector mothers
collection of references to daughters
size_t size_type
Definition: Candidate.h:31
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:32
virtual CompositeRefCandidate * clone() const
returns a clone of the candidate
virtual int status() const
status word
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 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:33
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:38
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:42
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 const LorentzVector & p4() const
four-momentum Lorentz vector
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:29
CompositeRefCandidate()
default constructor
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
Definition: Candidate.h:40