CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
FlavorHistory.h
Go to the documentation of this file.
1 #ifndef HepMCCandidate_FlavorHistory_h
2 #define HepMCCandidate_FlavorHistory_h
3 
12 // -------------------------------------------------------------
13 // Identify the ancestry of the Quark
14 //
15 //
16 // Matrix Element:
17 // Status 3 parent with precisely 2 "grandparents" that
18 // is outside of the "initial" section (0-5) that has the
19 // same ID as the status 2 parton in question.
20 //
21 // Flavor excitation:
22 // If we find only one outgoing parton.
23 //
24 // Gluon splitting:
25 // Parent is a quark of a different flavor than the parton
26 // in question, or a gluon.
27 // Can come from either ISR or FSR.
28 //
29 // True decay:
30 // Decays from a resonance like top, Higgs, etc.
31 // -------------------------------------------------------------
32 
40 
41 #include <fstream>
42 
43 namespace reco {
44 
45  class FlavorHistory {
46  public:
47  enum FLAVOR_T {
48  FLAVOR_NULL = 0, // No flavor, unset
49  FLAVOR_GS, // gluon splitting
50  FLAVOR_EXC, // flavor excitation
51  FLAVOR_ME, // matrix element
52  FLAVOR_DECAY, // flavor decay
54  }; // total number
55 
56  static const int gluonId = 21;
57  static const int tQuarkId = 6;
58  static const int bQuarkId = 5;
59  static const int cQuarkId = 4;
60 
61  FlavorHistory();
70  int iparton,
71  int iprogenitor,
72  int isister,
77  int iparton,
78  int iprogenitor,
79  int isister,
83 
84  // Accessors
85  FLAVOR_T flavorSource() const { return flavorSource_; }
86  bool hasParton() const { return parton_.isNonnull(); }
87  bool hasSister() const { return sister_.isNonnull(); }
88  bool hasProgenitor() const { return progenitor_.isNonnull(); }
89  bool hasMatchedJet() const { return matchedJet_.masterClonePtr().isNonnull(); }
90  bool hasSisterJet() const { return sisterJet_.masterClonePtr().isNonnull(); }
91  const reco::CandidatePtr& parton() const { return parton_; }
92  const reco::CandidatePtr& sister() const { return sister_; }
93  const reco::CandidatePtr& progenitor() const { return progenitor_; }
96 
97  // Operators for sorting and keys
98  bool operator<(FlavorHistory const& right) const { return parton_.key() < right.parton_.key(); }
99  bool operator>(FlavorHistory const& right) const { return parton_.key() > right.parton_.key(); }
100  bool operator==(FlavorHistory const& right) const { return parton_.key() == right.parton_.key(); }
101 
102  protected:
109  };
110 
111 } // namespace reco
112 
113 std::ostream& operator<<(std::ostream& out, reco::FlavorHistory const& cand);
114 
115 #endif
static const int bQuarkId
Definition: FlavorHistory.h:58
key_type key() const
Definition: Ptr.h:163
const reco::ShallowClonePtrCandidate & matchedJet() const
Definition: FlavorHistory.h:94
static const int tQuarkId
Definition: FlavorHistory.h:57
bool hasProgenitor() const
Definition: FlavorHistory.h:88
bool operator>(FlavorHistory const &right) const
Definition: FlavorHistory.h:99
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:167
reco::CandidatePtr progenitor_
bool operator<(FlavorHistory const &right) const
Definition: FlavorHistory.h:98
FLAVOR_T flavorSource() const
Definition: FlavorHistory.h:85
reco::ShallowClonePtrCandidate sisterJet_
bool hasParton() const
Definition: FlavorHistory.h:86
const CandidatePtr & masterClonePtr() const override
returns reference to master clone pointer
static const int cQuarkId
Definition: FlavorHistory.h:59
bool hasSisterJet() const
Definition: FlavorHistory.h:90
reco::CandidatePtr sister_
reco::ShallowClonePtrCandidate matchedJet_
bool isNonnull() const
Checks for non-null.
Definition: Ptr.h:146
const reco::CandidatePtr & sister() const
Definition: FlavorHistory.h:92
const reco::CandidatePtr & progenitor() const
Definition: FlavorHistory.h:93
const reco::ShallowClonePtrCandidate & sisterJet() const
Definition: FlavorHistory.h:95
reco::CandidatePtr parton_
bool hasSister() const
Definition: FlavorHistory.h:87
static const int gluonId
Definition: FlavorHistory.h:56
bool operator==(FlavorHistory const &right) const
bool hasMatchedJet() const
Definition: FlavorHistory.h:89
const reco::CandidatePtr & parton() const
Definition: FlavorHistory.h:91