CMS 3D CMS Logo

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