CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 
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;
90  double compareTopLepton(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); };
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
double relativePtHadronicTop() const
math::XYZTLorentzVector lepton_
lepton 4-vector
math::XYZTLorentzVector hadTop_
hadronic top 4-vector
CompType
supported comparison types
math::XYZTLorentzVector lepW_
leptonic W 4-vector
double combinedBTags(JetComb::BTagAlgo algo, JetComb::Operator op) const
combined b-tag values of the two b candidates
math::XYZTLorentzVector lepTop_
leptonic top 4-vector
double compareWB(JetComb::DecayType dec1, JetComb::DecayType dec2, JetComb::CompType comp) const
comparison between the W and the b candidate
std::map< std::string, double > userVariables_
map for user defined variables
double neutrinoVar(JetComb::VarType var) const
neutrino candidate variable
double compareHadBLepB(JetComb::CompType comp) const
comparison between the two b candidates
~TtSemiLepJetComb()
default destructor
double compareHadWLepW(JetComb::CompType comp) const
comparison between the two W candidates
TtSemiLepJetComb()
emtpy constructor
double bQuarkVar(JetComb::DecayType decay, JetComb::VarType var) const
b quark candidate variable
const math::XYZTLorentzVector & top(JetComb::DecayType decay) const
return leptonic or hadronic top candidate depending on argument
double compareHadTopLepTop(JetComb::CompType comp) const
comparison between the two top candidates
double compareWLepton(JetComb::DecayType decay, JetComb::CompType comp) const
comparison between the W and the lepton candidate
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
double compareBLepton(JetComb::DecayType decay, JetComb::CompType comp) const
comparison between the b and the lepton candidate
double lightQVar(bool qbar, JetComb::VarType var) const
light quark candidate variable
double compareBNeutrino(JetComb::DecayType decay, JetComb::CompType comp) const
comparison between the b and the neutrino candidate
double compareLightQuarks(JetComb::CompType comp) const
comparison between the lightQ and the lightQBar candidate
double compareLeptonNeutrino(JetComb::CompType comp) const
comparison between the lepton and the neutrino candidate
list var
if using global norm cols_to_minmax = [&#39;t_delta&#39;, &#39;t_hmaxNearP&#39;,&#39;t_emaxNearP&#39;, &#39;t_hAnnular&#39;, &#39;t_eAnnular&#39;,&#39;t_pt&#39;,&#39;t_nVtx&#39;,&#39;t_ieta&#39;,&#39;t_eHcal10&#39;, &#39;t_eHcal30&#39;,&#39;t_rhoh&#39;,&#39;t_eHcal&#39;] df[cols_to_minmax] = df[cols_to_minmax].apply(lambda x: (x - x.min()) / (x.max() - x.min()) if (x.max() - x.min() &gt; 0) else 1.0/200.0)
Operator
operators for combining variables
double compareTopLepton(JetComb::DecayType decay, JetComb::CompType comp) const
comparison between the top and the lepton candidate
double compareTopW(JetComb::DecayType dec1, JetComb::DecayType dec2, JetComb::CompType comp) const
comparison between the top and the W candidate
double compareTopB(JetComb::DecayType dec1, JetComb::DecayType dec2, JetComb::CompType comp) const
comparison between the top and the b candidate
tuple key
prepare the HTCondor submission files and eventually submit them
const pat::Jet & lightQ(bool qbar=false) const
return lightQ or lightQBar candidate depending on argument
pat::Jet hadBJet_
hadronic b jet
double topVar(JetComb::DecayType decay, JetComb::VarType var) const
top quark candidate variable
double leptonVar(JetComb::VarType var) const
lepton candidate variable
double wBosonVar(JetComb::DecayType decay, JetComb::VarType var) const
W boson candidate variable.
double combinedBTagsForLightQuarks(JetComb::BTagAlgo algo, JetComb::Operator op) const
combined b-tag values of the two light quark candidates
double compareWNeutrino(JetComb::DecayType decay, JetComb::CompType comp) const
comparison between the W and the neutrino candidate
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
double compareTopNeutrino(JetComb::DecayType decay, JetComb::CompType comp) const
comparison between the top and the neutrino candidate
void deduceMothers()
reconstruct mother candidates from final state candidates
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
double bOverLightQPt() const
pat::MET neutrino_
neutrino candidate