CMS 3D CMS Logo

TtSemiLepJetComb.h
Go to the documentation of this file.
1 #ifndef TtSemiLepJetComb_h
2 #define TtSemiLepJetComb_h
3 
4 #include <vector>
5 #include <string>
6 
7 #include "TMath.h"
8 
11 
12 namespace JetComb {
15  enum DecayType { kHad, kLep };
17  enum VarType { kMass, kPt, kEta, kPhi, kTheta };
21  enum BTagAlgo {
33  };
35  enum Operator { kAdd, kMult };
36 } // namespace JetComb
37 
49 public:
53  TtSemiLepJetComb(const std::vector<pat::Jet>&,
54  const std::vector<int>&,
56  const pat::MET&);
59 
61  double topVar(JetComb::DecayType decay, JetComb::VarType var) const;
63  double wBosonVar(JetComb::DecayType decay, JetComb::VarType var) const;
65  double bQuarkVar(JetComb::DecayType decay, JetComb::VarType var) const;
67  double lightQVar(bool qbar, JetComb::VarType var) const;
69  double leptonVar(JetComb::VarType var) const;
71  double neutrinoVar(JetComb::VarType var) const;
72 
74  double compareHadTopLepTop(JetComb::CompType comp) const;
76  double compareHadWLepW(JetComb::CompType comp) const;
78  double compareHadBLepB(JetComb::CompType comp) const;
80  double compareLightQuarks(JetComb::CompType comp) const;
82  double compareLeptonNeutrino(JetComb::CompType comp) const;
84  double compareTopW(JetComb::DecayType dec1, JetComb::DecayType dec2, JetComb::CompType comp) const;
86  double compareTopB(JetComb::DecayType dec1, JetComb::DecayType dec2, JetComb::CompType comp) const;
88  double compareWB(JetComb::DecayType dec1, JetComb::DecayType dec2, JetComb::CompType comp) const;
90  double compareTopLepton(JetComb::DecayType decay, JetComb::CompType comp) const;
92  double compareTopNeutrino(JetComb::DecayType decay, JetComb::CompType comp) const;
94  double compareWLepton(JetComb::DecayType decay, JetComb::CompType comp) const;
96  double compareWNeutrino(JetComb::DecayType decay, JetComb::CompType comp) const;
98  double compareBLepton(JetComb::DecayType decay, JetComb::CompType comp) const;
100  double compareBNeutrino(JetComb::DecayType decay, JetComb::CompType comp) const;
101 
105  double relativePtHadronicTop() const;
108  double bOverLightQPt() const;
109 
111  double bTag(JetComb::DecayType decay, JetComb::BTagAlgo algo) const { return bTag(bQuark(decay), algo); };
113  double combinedBTags(JetComb::BTagAlgo algo, JetComb::Operator op) const;
115  double combinedBTagsForLightQuarks(JetComb::BTagAlgo algo, JetComb::Operator op) const;
116 
118  double addUserVar(std::string key, double value) { return userVariables_[key] = value; };
120  double userVar(const std::string& key) const {
121  return (userVariables_.find(key) != userVariables_.end() ? userVariables_.find(key)->second : -9999.);
122  };
123 
124 private:
126  void deduceMothers();
128  double bTag(const pat::Jet& jet, JetComb::BTagAlgo algo) const;
130  double lightQVar(JetComb::VarType var) const { return lightQVar(false, var); };
132  const pat::Jet& lightQ(bool qbar = false) const { return (qbar ? hadQBarJet_ : hadQJet_); }
134  const pat::Jet& bQuark(JetComb::DecayType decay) const { return (decay == JetComb::kHad ? hadBJet_ : lepBJet_); }
137  return (decay == JetComb::kHad ? hadW_ : lepW_);
138  }
141  return (decay == JetComb::kHad ? hadTop_ : lepTop_);
142  }
143 
144 private:
166  std::map<std::string, double> userVariables_;
167 };
168 
169 #endif
Analysis-level MET class.
Definition: MET.h:40
math::XYZTLorentzVector lepton_
lepton 4-vector
math::XYZTLorentzVector hadTop_
hadronic top 4-vector
CompType
supported comparison types
math::XYZTLorentzVector lepW_
leptonic W 4-vector
math::XYZTLorentzVector lepTop_
leptonic top 4-vector
std::map< std::string, double > userVariables_
map for user defined variables
const math::XYZTLorentzVector & top(JetComb::DecayType decay) const
return leptonic or hadronic top candidate depending on argument
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
Operator
operators for combining variables
const pat::Jet & lightQ(bool qbar=false) const
return lightQ or lightQBar candidate depending on argument
pat::Jet hadBJet_
hadronic b jet
Definition: value.py:1
double lightQVar(JetComb::VarType var) const
light quark candidate variable with default on q and not qbar
pat::Jet hadQJet_
lightQ jet
pat::Jet lepBJet_
leptonic b jet
double addUserVar(std::string key, double value)
add an arbitary user defined variable with given key and value
math::XYZTLorentzVector hadW_
hadronic W 4-vector
double userVar(const std::string &key) const
receive user defined variable value with given key
Analysis-level calorimeter jet class.
Definition: Jet.h:77
VarType
supported std single variable types
pat::Jet hadQBarJet_
lightQBar jet
BTagAlgo
b-tagging algorithms
Common calculator class to keep multivariate analysis variables for jet combinations in semi-leptonic...
const math::XYZTLorentzVector & wBoson(JetComb::DecayType decay) const
return leptonic or hadronic W candidate depending on argument
const pat::Jet & bQuark(JetComb::DecayType decay) const
return leptonic or hadronic b candidate depending on argument
double bTag(JetComb::DecayType decay, JetComb::BTagAlgo algo) const
b-tag value of a b candidate
pat::MET neutrino_
neutrino candidate