CMS 3D CMS Logo

ShallowClonePtrCandidate.h
Go to the documentation of this file.
1 #ifndef Candidate_ShallowClonePtrCandidate_h
2 #define Candidate_ShallowClonePtrCandidate_h
3 
13 
14 namespace reco {
16  public:
23  LeafCandidate( * masterClone ),
24  masterClone_( masterClone ) {
25  }
28  Charge q, const LorentzVector & p4, const Point & vtx = Point( 0, 0, 0 ) ) :
29  LeafCandidate( q, p4, vtx ), masterClone_( masterClone ) { }
31  ShallowClonePtrCandidate( const CandidatePtr & masterClone,
32  Charge q, const PolarLorentzVector & p4, const Point & vtx = Point( 0, 0, 0 ) ) :
33  LeafCandidate( q, p4, vtx ), masterClone_( masterClone ) { }
35  ~ShallowClonePtrCandidate() override;
37  ShallowClonePtrCandidate * clone() const override;
39  size_t numberOfDaughters() const override;
41  size_t numberOfMothers() const override;
43  const Candidate * daughter( size_type i ) const override;
45  const Candidate * mother( size_type i ) const override;
47  Candidate * daughter( size_type i ) override;
48  using reco::LeafCandidate::daughter; // avoid hiding the base
50  bool hasMasterClonePtr() const override;
52  const CandidatePtr & masterClonePtr() const override;
53 
54 
55  bool isElectron() const override;
56  bool isMuon() const override;
57  bool isGlobalMuon() const override;
58  bool isStandAloneMuon() const override;
59  bool isTrackerMuon() const override;
60  bool isCaloMuon() const override;
61  bool isPhoton() const override;
62  bool isConvertedPhoton() const override;
63  bool isJet() const override;
64  private:
66  bool overlap( const Candidate & c ) const override { return masterClone_->overlap( c ); }
69  };
70 
71 }
72 
73 #endif
int Charge
electric charge type
Definition: Candidate.h:35
size_t size_type
Definition: Candidate.h:30
bool overlap(const Candidate &c) const override
check overlap with another Candidate
CandidatePtr masterClone_
CandidatePtrerence to master clone.
ShallowClonePtrCandidate(const CandidatePtr &masterClone, Charge q, const PolarLorentzVector &p4, const Point &vtx=Point(0, 0, 0))
constructor from values
const Candidate * mother(size_type i) const override
return mother at a given position (throws an exception)
ShallowClonePtrCandidate(const CandidatePtr &masterClone)
constructor from Particle
ShallowClonePtrCandidate * clone() const override
returns a clone of the Candidate object
size_t numberOfMothers() const override
number of mothers
ShallowClonePtrCandidate()
default constructor
size_t numberOfDaughters() const override
number of daughters
CandidateCollection daughters
collection of daughter candidates
const LorentzVector & p4() const final
four-momentum Lorentz vector
Definition: LeafCandidate.h:99
const CandidatePtr & masterClonePtr() const override
returns reference to master clone pointer
const Candidate * daughter(size_type) const override
return daughter at a given position (throws an exception)
const CandidateBaseRef & masterClone() const override
Definition: LeafCandidate.cc:7
~ShallowClonePtrCandidate() override
destructor
ShallowClonePtrCandidate(const CandidatePtr &masterClone, Charge q, const LorentzVector &p4, const Point &vtx=Point(0, 0, 0))
constructor from values
bool hasMasterClonePtr() const override
has master clone pointer
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:37
fixed size matrix
math::XYZPoint Point
point in the space
Definition: Candidate.h:41
const Candidate * daughter(size_type i) const override
return daughter at a given position (throws an exception)
math::XYZPoint Point
point in the space
Definition: LeafCandidate.h:27
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
Definition: Candidate.h:39