test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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:
29  GenParticle(Charge q, const LorentzVector & p4, const Point & vtx,
30  int pdgId, int status, bool integerCharge);
32  GenParticle(Charge q, const PolarLorentzVector & p4, const Point & vtx,
33  int pdgId, int status, bool integerCharge);
35  virtual ~GenParticle();
37  GenParticle * clone() const;
38  void setCollisionId(int s) {collisionId_ = s;}
39  int collisionId() const {return collisionId_;}
40 
41  const GenStatusFlags &statusFlags() const { return statusFlags_; }
43 
45  //basic set of gen status flags accessible directly here
46  //the rest accessible through statusFlags()
47  //(see GenStatusFlags.h for their meaning)
48 
50  //these are robust, generator-independent functions for categorizing
51  //mainly final state particles, but also intermediate hadrons/taus
52 
53  //is particle prompt (not from hadron, muon, or tau decay) and final state
54  bool isPromptFinalState() const { return status()==1 && statusFlags_.isPrompt(); }
55 
56  //is particle prompt (not from hadron, muon, or tau decay) and decayed
57  //such as a prompt tau
59 
60  //this particle is a direct decay product of a prompt tau and is final state
61  //(eg an electron or muon from a leptonic decay of a prompt tau)
63 
65  //these are generator history-dependent functions for tagging particles
66  //associated with the hard process
67  //Currently implemented for Pythia 6 and Pythia 8 status codes and history
68  //and may not have 100% consistent meaning across all types of processes
69  //Users are strongly encouraged to stick to the more robust flags above,
70  //as well as the expanded set available in GenStatusFlags.h
71 
72  //this particle is part of the hard process
73  bool isHardProcess() const { return statusFlags_.isHardProcess(); }
74 
75  //this particle is the final state direct descendant of a hard process particle
76  bool fromHardProcessFinalState() const { return status()==1 && statusFlags_.fromHardProcess(); }
77 
78  //this particle is the decayed direct descendant of a hard process particle
79  //such as a tau from the hard process
81 
82  //this particle is a direct decay product of a hardprocess tau and is final state
83  //(eg an electron or muon from a leptonic decay of a tau from the hard process)
85 
86  //this particle is the direct descendant of a hard process particle of the same pdg id.
87  //For outgoing particles the kinematics are those before QCD or QED FSR
88  //This corresponds roughly to status code 3 in pythia 6
89  //This is the most complex and error prone of all the flags and you are strongly encouraged
90  //to consider using the others to fill your needs.
92 
93  //provided for convenience. Use this one if you were using status 3 before and didn't know or care what it exactly meant
95 
96  //this particle is the last copy of the particle in the chain with the same pdg id
97  //(and therefore is more likely, but not guaranteed, to carry the final physical momentum)
98  bool isLastCopy() const { return statusFlags_.isLastCopy(); }
99 
100  //this particle is the last copy of the particle in the chain with the same pdg id
101  //before QED or QCD FSR
102  //(and therefore is more likely, but not guaranteed, to carry the momentum after ISR)
104 
105  private:
107  bool overlap(const Candidate &) const;
110  };
111 
112 }
113 
114 #endif
bool isPromptFinalState() const
Definition: GenParticle.h:54
bool isPrompt() const
bool isLastCopyBeforeFSR() const
Definition: GenParticle.h:103
void setCollisionId(int s)
Definition: GenParticle.h:38
bool isHardProcess() const
bool isDirectHardProcessTauDecayProductFinalState() const
Definition: GenParticle.h:84
bool isLastCopy() const
Definition: GenParticle.h:98
bool isDecayedLeptonHadron() const
bool isDirectPromptTauDecayProduct() const
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
Definition: LeafCandidate.h:25
math::XYZTLorentzVector LorentzVector
bool isDirectHardProcessTauDecayProduct() const
bool isHardProcess() const
Definition: GenParticle.h:73
bool fromHardProcessBeforeFSR() const
Definition: GenParticle.h:91
bool fromHardProcessBeforeFSR() const
int collisionId() const
Definition: GenParticle.h:39
GenStatusFlags statusFlags_
Definition: GenParticle.h:109
bool fromHardProcess() const
GenParticle()
default constructor
Definition: GenParticle.h:24
bool overlap(const Candidate &) const
checp overlap with another candidate
virtual int status() const final
status word
bool isMostlyLikePythia6Status3()
Definition: GenParticle.h:94
bool isLastCopy() const
GenStatusFlags & statusFlags()
Definition: GenParticle.h:42
math::XYZPoint Point
GenParticle * clone() const
return a clone
bool isLastCopyBeforeFSR() const
bool isPromptDecayed() const
Definition: GenParticle.h:58
GenParticle(const LeafCandidate &c)
default constructor
Definition: GenParticle.h:26
const GenStatusFlags & statusFlags() const
Definition: GenParticle.h:41
bool fromHardProcessFinalState() const
Definition: GenParticle.h:76
virtual int pdgId() const final
PDG identifier.
bool isDirectPromptTauDecayProductFinalState() const
Definition: GenParticle.h:62
bool fromHardProcessDecayed() const
Definition: GenParticle.h:80
virtual const LorentzVector & p4() const final
four-momentum Lorentz vector
Definition: LeafCandidate.h:99
int Charge
electric charge type
Definition: LeafCandidate.h:21
virtual ~GenParticle()
destructor