CMS 3D CMS Logo

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  enum StatusBits {
17  kIsPrompt = 0,
32  };
33 
35  //these are robust, generator-independent functions for categorizing
36  //mainly final state particles, but also intermediate hadrons/taus
37 
38  //is particle prompt (not from hadron, muon, or tau decay)
39  bool isPrompt() const { return flags_[kIsPrompt]; }
40  void setIsPrompt(bool b) { flags_[kIsPrompt] = b; }
41 
42  //is particle a decayed hadron, muon, or tau (does not include resonance decays like W,Z,Higgs,top,etc)
43  //This flag is equivalent to status 2 in the current HepMC standard
44  //but older generators (pythia6, herwig6) predate this and use status 2 also for other intermediate
45  //particles/states
48 
49  //this particle is a direct or indirect tau decay product
50  bool isTauDecayProduct() const { return flags_[kIsTauDecayProduct]; }
52 
53  //this particle is a direct or indirect decay product of a prompt tau
56 
57  //this particle is a direct tau decay product
60 
61  //this particle is a direct decay product from a prompt tau
64 
65  //this particle is a direct decay product from a hadron
68 
70  //these are generator history-dependent functions for tagging particles
71  //associated with the hard process
72  //Currently implemented for Pythia 6 and Pythia 8 status codes and history
73  //and may not have 100% consistent meaning across all types of processes
74  //Users are strongly encouraged to stick to the more robust flags above
75 
76  //this particle is part of the hard process
77  bool isHardProcess() const { return flags_[kIsHardProcess]; }
79 
80  //this particle is the direct descendant of a hard process particle of the same pdg id
81  bool fromHardProcess() const { return flags_[kFromHardProcess]; }
83 
84  //this particle is a direct or indirect decay product of a tau
85  //from the hard process
88 
89  //this particle is a direct decay product of a tau
90  //from the hard process
93 
94  //this particle is the direct descendant of a hard process particle of the same pdg id
95  //For outgoing particles the kinematics are those before QCD or QED FSR
96  //This corresponds roughly to status code 3 in pythia 6
99 
100  //this particle is the first copy of the particle in the chain with the same pdg id
101  bool isFirstCopy() const { return flags_[kIsFirstCopy]; }
102  void setIsFirstCopy(bool b) { flags_[kIsFirstCopy] = b; }
103 
104  //this particle is the last copy of the particle in the chain with the same pdg id
105  //(and therefore is more likely, but not guaranteed, to carry the final physical momentum)
106  bool isLastCopy() const { return flags_[kIsLastCopy]; }
107  void setIsLastCopy(bool b) { flags_[kIsLastCopy] = b; }
108 
109  //this particle is the last copy of the particle in the chain with the same pdg id
110  //before QED or QCD FSR
111  //(and therefore is more likely, but not guaranteed, to carry the momentum after ISR)
114 
115  std::bitset<15> flags_;
116  };
117 
118 } // namespace reco
119 
120 #endif
bool fromHardProcess() const
bool isDirectHardProcessTauDecayProduct() const
bool isHardProcess() const
bool isDirectHadronDecayProduct() const
bool isFirstCopy() const
bool isDirectPromptTauDecayProduct() const
void setIsLastCopyBeforeFSR(bool b)
void setIsPrompt(bool b)
void setIsTauDecayProduct(bool b)
void setIsDirectPromptTauDecayProduct(bool b)
void setIsDirectHadronDecayProduct(bool b)
void setIsDirectHardProcessTauDecayProduct(bool b)
void setIsHardProcess(bool b)
bool isPromptTauDecayProduct() const
void setIsHardProcessTauDecayProduct(bool b)
bool isPrompt() const
bool isLastCopy() const
void setFromHardProcess(bool b)
void setIsPromptTauDecayProduct(bool b)
void setIsDecayedLeptonHadron(bool b)
void setIsFirstCopy(bool b)
double b
Definition: hdecay.h:120
std::bitset< 15 > flags_
bool isDecayedLeptonHadron() const
bool isTauDecayProduct() const
fixed size matrix
bool isLastCopyBeforeFSR() const
bool isHardProcessTauDecayProduct() const
void setIsDirectTauDecayProduct(bool b)
void setFromHardProcessBeforeFSR(bool b)
bool fromHardProcessBeforeFSR() const
void setIsLastCopy(bool b)
bool isDirectTauDecayProduct() const