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
reco::GenStatusFlags::isDirectHadronDecayProduct
bool isDirectHadronDecayProduct() const
Definition: GenStatusFlags.h:66
reco::GenStatusFlags::setIsDirectHadronDecayProduct
void setIsDirectHadronDecayProduct(bool b)
Definition: GenStatusFlags.h:67
reco::GenStatusFlags::kIsTauDecayProduct
Definition: GenStatusFlags.h:19
reco::GenStatusFlags::isDirectPromptTauDecayProduct
bool isDirectPromptTauDecayProduct() const
Definition: GenStatusFlags.h:62
reco::GenStatusFlags::kFromHardProcessBeforeFSR
Definition: GenStatusFlags.h:28
reco::GenStatusFlags::isHardProcess
bool isHardProcess() const
Definition: GenStatusFlags.h:77
reco::GenStatusFlags::setIsPrompt
void setIsPrompt(bool b)
Definition: GenStatusFlags.h:40
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:46
reco::GenStatusFlags::setIsTauDecayProduct
void setIsTauDecayProduct(bool b)
Definition: GenStatusFlags.h:51
reco::GenStatusFlags::kIsDirectHardProcessTauDecayProduct
Definition: GenStatusFlags.h:27
reco::GenStatusFlags::kFromHardProcess
Definition: GenStatusFlags.h:25
reco::GenStatusFlags::StatusBits
StatusBits
Definition: GenStatusFlags.h:16
reco::GenStatusFlags::isFirstCopy
bool isFirstCopy() const
Definition: GenStatusFlags.h:101
reco::GenStatusFlags::setIsDirectPromptTauDecayProduct
void setIsDirectPromptTauDecayProduct(bool b)
Definition: GenStatusFlags.h:63
reco::GenStatusFlags::setIsHardProcess
void setIsHardProcess(bool b)
Definition: GenStatusFlags.h:78
reco::GenStatusFlags::kIsHardProcessTauDecayProduct
Definition: GenStatusFlags.h:26
reco::GenStatusFlags::setIsLastCopyBeforeFSR
void setIsLastCopyBeforeFSR(bool b)
Definition: GenStatusFlags.h:113
b
double b
Definition: hdecay.h:118
reco::GenStatusFlags::setIsHardProcessTauDecayProduct
void setIsHardProcessTauDecayProduct(bool b)
Definition: GenStatusFlags.h:87
reco::GenStatusFlags::kIsPrompt
Definition: GenStatusFlags.h:17
reco::GenStatusFlags::kIsDirectPromptTauDecayProduct
Definition: GenStatusFlags.h:22
reco::GenStatusFlags::setFromHardProcess
void setFromHardProcess(bool b)
Definition: GenStatusFlags.h:82
reco::GenStatusFlags::isPromptTauDecayProduct
bool isPromptTauDecayProduct() const
Definition: GenStatusFlags.h:54
reco::GenStatusFlags::setIsDirectHardProcessTauDecayProduct
void setIsDirectHardProcessTauDecayProduct(bool b)
Definition: GenStatusFlags.h:92
reco::GenStatusFlags
Definition: GenStatusFlags.h:15
reco::GenStatusFlags::setIsPromptTauDecayProduct
void setIsPromptTauDecayProduct(bool b)
Definition: GenStatusFlags.h:55
reco::GenStatusFlags::setIsFirstCopy
void setIsFirstCopy(bool b)
Definition: GenStatusFlags.h:102
reco::GenStatusFlags::isLastCopyBeforeFSR
bool isLastCopyBeforeFSR() const
Definition: GenStatusFlags.h:112
reco::GenStatusFlags::kIsPromptTauDecayProduct
Definition: GenStatusFlags.h:20
reco::GenStatusFlags::setIsDirectTauDecayProduct
void setIsDirectTauDecayProduct(bool b)
Definition: GenStatusFlags.h:59
reco::GenStatusFlags::kIsHardProcess
Definition: GenStatusFlags.h:24
reco::GenStatusFlags::setIsDecayedLeptonHadron
void setIsDecayedLeptonHadron(bool b)
Definition: GenStatusFlags.h:47
reco::GenStatusFlags::kIsLastCopy
Definition: GenStatusFlags.h:30
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
reco::GenStatusFlags::setIsLastCopy
void setIsLastCopy(bool b)
Definition: GenStatusFlags.h:107
reco::GenStatusFlags::kIsDecayedLeptonHadron
Definition: GenStatusFlags.h:18
reco::GenStatusFlags::kIsLastCopyBeforeFSR
Definition: GenStatusFlags.h:31
reco::GenStatusFlags::isTauDecayProduct
bool isTauDecayProduct() const
Definition: GenStatusFlags.h:50
reco::GenStatusFlags::isHardProcessTauDecayProduct
bool isHardProcessTauDecayProduct() const
Definition: GenStatusFlags.h:86
reco::GenStatusFlags::fromHardProcess
bool fromHardProcess() const
Definition: GenStatusFlags.h:81
reco::GenStatusFlags::isDirectHardProcessTauDecayProduct
bool isDirectHardProcessTauDecayProduct() const
Definition: GenStatusFlags.h:91
reco::GenStatusFlags::setFromHardProcessBeforeFSR
void setFromHardProcessBeforeFSR(bool b)
Definition: GenStatusFlags.h:98
reco::GenStatusFlags::flags_
std::bitset< 15 > flags_
Definition: GenStatusFlags.h:115
reco::GenStatusFlags::kIsDirectTauDecayProduct
Definition: GenStatusFlags.h:21
reco::GenStatusFlags::fromHardProcessBeforeFSR
bool fromHardProcessBeforeFSR() const
Definition: GenStatusFlags.h:97
reco::GenStatusFlags::kIsFirstCopy
Definition: GenStatusFlags.h:29
reco::GenStatusFlags::kIsDirectHadronDecayProduct
Definition: GenStatusFlags.h:23
reco::GenStatusFlags::isDirectTauDecayProduct
bool isDirectTauDecayProduct() const
Definition: GenStatusFlags.h:58