CMS 3D CMS Logo

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
reco::FlavorHistory::operator==
bool operator==(FlavorHistory const &right) const
Definition: FlavorHistory.h:100
reco::FlavorHistory::FLAVOR_GS
Definition: FlavorHistory.h:49
reco::FlavorHistory::FLAVOR_DECAY
Definition: FlavorHistory.h:52
Handle.h
reco::FlavorHistory
Definition: FlavorHistory.h:45
reco::FlavorHistory::N_FLAVOR_TYPES
Definition: FlavorHistory.h:53
reco::FlavorHistory::hasParton
bool hasParton() const
Definition: FlavorHistory.h:86
reco::FlavorHistory::FLAVOR_EXC
Definition: FlavorHistory.h:50
reco::FlavorHistory::flavorSource
FLAVOR_T flavorSource() const
Definition: FlavorHistory.h:85
reco::FlavorHistory::progenitor
const reco::CandidatePtr & progenitor() const
Definition: FlavorHistory.h:93
reco::FlavorHistory::hasProgenitor
bool hasProgenitor() const
Definition: FlavorHistory.h:88
reco::FlavorHistory::~FlavorHistory
~FlavorHistory()
Definition: FlavorHistory.h:82
reco::FlavorHistory::sisterJet
const reco::ShallowClonePtrCandidate & sisterJet() const
Definition: FlavorHistory.h:95
reco::FlavorHistory::sister
const reco::CandidatePtr & sister() const
Definition: FlavorHistory.h:92
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:46
edm::Ptr::key
key_type key() const
Definition: Ptr.h:163
edm::Handle
Definition: AssociativeIterator.h:50
CandidateFwd.h
reco::FlavorHistory::flavorSource_
FLAVOR_T flavorSource_
Definition: FlavorHistory.h:103
reco::FlavorHistory::parton_
reco::CandidatePtr parton_
Definition: FlavorHistory.h:104
reco::FlavorHistory::sisterJet_
reco::ShallowClonePtrCandidate sisterJet_
Definition: FlavorHistory.h:108
reco::FlavorHistory::FLAVOR_T
FLAVOR_T
Definition: FlavorHistory.h:47
reco::FlavorHistory::cQuarkId
static const int cQuarkId
Definition: FlavorHistory.h:59
reco::FlavorHistory::bQuarkId
static const int bQuarkId
Definition: FlavorHistory.h:58
reco::FlavorHistory::gluonId
static const int gluonId
Definition: FlavorHistory.h:56
reco::FlavorHistory::operator<
bool operator<(FlavorHistory const &right) const
Definition: FlavorHistory.h:98
reco::FlavorHistory::FLAVOR_ME
Definition: FlavorHistory.h:51
reco::FlavorHistory::hasMatchedJet
bool hasMatchedJet() const
Definition: FlavorHistory.h:89
reco::FlavorHistory::parton
const reco::CandidatePtr & parton() const
Definition: FlavorHistory.h:91
edm::View
Definition: CaloClusterFwd.h:14
cand
Definition: decayParser.h:32
reco::FlavorHistory::matchedJet_
reco::ShallowClonePtrCandidate matchedJet_
Definition: FlavorHistory.h:107
Ptr.h
ShallowClonePtrCandidate.h
reco::FlavorHistory::operator>
bool operator>(FlavorHistory const &right) const
Definition: FlavorHistory.h:99
reco::FlavorHistory::hasSisterJet
bool hasSisterJet() const
Definition: FlavorHistory.h:90
reco::FlavorHistory::FLAVOR_NULL
Definition: FlavorHistory.h:48
edm::Ptr< Candidate >
reco::FlavorHistory::tQuarkId
static const int tQuarkId
Definition: FlavorHistory.h:57
reco::FlavorHistory::FlavorHistory
FlavorHistory()
Definition: FlavorHistory.cc:7
operator<<
std::ostream & operator<<(std::ostream &out, reco::FlavorHistory const &cand)
edm::Ptr::isNonnull
bool isNonnull() const
Checks for non-null.
Definition: Ptr.h:146
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
Candidate.h
reco::FlavorHistory::progenitor_
reco::CandidatePtr progenitor_
Definition: FlavorHistory.h:105
View.h
reco::ShallowClonePtrCandidate
Definition: ShallowClonePtrCandidate.h:15
OwnVector.h
reco::ShallowClonePtrCandidate::masterClonePtr
const CandidatePtr & masterClonePtr() const override
returns reference to master clone pointer
Definition: ShallowClonePtrCandidate.cc:20
reco::FlavorHistory::matchedJet
const reco::ShallowClonePtrCandidate & matchedJet() const
Definition: FlavorHistory.h:94
reco::FlavorHistory::hasSister
bool hasSister() const
Definition: FlavorHistory.h:87
reco::FlavorHistory::sister_
reco::CandidatePtr sister_
Definition: FlavorHistory.h:106