CMS 3D CMS Logo

GenParticle.h
Go to the documentation of this file.
1 #ifndef HepMCCandidate_GenParticle_h
2 #define HepMCCandidate_GenParticle_h
3 
13 #include <vector>
14 
15 namespace HepMC {
16  class GenParticle;
17 }
18 
19 namespace reco {
20 
21  class GenParticle : public CompositeRefCandidateT<GenParticleRefVector> {
22  public:
28  GenParticle(Charge q, const LorentzVector &p4, const Point &vtx, int pdgId, int status, bool integerCharge);
30  GenParticle(Charge q, const PolarLorentzVector &p4, const Point &vtx, int pdgId, int status, bool integerCharge);
32  ~GenParticle() override;
34  GenParticle *clone() const override;
35  void setCollisionId(int s) { collisionId_ = s; }
36  int collisionId() const { return collisionId_; }
37 
38  const GenStatusFlags &statusFlags() const { return statusFlags_; }
40 
42  //basic set of gen status flags accessible directly here
43  //the rest accessible through statusFlags()
44  //(see GenStatusFlags.h for their meaning)
45 
47  //these are robust, generator-independent functions for categorizing
48  //mainly final state particles, but also intermediate hadrons/taus
49 
50  //is particle prompt (not from hadron, muon, or tau decay) and final state
51  bool isPromptFinalState() const { return status() == 1 && statusFlags_.isPrompt(); }
52 
53  //is particle prompt (not from hadron, muon, or tau decay) and decayed
54  //such as a prompt tau
56 
57  //this particle is a direct decay product of a prompt tau and is final state
58  //(eg an electron or muon from a leptonic decay of a prompt tau)
61  }
62 
64  //these are generator history-dependent functions for tagging particles
65  //associated with the hard process
66  //Currently implemented for Pythia 6 and Pythia 8 status codes and history
67  //and may not have 100% consistent meaning across all types of processes
68  //Users are strongly encouraged to stick to the more robust flags above,
69  //as well as the expanded set available in GenStatusFlags.h
70 
71  //this particle is part of the hard process
72  bool isHardProcess() const { return statusFlags_.isHardProcess(); }
73 
74  //this particle is the final state direct descendant of a hard process particle
75  bool fromHardProcessFinalState() const { return status() == 1 && statusFlags_.fromHardProcess(); }
76 
77  //this particle is the decayed direct descendant of a hard process particle
78  //such as a tau from the hard process
79  bool fromHardProcessDecayed() const {
81  }
82 
83  //this particle is a direct decay product of a hardprocess tau and is final state
84  //(eg an electron or muon from a leptonic decay of a tau from the hard process)
87  }
88 
89  //this particle is the direct descendant of a hard process particle of the same pdg id.
90  //For outgoing particles the kinematics are those before QCD or QED FSR
91  //This corresponds roughly to status code 3 in pythia 6
92  //This is the most complex and error prone of all the flags and you are strongly encouraged
93  //to consider using the others to fill your needs.
95 
96  //provided for convenience. Use this one if you were using status 3 before and didn't know or care what it exactly meant
98 
99  //this particle is the last copy of the particle in the chain with the same pdg id
100  //(and therefore is more likely, but not guaranteed, to carry the final physical momentum)
101  bool isLastCopy() const { return statusFlags_.isLastCopy(); }
102 
103  //this particle is the last copy of the particle in the chain with the same pdg id
104  //before QED or QCD FSR
105  //(and therefore is more likely, but not guaranteed, to carry the momentum after ISR)
107 
108  private:
110  bool overlap(const Candidate &) const override;
113  };
114 
115 } // namespace reco
116 
117 #endif
reco::GenParticle::fromHardProcessDecayed
bool fromHardProcessDecayed() const
Definition: GenParticle.h:79
reco::GenParticle::statusFlags_
GenStatusFlags statusFlags_
Definition: GenParticle.h:112
reco::GenParticle::clone
GenParticle * clone() const override
return a clone
reco::GenParticle::collisionId
int collisionId() const
Definition: GenParticle.h:36
reco::LeafCandidate::status
int status() const final
status word
Definition: LeafCandidate.h:180
reco::GenParticle::isLastCopy
bool isLastCopy() const
Definition: GenParticle.h:101
CompositeRefCandidateT.h
data-class-funcs.q
q
Definition: data-class-funcs.py:169
reco::GenStatusFlags::isDirectPromptTauDecayProduct
bool isDirectPromptTauDecayProduct() const
Definition: GenStatusFlags.h:62
reco::GenParticle::fromHardProcessBeforeFSR
bool fromHardProcessBeforeFSR() const
Definition: GenParticle.h:94
reco::GenParticle::isLastCopyBeforeFSR
bool isLastCopyBeforeFSR() const
Definition: GenParticle.h:106
reco::GenStatusFlags::isHardProcess
bool isHardProcess() const
Definition: GenStatusFlags.h:77
edm::RefVector< GenParticleCollection >
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
GenParticle
Definition: GenParticle.py:1
GenStatusFlags.h
reco::GenParticle::setCollisionId
void setCollisionId(int s)
Definition: GenParticle.h:35
reco::GenParticle::~GenParticle
~GenParticle() override
destructor
alignCSCRings.s
s
Definition: alignCSCRings.py:92
reco::CompositeRefCandidateT
Definition: CompositeRefCandidateT.h:19
reco::GenParticle::statusFlags
GenStatusFlags & statusFlags()
Definition: GenParticle.h:39
reco::GenParticle::overlap
bool overlap(const Candidate &) const override
checp overlap with another candidate
reco::LeafCandidate::PolarLorentzVector
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
Definition: LeafCandidate.h:25
GenParticleFwd.h
reco::LeafCandidate::Charge
int Charge
electric charge type
Definition: LeafCandidate.h:21
reco::GenParticle::isHardProcess
bool isHardProcess() const
Definition: GenParticle.h:72
badGlobalMuonTaggersAOD_cff.vtx
vtx
Definition: badGlobalMuonTaggersAOD_cff.py:5
reco::GenParticle::isDirectHardProcessTauDecayProductFinalState
bool isDirectHardProcessTauDecayProductFinalState() const
Definition: GenParticle.h:85
Point
Structure Point Contains parameters of Gaussian fits to DMRs.
Definition: DMRtrends.cc:57
reco::LeafCandidate::pdgId
int pdgId() const final
PDG identifier.
Definition: LeafCandidate.h:176
reco::GenParticle::statusFlags
const GenStatusFlags & statusFlags() const
Definition: GenParticle.h:38
reco::GenStatusFlags
Definition: GenStatusFlags.h:15
reco::GenParticle::isDirectPromptTauDecayProductFinalState
bool isDirectPromptTauDecayProductFinalState() const
Definition: GenParticle.h:59
reco::LeafCandidate::p4
const LorentzVector & p4() const final
four-momentum Lorentz vector
Definition: LeafCandidate.h:114
reco::GenStatusFlags::isLastCopyBeforeFSR
bool isLastCopyBeforeFSR() const
Definition: GenStatusFlags.h:112
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
reco::Candidate
Definition: Candidate.h:27
reco::GenStatusFlags::isLastCopy
bool isLastCopy() const
Definition: GenStatusFlags.h:106
reco::GenStatusFlags::isPrompt
bool isPrompt() const
Definition: GenStatusFlags.h:39
reco::GenStatusFlags::isDecayedLeptonHadron
bool isDecayedLeptonHadron() const
Definition: GenStatusFlags.h:46
LorentzVector
math::XYZTLorentzVector LorentzVector
Definition: HLTMuonMatchAndPlot.h:49
HepMC
Definition: GenParticle.h:15
reco::GenParticle::isMostlyLikePythia6Status3
bool isMostlyLikePythia6Status3()
Definition: GenParticle.h:97
reco::GenStatusFlags::fromHardProcess
bool fromHardProcess() const
Definition: GenStatusFlags.h:81
reco::GenParticle::collisionId_
int collisionId_
Definition: GenParticle.h:111
reco::GenStatusFlags::isDirectHardProcessTauDecayProduct
bool isDirectHardProcessTauDecayProduct() const
Definition: GenStatusFlags.h:91
reco::LeafCandidate
Definition: LeafCandidate.h:16
reco::GenStatusFlags::fromHardProcessBeforeFSR
bool fromHardProcessBeforeFSR() const
Definition: GenStatusFlags.h:97
reco::GenParticle::fromHardProcessFinalState
bool fromHardProcessFinalState() const
Definition: GenParticle.h:75
reco::GenParticle::GenParticle
GenParticle()
default constructor
Definition: GenParticle.h:24
reco::GenParticle::isPromptDecayed
bool isPromptDecayed() const
Definition: GenParticle.h:55
reco::GenParticle::isPromptFinalState
bool isPromptFinalState() const
Definition: GenParticle.h:51
reco::GenParticle::GenParticle
GenParticle(const LeafCandidate &c)
default constructor
Definition: GenParticle.h:26