File indexing completed on 2024-04-06 12:31:19
0001 #ifndef TtSemiLepJetComb_h
0002 #define TtSemiLepJetComb_h
0003
0004 #include <vector>
0005 #include <string>
0006
0007 #include "TMath.h"
0008
0009 #include "DataFormats/PatCandidates/interface/Jet.h"
0010 #include "DataFormats/PatCandidates/interface/MET.h"
0011
0012 namespace JetComb {
0013
0014
0015 enum DecayType { kHad, kLep };
0016
0017 enum VarType { kMass, kPt, kEta, kPhi, kTheta };
0018
0019 enum CompType { kDeltaM, kDeltaR, kDeltaPhi, kDeltaTheta };
0020
0021 enum BTagAlgo {
0022 kTrackCountHighEff,
0023 kTrackCountHighPur,
0024 kSoftMuon,
0025 kSoftMuonByPt,
0026 kSofMuonByIP3d,
0027 kSoftElec,
0028 kBProbability,
0029 kProbability,
0030 kSimpleSecondVtx,
0031 kCombSecondVtx,
0032 kCombSecondVtxMVA
0033 };
0034
0035 enum Operator { kAdd, kMult };
0036 }
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048 class TtSemiLepJetComb {
0049 public:
0050
0051 TtSemiLepJetComb();
0052
0053 TtSemiLepJetComb(const std::vector<pat::Jet>&,
0054 const std::vector<int>&,
0055 const math::XYZTLorentzVector&,
0056 const pat::MET&);
0057
0058 ~TtSemiLepJetComb();
0059
0060
0061 double topVar(JetComb::DecayType decay, JetComb::VarType var) const;
0062
0063 double wBosonVar(JetComb::DecayType decay, JetComb::VarType var) const;
0064
0065 double bQuarkVar(JetComb::DecayType decay, JetComb::VarType var) const;
0066
0067 double lightQVar(bool qbar, JetComb::VarType var) const;
0068
0069 double leptonVar(JetComb::VarType var) const;
0070
0071 double neutrinoVar(JetComb::VarType var) const;
0072
0073
0074 double compareHadTopLepTop(JetComb::CompType comp) const;
0075
0076 double compareHadWLepW(JetComb::CompType comp) const;
0077
0078 double compareHadBLepB(JetComb::CompType comp) const;
0079
0080 double compareLightQuarks(JetComb::CompType comp) const;
0081
0082 double compareLeptonNeutrino(JetComb::CompType comp) const;
0083
0084 double compareTopW(JetComb::DecayType dec1, JetComb::DecayType dec2, JetComb::CompType comp) const;
0085
0086 double compareTopB(JetComb::DecayType dec1, JetComb::DecayType dec2, JetComb::CompType comp) const;
0087
0088 double compareWB(JetComb::DecayType dec1, JetComb::DecayType dec2, JetComb::CompType comp) const;
0089
0090 double compareTopLepton(JetComb::DecayType decay, JetComb::CompType comp) const;
0091
0092 double compareTopNeutrino(JetComb::DecayType decay, JetComb::CompType comp) const;
0093
0094 double compareWLepton(JetComb::DecayType decay, JetComb::CompType comp) const;
0095
0096 double compareWNeutrino(JetComb::DecayType decay, JetComb::CompType comp) const;
0097
0098 double compareBLepton(JetComb::DecayType decay, JetComb::CompType comp) const;
0099
0100 double compareBNeutrino(JetComb::DecayType decay, JetComb::CompType comp) const;
0101
0102
0103
0104
0105 double relativePtHadronicTop() const;
0106
0107
0108 double bOverLightQPt() const;
0109
0110
0111 double bTag(JetComb::DecayType decay, JetComb::BTagAlgo algo) const { return bTag(bQuark(decay), algo); };
0112
0113 double combinedBTags(JetComb::BTagAlgo algo, JetComb::Operator op) const;
0114
0115 double combinedBTagsForLightQuarks(JetComb::BTagAlgo algo, JetComb::Operator op) const;
0116
0117
0118 double addUserVar(std::string key, double value) { return userVariables_[key] = value; };
0119
0120 double userVar(const std::string& key) const {
0121 return (userVariables_.find(key) != userVariables_.end() ? userVariables_.find(key)->second : -9999.);
0122 };
0123
0124 private:
0125
0126 void deduceMothers();
0127
0128 double bTag(const pat::Jet& jet, JetComb::BTagAlgo algo) const;
0129
0130 double lightQVar(JetComb::VarType var) const { return lightQVar(false, var); };
0131
0132 const pat::Jet& lightQ(bool qbar = false) const { return (qbar ? hadQBarJet_ : hadQJet_); }
0133
0134 const pat::Jet& bQuark(JetComb::DecayType decay) const { return (decay == JetComb::kHad ? hadBJet_ : lepBJet_); }
0135
0136 const math::XYZTLorentzVector& wBoson(JetComb::DecayType decay) const {
0137 return (decay == JetComb::kHad ? hadW_ : lepW_);
0138 }
0139
0140 const math::XYZTLorentzVector& top(JetComb::DecayType decay) const {
0141 return (decay == JetComb::kHad ? hadTop_ : lepTop_);
0142 }
0143
0144 private:
0145
0146 pat::Jet hadQJet_;
0147
0148 pat::Jet hadQBarJet_;
0149
0150 pat::Jet hadBJet_;
0151
0152 pat::Jet lepBJet_;
0153
0154 pat::MET neutrino_;
0155
0156 math::XYZTLorentzVector lepton_;
0157
0158 math::XYZTLorentzVector hadTop_;
0159
0160 math::XYZTLorentzVector hadW_;
0161
0162 math::XYZTLorentzVector lepTop_;
0163
0164 math::XYZTLorentzVector lepW_;
0165
0166 std::map<std::string, double> userVariables_;
0167 };
0168
0169 #endif