CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
bool isPromptFinalState() const
Definition: GenParticle.h:51
bool isPrompt() const
const edm::EventSetup & c
bool isLastCopyBeforeFSR() const
Definition: GenParticle.h:106
void setCollisionId(int s)
Definition: GenParticle.h:35
bool isHardProcess() const
bool isDirectHardProcessTauDecayProductFinalState() const
Definition: GenParticle.h:85
bool isLastCopy() const
Definition: GenParticle.h:101
bool isDecayedLeptonHadron() const
bool isDirectPromptTauDecayProduct() const
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
Definition: LeafCandidate.h:25
bool isDirectHardProcessTauDecayProduct() const
bool isHardProcess() const
Definition: GenParticle.h:72
int status() const final
status word
bool fromHardProcessBeforeFSR() const
Definition: GenParticle.h:94
bool fromHardProcessBeforeFSR() const
int collisionId() const
Definition: GenParticle.h:36
GenStatusFlags statusFlags_
Definition: GenParticle.h:112
const LorentzVector & p4() const final
four-momentum Lorentz vector
bool fromHardProcess() const
GenParticle()
default constructor
Definition: GenParticle.h:24
int pdgId() const final
PDG identifier.
~GenParticle() override
destructor
bool isMostlyLikePythia6Status3()
Definition: GenParticle.h:97
bool isLastCopy() const
GenStatusFlags & statusFlags()
Definition: GenParticle.h:39
math::XYZTLorentzVector LorentzVector
bool isLastCopyBeforeFSR() const
bool isPromptDecayed() const
Definition: GenParticle.h:55
GenParticle(const LeafCandidate &c)
default constructor
Definition: GenParticle.h:26
const GenStatusFlags & statusFlags() const
Definition: GenParticle.h:38
bool fromHardProcessFinalState() const
Definition: GenParticle.h:75
GenParticle * clone() const override
return a clone
Structure Point Contains parameters of Gaussian fits to DMRs.
Definition: DMRtrends.cc:57
bool isDirectPromptTauDecayProductFinalState() const
Definition: GenParticle.h:59
bool overlap(const Candidate &) const override
checp overlap with another candidate
bool fromHardProcessDecayed() const
Definition: GenParticle.h:79
int Charge
electric charge type
Definition: LeafCandidate.h:21