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
15 namespace reco {
16 
18  public:
26  CompositeRefCandidate( 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  CompositeRefCandidate( 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 CompositeRefCandidate( const Candidate & p ) : LeafCandidate( p ) { }
36  virtual ~CompositeRefCandidate();
38  virtual CompositeRefCandidate * clone() const;
40  virtual size_t numberOfDaughters() const;
42  virtual const Candidate * daughter( size_type ) const;
44  virtual Candidate * daughter( size_type );
45  using reco::LeafCandidate::daughter; // avoid hiding the base
47  void addDaughter( const CandidateRef & );
49  void addMother( const CandidateRef & );
51  void clearDaughters() { dau.clear(); }
53  CandidateRef daughterRef( size_type i ) const { return dau[ i ]; }
55  const daughters & daughterRefVector() const { return dau; }
57  CandidateRef motherRef( size_type i = 0 ) const { return mom[ i ]; }
59  const mothers & motherRefVector() const { return mom; }
61  void resetDaughters( const edm::ProductID & id ) { dau = daughters( id ); }
63  virtual size_t numberOfMothers() const;
65  virtual const Candidate * mother( size_t i = 0 ) const;
66 
67  private:
73  virtual bool overlap( const Candidate & ) const;
74  };
75 
76  inline void CompositeRefCandidate::addDaughter( const CandidateRef & cand ) {
77  dau.push_back( cand );
78  }
79 
80  inline void CompositeRefCandidate::addMother( const CandidateRef & cand ) {
81  mom.push_back( cand );
82  }
83 }
84 
85 #endif
int Charge
electric charge type
Definition: Candidate.h:35
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:30
CandidateRef daughterRef(size_type i) const
reference to daughter at given position
virtual CompositeRefCandidate * clone() const
returns a clone of the candidate
void addDaughter(const CandidateRef &)
add a daughter via a reference
const mothers & motherRefVector() const
references to mothers
virtual int status() const final
status word
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
void clear()
Clear the vector.
Definition: RefVector.h:147
void resetDaughters(const edm::ProductID &id)
set daughters product ID
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:37
virtual double p() const final
magnitude of momentum vector
virtual int pdgId() const final
PDG identifier.
virtual size_t numberOfDaughters() const
number of daughters
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<C, T> to the RefVector.
Definition: RefVector.h:69
math::XYZPoint Point
point in the space
Definition: Candidate.h:41
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
CandidateRef motherRef(size_type i=0) const
reference to mother at given position
virtual const LorentzVector & p4() const final
four-momentum Lorentz vector
Definition: LeafCandidate.h:99
math::XYZPoint Point
point in the space
Definition: LeafCandidate.h:27
CompositeRefCandidate()
default constructor
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
Definition: Candidate.h:39