test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
GenStatusFlags.h
Go to the documentation of this file.
1 #ifndef HepMCCandidate_GenStatusFlags_h
2 #define HepMCCandidate_GenStatusFlags_h
3 
11 #include <bitset>
12 
13 namespace reco {
14 
15  struct GenStatusFlags {
16 
17  enum StatusBits {
18  kIsPrompt = 0,
33  };
34 
36  //these are robust, generator-independent functions for categorizing
37  //mainly final state particles, but also intermediate hadrons/taus
38 
39  //is particle prompt (not from hadron, muon, or tau decay)
40  bool isPrompt() const { return flags_[kIsPrompt]; }
41  void setIsPrompt(bool b) { flags_[kIsPrompt] = b; }
42 
43  //is particle a decayed hadron, muon, or tau (does not include resonance decays like W,Z,Higgs,top,etc)
44  //This flag is equivalent to status 2 in the current HepMC standard
45  //but older generators (pythia6, herwig6) predate this and use status 2 also for other intermediate
46  //particles/states
49 
50  //this particle is a direct or indirect tau decay product
51  bool isTauDecayProduct() const { return flags_[kIsTauDecayProduct]; }
53 
54  //this particle is a direct or indirect decay product of a prompt tau
57 
58  //this particle is a direct tau decay product
61 
62  //this particle is a direct decay product from a prompt tau
65 
66  //this particle is a direct decay product from a hadron
69 
71  //these are generator history-dependent functions for tagging particles
72  //associated with the hard process
73  //Currently implemented for Pythia 6 and Pythia 8 status codes and history
74  //and may not have 100% consistent meaning across all types of processes
75  //Users are strongly encouraged to stick to the more robust flags above
76 
77  //this particle is part of the hard process
78  bool isHardProcess() const { return flags_[kIsHardProcess]; }
80 
81  //this particle is the direct descendant of a hard process particle of the same pdg id
82  bool fromHardProcess() const { return flags_[kFromHardProcess]; }
84 
85  //this particle is a direct or indirect decay product of a tau
86  //from the hard process
89 
90  //this particle is a direct decay product of a tau
91  //from the hard process
94 
95  //this particle is the direct descendant of a hard process particle of the same pdg id
96  //For outgoing particles the kinematics are those before QCD or QED FSR
97  //This corresponds roughly to status code 3 in pythia 6
100 
101  //this particle is the first copy of the particle in the chain with the same pdg id
102  bool isFirstCopy() const { return flags_[kIsFirstCopy]; }
103  void setIsFirstCopy(bool b) { flags_[kIsFirstCopy] = b; }
104 
105  //this particle is the last copy of the particle in the chain with the same pdg id
106  //(and therefore is more likely, but not guaranteed, to carry the final physical momentum)
107  bool isLastCopy() const { return flags_[kIsLastCopy]; }
108  void setIsLastCopy(bool b) { flags_[kIsLastCopy] = b; }
109 
110  //this particle is the last copy of the particle in the chain with the same pdg id
111  //before QED or QCD FSR
112  //(and therefore is more likely, but not guaranteed, to carry the momentum after ISR)
115 
116  std::bitset<15> flags_;
117  };
118 
119 }
120 
121 #endif
bool isPrompt() const
bool isHardProcess() const
bool isDecayedLeptonHadron() const
bool isDirectPromptTauDecayProduct() const
bool isDirectHardProcessTauDecayProduct() const
bool isFirstCopy() const
bool fromHardProcessBeforeFSR() const
void setIsLastCopyBeforeFSR(bool b)
void setIsPrompt(bool b)
void setIsTauDecayProduct(bool b)
void setIsDirectPromptTauDecayProduct(bool b)
bool fromHardProcess() const
void setIsDirectHadronDecayProduct(bool b)
void setIsDirectHardProcessTauDecayProduct(bool b)
void setIsHardProcess(bool b)
bool isLastCopy() const
bool isDirectTauDecayProduct() const
bool isDirectHadronDecayProduct() const
bool isHardProcessTauDecayProduct() const
void setIsHardProcessTauDecayProduct(bool b)
bool isLastCopyBeforeFSR() const
void setFromHardProcess(bool b)
bool isTauDecayProduct() const
void setIsPromptTauDecayProduct(bool b)
void setIsDecayedLeptonHadron(bool b)
bool isPromptTauDecayProduct() const
void setIsFirstCopy(bool b)
double b
Definition: hdecay.h:120
std::bitset< 15 > flags_
void setIsDirectTauDecayProduct(bool b)
void setFromHardProcessBeforeFSR(bool b)
void setIsLastCopy(bool b)