CMS 3D CMS Logo

FlavorHistory.h
Go to the documentation of this file.
1 #ifndef HepMCCandidate_FlavorHistory_h
2 #define HepMCCandidate_FlavorHistory_h
3 
13 // -------------------------------------------------------------
14 // Identify the ancestry of the Quark
15 //
16 //
17 // Matrix Element:
18 // Status 3 parent with precisely 2 "grandparents" that
19 // is outside of the "initial" section (0-5) that has the
20 // same ID as the status 2 parton in question.
21 //
22 // Flavor excitation:
23 // If we find only one outgoing parton.
24 //
25 // Gluon splitting:
26 // Parent is a quark of a different flavor than the parton
27 // in question, or a gluon.
28 // Can come from either ISR or FSR.
29 //
30 // True decay:
31 // Decays from a resonance like top, Higgs, etc.
32 // -------------------------------------------------------------
33 
34 
42 
43 #include <fstream>
44 
45 namespace reco {
46 
47 
49 public:
50 
51  enum FLAVOR_T { FLAVOR_NULL=0, // No flavor, unset
52  FLAVOR_GS, // gluon splitting
53  FLAVOR_EXC, // flavor excitation
54  FLAVOR_ME, // matrix element
55  FLAVOR_DECAY, // flavor decay
56  N_FLAVOR_TYPES };// total number
57 
58  static const int gluonId=21;
59  static const int tQuarkId=6;
60  static const int bQuarkId=5;
61  static const int cQuarkId=4;
62 
63 
64  FlavorHistory();
66  reco::CandidatePtr const & parton,
68  reco::CandidatePtr const & sister,
73  int iparton,
74  int iprogenitor,
75  int isister,
80  int iparton,
81  int iprogenitor,
82  int isister,
86 
87 
88  // Accessors
89  FLAVOR_T flavorSource () const { return flavorSource_; }
90  bool hasParton () const { return parton_.isNonnull(); }
91  bool hasSister () const { return sister_.isNonnull(); }
92  bool hasProgenitor () const { return progenitor_.isNonnull();}
93  bool hasMatchedJet () const { return matchedJet_.masterClonePtr().isNonnull(); }
94  bool hasSisterJet () const { return sisterJet_.masterClonePtr().isNonnull(); }
95  const reco::CandidatePtr & parton () const { return parton_; }
96  const reco::CandidatePtr & sister () const { return sister_; }
97  const reco::CandidatePtr & progenitor() const { return progenitor_; }
99  matchedJet() const { return matchedJet_; }
101  sisterJet() const { return sisterJet_; }
102 
103  // Operators for sorting and keys
104  bool operator< ( FlavorHistory const & right ) const {
105  return parton_.key() < right.parton_.key();
106  }
107  bool operator> ( FlavorHistory const & right ) const {
108  return parton_.key() > right.parton_.key();
109  }
110  bool operator== ( FlavorHistory const & right ) const {
111  return parton_.key() == right.parton_.key();
112  }
113 
114 
115 
116 protected:
123 };
124 
125 }
126 
127 std::ostream & operator<<( std::ostream & out, reco::FlavorHistory const & cand);
128 
129 #endif
static const int bQuarkId
Definition: FlavorHistory.h:60
key_type key() const
Definition: Ptr.h:185
virtual const CandidatePtr & masterClonePtr() const
returns reference to master clone pointer
const reco::ShallowClonePtrCandidate & matchedJet() const
Definition: FlavorHistory.h:99
static const int tQuarkId
Definition: FlavorHistory.h:59
bool hasProgenitor() const
Definition: FlavorHistory.h:92
bool operator>(FlavorHistory const &right) const
reco::CandidatePtr progenitor_
bool operator<(FlavorHistory const &right) const
FLAVOR_T flavorSource() const
Definition: FlavorHistory.h:89
reco::ShallowClonePtrCandidate sisterJet_
bool hasParton() const
Definition: FlavorHistory.h:90
std::ostream & operator<<(std::ostream &, BeamSpot beam)
Definition: BeamSpot.cc:71
static const int cQuarkId
Definition: FlavorHistory.h:61
bool hasSisterJet() const
Definition: FlavorHistory.h:94
reco::CandidatePtr sister_
reco::ShallowClonePtrCandidate matchedJet_
bool isNonnull() const
Checks for non-null.
Definition: Ptr.h:168
const reco::CandidatePtr & sister() const
Definition: FlavorHistory.h:96
const reco::CandidatePtr & progenitor() const
Definition: FlavorHistory.h:97
fixed size matrix
const reco::ShallowClonePtrCandidate & sisterJet() const
reco::CandidatePtr parton_
bool hasSister() const
Definition: FlavorHistory.h:91
static const int gluonId
Definition: FlavorHistory.h:58
bool operator==(FlavorHistory const &right) const
bool hasMatchedJet() const
Definition: FlavorHistory.h:93
const reco::CandidatePtr & parton() const
Definition: FlavorHistory.h:95