Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:31:19

0001 #ifndef TtSemiLepJetCombEval_h
0002 #define TtSemiLepJetCombEval_h
0003 
0004 #include "PhysicsTools/MVAComputer/interface/Variable.h"
0005 #include "TopQuarkAnalysis/TopJetCombination/interface/TtSemiLepJetComb.h"
0006 
0007 // ----------------------------------------------------------------------
0008 // common interface for the evaluation of multivariate analysis variables
0009 // for jet combinations in semi leptonic ttbar decays
0010 // used by the MVATrainer and MVAComputer
0011 // ----------------------------------------------------------------------
0012 
0013 inline void evaluateTtSemiLepJetComb(PhysicsTools::Variable::ValueList& values, const TtSemiLepJetComb& jetComb) {
0014   // ----------------------------------------------------------------------
0015   // mass, pt, eta, phi and theta of single candidates of the ttbar system
0016   // ----------------------------------------------------------------------
0017   // hadronic top quark
0018   values.add("massHadTop", jetComb.topVar(JetComb::kHad, JetComb::kMass));
0019   values.add("ptHadTop", jetComb.topVar(JetComb::kHad, JetComb::kPt));
0020   values.add("etaHadTop", jetComb.topVar(JetComb::kHad, JetComb::kEta));
0021   values.add("phiHadTop", jetComb.topVar(JetComb::kHad, JetComb::kPhi));
0022   values.add("thetaHadTop", jetComb.topVar(JetComb::kHad, JetComb::kTheta));
0023   // leptonic top quark
0024   values.add("massLepTop", jetComb.topVar(JetComb::kLep, JetComb::kMass));
0025   values.add("ptLepTop", jetComb.topVar(JetComb::kLep, JetComb::kPt));
0026   values.add("etaLepTop", jetComb.topVar(JetComb::kLep, JetComb::kEta));
0027   values.add("phiLepTop", jetComb.topVar(JetComb::kLep, JetComb::kPhi));
0028   values.add("thetaLepTop", jetComb.topVar(JetComb::kLep, JetComb::kTheta));
0029   // hadronic W boson
0030   values.add("massHadW", jetComb.wBosonVar(JetComb::kHad, JetComb::kMass));
0031   values.add("ptHadW", jetComb.wBosonVar(JetComb::kHad, JetComb::kPt));
0032   values.add("etaHadW", jetComb.wBosonVar(JetComb::kHad, JetComb::kEta));
0033   values.add("phiHadW", jetComb.wBosonVar(JetComb::kHad, JetComb::kPhi));
0034   values.add("thetaHadW", jetComb.wBosonVar(JetComb::kHad, JetComb::kTheta));
0035   // hadronic b quark
0036   values.add("ptHadB", jetComb.bQuarkVar(JetComb::kHad, JetComb::kPt));
0037   values.add("etaHadB", jetComb.bQuarkVar(JetComb::kHad, JetComb::kEta));
0038   values.add("phiHadB", jetComb.bQuarkVar(JetComb::kHad, JetComb::kPhi));
0039   values.add("thetaHadB", jetComb.bQuarkVar(JetComb::kHad, JetComb::kTheta));
0040   // leptonic b quark
0041   values.add("ptLepB", jetComb.bQuarkVar(JetComb::kLep, JetComb::kPt));
0042   values.add("etaLepB", jetComb.bQuarkVar(JetComb::kLep, JetComb::kEta));
0043   values.add("phiLepB", jetComb.bQuarkVar(JetComb::kLep, JetComb::kPhi));
0044   values.add("thetaLepB", jetComb.bQuarkVar(JetComb::kLep, JetComb::kTheta));
0045   // light quark
0046   values.add("ptLightQ", jetComb.lightQVar(false, JetComb::kPt));
0047   values.add("etaLightQ", jetComb.lightQVar(false, JetComb::kEta));
0048   values.add("phiLightQ", jetComb.lightQVar(false, JetComb::kPhi));
0049   values.add("thetaLightQ", jetComb.lightQVar(false, JetComb::kTheta));
0050   // light anti-quark
0051   values.add("ptLightQBar", jetComb.lightQVar(true, JetComb::kPt));
0052   values.add("etaLightQBar", jetComb.lightQVar(true, JetComb::kEta));
0053   values.add("phiLightQBar", jetComb.lightQVar(true, JetComb::kPhi));
0054   values.add("thetaLightQBar", jetComb.lightQVar(true, JetComb::kTheta));
0055   // ----------------------------------------------------------------------
0056   // compare two candidates of the ttbar system in DeltaM, DeltaR, DeltaPhi or DeltaTheta
0057   // ----------------------------------------------------------------------
0058   // the two top quarks
0059   values.add("deltaMHadTopLepTop", jetComb.compareHadTopLepTop(JetComb::kDeltaM));
0060   values.add("deltaRHadTopLepTop", jetComb.compareHadTopLepTop(JetComb::kDeltaR));
0061   values.add("deltaPhiHadTopLepTop", jetComb.compareHadTopLepTop(JetComb::kDeltaPhi));
0062   values.add("deltaThetaHadTopLepTop", jetComb.compareHadTopLepTop(JetComb::kDeltaTheta));
0063   // the two W bosons
0064   values.add("deltaMHadWLepW", jetComb.compareHadWLepW(JetComb::kDeltaM));
0065   values.add("deltaRHadWLepW", jetComb.compareHadWLepW(JetComb::kDeltaR));
0066   values.add("deltaPhiHadWLepW", jetComb.compareHadWLepW(JetComb::kDeltaPhi));
0067   values.add("deltaThetaHadWLepW", jetComb.compareHadWLepW(JetComb::kDeltaTheta));
0068   // the two b quarks
0069   values.add("deltaRHadBLepB", jetComb.compareHadBLepB(JetComb::kDeltaR));
0070   values.add("deltaPhiHadBLepB", jetComb.compareHadBLepB(JetComb::kDeltaPhi));
0071   values.add("deltaThetaHadBLepB", jetComb.compareHadBLepB(JetComb::kDeltaTheta));
0072   // the two light quarks
0073   values.add("deltaRHadQHadQBar", jetComb.compareLightQuarks(JetComb::kDeltaR));
0074   values.add("deltaPhiHadQHadQBar", jetComb.compareLightQuarks(JetComb::kDeltaPhi));
0075   values.add("deltaThetaHadQHadQBar", jetComb.compareLightQuarks(JetComb::kDeltaTheta));
0076   // the hadronic top and the hadronic W
0077   values.add("deltaMHadTopHadW", jetComb.compareTopW(JetComb::kHad, JetComb::kHad, JetComb::kDeltaM));
0078   values.add("deltaRHadTopHadW", jetComb.compareTopW(JetComb::kHad, JetComb::kHad, JetComb::kDeltaR));
0079   values.add("deltaPhiHadTopHadW", jetComb.compareTopW(JetComb::kHad, JetComb::kHad, JetComb::kDeltaPhi));
0080   values.add("deltaThetaHadTopHadW", jetComb.compareTopW(JetComb::kHad, JetComb::kHad, JetComb::kDeltaTheta));
0081   // the leptonic top and the leptonic W
0082   values.add("deltaMLepTopLepW", jetComb.compareTopW(JetComb::kLep, JetComb::kLep, JetComb::kDeltaM));
0083   values.add("deltaRLepTopLepW", jetComb.compareTopW(JetComb::kLep, JetComb::kLep, JetComb::kDeltaR));
0084   values.add("deltaPhiLepTopLepW", jetComb.compareTopW(JetComb::kLep, JetComb::kLep, JetComb::kDeltaPhi));
0085   values.add("deltaThetaLepTopLepW", jetComb.compareTopW(JetComb::kLep, JetComb::kLep, JetComb::kDeltaTheta));
0086   // the hadronic top and the leptonic W
0087   values.add("deltaMHadTopLepW", jetComb.compareTopW(JetComb::kHad, JetComb::kLep, JetComb::kDeltaM));
0088   values.add("deltaRHadTopLepW", jetComb.compareTopW(JetComb::kHad, JetComb::kLep, JetComb::kDeltaR));
0089   values.add("deltaPhiHadTopLepW", jetComb.compareTopW(JetComb::kHad, JetComb::kLep, JetComb::kDeltaPhi));
0090   values.add("deltaThetaHadTopLepW", jetComb.compareTopW(JetComb::kHad, JetComb::kLep, JetComb::kDeltaTheta));
0091   // the leptonic top and the hadronic W
0092   values.add("deltaMLepTopHadW", jetComb.compareTopW(JetComb::kLep, JetComb::kHad, JetComb::kDeltaM));
0093   values.add("deltaRLepTopHadW", jetComb.compareTopW(JetComb::kLep, JetComb::kHad, JetComb::kDeltaR));
0094   values.add("deltaPhiLepTopHadW", jetComb.compareTopW(JetComb::kLep, JetComb::kHad, JetComb::kDeltaPhi));
0095   values.add("deltaThetaLepTopHadW", jetComb.compareTopW(JetComb::kLep, JetComb::kHad, JetComb::kDeltaTheta));
0096   // the hadronic top and the hadronic b
0097   values.add("deltaRHadTopHadB", jetComb.compareTopB(JetComb::kHad, JetComb::kHad, JetComb::kDeltaR));
0098   values.add("deltaPhiHadTopHadB", jetComb.compareTopB(JetComb::kHad, JetComb::kHad, JetComb::kDeltaPhi));
0099   values.add("deltaThetaHadTopHadB", jetComb.compareTopB(JetComb::kHad, JetComb::kHad, JetComb::kDeltaTheta));
0100   // the leptonic top and the leptonic b
0101   values.add("deltaRLepTopLepB", jetComb.compareTopB(JetComb::kLep, JetComb::kLep, JetComb::kDeltaR));
0102   values.add("deltaPhiLepTopLepB", jetComb.compareTopB(JetComb::kLep, JetComb::kLep, JetComb::kDeltaPhi));
0103   values.add("deltaThetaLepTopLepB", jetComb.compareTopB(JetComb::kLep, JetComb::kLep, JetComb::kDeltaTheta));
0104   // the hadronic top and the leptonic b
0105   values.add("deltaRHadTopLepB", jetComb.compareTopB(JetComb::kHad, JetComb::kLep, JetComb::kDeltaR));
0106   values.add("deltaPhiHadTopLepB", jetComb.compareTopB(JetComb::kHad, JetComb::kLep, JetComb::kDeltaPhi));
0107   values.add("deltaThetaHadTopLepB", jetComb.compareTopB(JetComb::kHad, JetComb::kLep, JetComb::kDeltaTheta));
0108   // the leptonic top and the hadronic b
0109   values.add("deltaRLepTopHadB", jetComb.compareTopB(JetComb::kLep, JetComb::kHad, JetComb::kDeltaR));
0110   values.add("deltaPhiLepTopHadB", jetComb.compareTopB(JetComb::kLep, JetComb::kHad, JetComb::kDeltaPhi));
0111   values.add("deltaThetaLepTopHadB", jetComb.compareTopB(JetComb::kLep, JetComb::kHad, JetComb::kDeltaTheta));
0112   // the hadronic W and the hadronic b
0113   values.add("deltaRHadWHadB", jetComb.compareWB(JetComb::kHad, JetComb::kHad, JetComb::kDeltaR));
0114   values.add("deltaPhiHadWHadB", jetComb.compareWB(JetComb::kHad, JetComb::kHad, JetComb::kDeltaPhi));
0115   values.add("deltaThetaHadWHadB", jetComb.compareWB(JetComb::kHad, JetComb::kHad, JetComb::kDeltaTheta));
0116   // the leptonic W and the leptonic b
0117   values.add("deltaRLepWLepB", jetComb.compareWB(JetComb::kLep, JetComb::kLep, JetComb::kDeltaR));
0118   values.add("deltaPhiLepWLepB", jetComb.compareWB(JetComb::kLep, JetComb::kLep, JetComb::kDeltaPhi));
0119   values.add("deltaThetaLepWLepB", jetComb.compareWB(JetComb::kLep, JetComb::kLep, JetComb::kDeltaTheta));
0120   // the hadronic W and the leptonic b
0121   values.add("deltaRHadWLepB", jetComb.compareWB(JetComb::kHad, JetComb::kLep, JetComb::kDeltaR));
0122   values.add("deltaPhiHadWLepB", jetComb.compareWB(JetComb::kHad, JetComb::kLep, JetComb::kDeltaPhi));
0123   values.add("deltaThetaHadWLepB", jetComb.compareWB(JetComb::kHad, JetComb::kLep, JetComb::kDeltaTheta));
0124   // the leptonic W and the hadronic b
0125   values.add("deltaRLepWHadB", jetComb.compareWB(JetComb::kLep, JetComb::kHad, JetComb::kDeltaR));
0126   values.add("deltaPhiLepWHadB", jetComb.compareWB(JetComb::kLep, JetComb::kHad, JetComb::kDeltaPhi));
0127   values.add("deltaThetaLepWHadB", jetComb.compareWB(JetComb::kLep, JetComb::kHad, JetComb::kDeltaTheta));
0128   // the hadronic top and the lepton
0129   values.add("deltaRHadTopLepton", jetComb.compareTopLepton(JetComb::kHad, JetComb::kDeltaR));
0130   values.add("deltaPhiHadTopLepton", jetComb.compareTopLepton(JetComb::kHad, JetComb::kDeltaPhi));
0131   values.add("deltaThetaHadTopLepton", jetComb.compareTopLepton(JetComb::kHad, JetComb::kDeltaTheta));
0132   // the leptonic top and the lepton
0133   values.add("deltaRLepTopLepton", jetComb.compareTopLepton(JetComb::kLep, JetComb::kDeltaR));
0134   values.add("deltaPhiLepTopLepton", jetComb.compareTopLepton(JetComb::kLep, JetComb::kDeltaPhi));
0135   values.add("deltaThetaLepTopLepton", jetComb.compareTopLepton(JetComb::kLep, JetComb::kDeltaTheta));
0136   // the hadronic top and the neutrino
0137   values.add("deltaRHadTopNeutrino", jetComb.compareTopNeutrino(JetComb::kHad, JetComb::kDeltaR));
0138   values.add("deltaPhiHadTopNeutrino", jetComb.compareTopNeutrino(JetComb::kHad, JetComb::kDeltaPhi));
0139   values.add("deltaThetaHadTopNeutrino", jetComb.compareTopNeutrino(JetComb::kHad, JetComb::kDeltaTheta));
0140   // the leptonic top and the neutrino
0141   values.add("deltaRLepTopNeutrino", jetComb.compareTopNeutrino(JetComb::kLep, JetComb::kDeltaR));
0142   values.add("deltaPhiLepTopNeutrino", jetComb.compareTopNeutrino(JetComb::kLep, JetComb::kDeltaPhi));
0143   values.add("deltaThetaLepTopNeutrino", jetComb.compareTopNeutrino(JetComb::kLep, JetComb::kDeltaTheta));
0144   // the hadronic W and the lepton
0145   values.add("deltaRHadWLepton", jetComb.compareWLepton(JetComb::kHad, JetComb::kDeltaR));
0146   values.add("deltaPhiHadWLepton", jetComb.compareWLepton(JetComb::kHad, JetComb::kDeltaPhi));
0147   values.add("deltaThetaHadWLepton", jetComb.compareWLepton(JetComb::kHad, JetComb::kDeltaTheta));
0148   // the hadronic W and the neutrino
0149   values.add("deltaRHadWNeutrino", jetComb.compareWNeutrino(JetComb::kHad, JetComb::kDeltaR));
0150   values.add("deltaPhiHadWNeutrino", jetComb.compareWNeutrino(JetComb::kHad, JetComb::kDeltaPhi));
0151   values.add("deltaThetaHadWNeutrino", jetComb.compareWNeutrino(JetComb::kHad, JetComb::kDeltaTheta));
0152   // the hadronic b and the lepton
0153   values.add("deltaRHadBLepton", jetComb.compareBLepton(JetComb::kHad, JetComb::kDeltaR));
0154   values.add("deltaPhiHadBLepton", jetComb.compareBLepton(JetComb::kHad, JetComb::kDeltaPhi));
0155   values.add("deltaThetaHadBLepton", jetComb.compareBLepton(JetComb::kHad, JetComb::kDeltaTheta));
0156   // the leptonic b and the lepton
0157   values.add("deltaRLepBLepton", jetComb.compareBLepton(JetComb::kLep, JetComb::kDeltaR));
0158   values.add("deltaPhiLepBLepton", jetComb.compareBLepton(JetComb::kLep, JetComb::kDeltaPhi));
0159   values.add("deltaThetaLepBLepton", jetComb.compareBLepton(JetComb::kLep, JetComb::kDeltaTheta));
0160   // the hadronic b and the neutrino
0161   values.add("deltaRHadBNeutrino", jetComb.compareBNeutrino(JetComb::kHad, JetComb::kDeltaR));
0162   values.add("deltaPhiHadBNeutrino", jetComb.compareBNeutrino(JetComb::kHad, JetComb::kDeltaPhi));
0163   values.add("deltaThetaHadBNeutrino", jetComb.compareBNeutrino(JetComb::kHad, JetComb::kDeltaTheta));
0164   // the leptonic b and the neutrino
0165   values.add("deltaRLepBNeutrino", jetComb.compareBNeutrino(JetComb::kLep, JetComb::kDeltaR));
0166   values.add("deltaPhiLepBNeutrino", jetComb.compareBNeutrino(JetComb::kLep, JetComb::kDeltaPhi));
0167   values.add("deltaThetaLepBNeutrino", jetComb.compareBNeutrino(JetComb::kLep, JetComb::kDeltaTheta));
0168   // ----------------------------------------------------------------------
0169   // special variables combining the pt of the jets
0170   // ----------------------------------------------------------------------
0171   values.add("relativePtHadronicTop", jetComb.relativePtHadronicTop());
0172   values.add("bOverLightQPt", jetComb.bOverLightQPt());
0173   // ----------------------------------------------------------------------
0174   // variables based on b-tagging with six different algorithms
0175   // ----------------------------------------------------------------------
0176   // hadronic b quark candidate
0177   values.add("bTagHadBTrkCntHighEff", jetComb.bTag(JetComb::kHad, JetComb::kTrackCountHighEff));
0178   values.add("bTagHadBTrkCntHighPur", jetComb.bTag(JetComb::kHad, JetComb::kTrackCountHighPur));
0179   values.add("bTagHadBSoftMuon", jetComb.bTag(JetComb::kHad, JetComb::kSoftMuon));
0180   values.add("bTagHadBSimpSecondVtx", jetComb.bTag(JetComb::kHad, JetComb::kSimpleSecondVtx));
0181   values.add("bTagHadBCombSecondVtx", jetComb.bTag(JetComb::kHad, JetComb::kCombSecondVtx));
0182   values.add("bTagHadBImpactParaMVA", jetComb.bTag(JetComb::kHad, JetComb::kCombSecondVtxMVA));
0183   // leptonic b quark candidate
0184   values.add("bTagLepBTrkCntHighEff", jetComb.bTag(JetComb::kLep, JetComb::kTrackCountHighEff));
0185   values.add("bTagLepBTrkCntHighPur", jetComb.bTag(JetComb::kLep, JetComb::kTrackCountHighPur));
0186   values.add("bTagLepBSoftMuon", jetComb.bTag(JetComb::kLep, JetComb::kSoftMuon));
0187   values.add("bTagLepBSimpSecondVtx", jetComb.bTag(JetComb::kLep, JetComb::kSimpleSecondVtx));
0188   values.add("bTagLepBCombSecondVtx", jetComb.bTag(JetComb::kLep, JetComb::kCombSecondVtx));
0189   values.add("bTagLepBImpactParaMVA", jetComb.bTag(JetComb::kLep, JetComb::kCombSecondVtxMVA));
0190   // summed b-tags of the two b quark candidates
0191   values.add("bTagSumTrkCntHighEff", jetComb.combinedBTags(JetComb::kTrackCountHighEff, JetComb::kAdd));
0192   values.add("bTagSumTrkCntHighPur", jetComb.combinedBTags(JetComb::kTrackCountHighPur, JetComb::kAdd));
0193   values.add("bTagSumSoftMuon", jetComb.combinedBTags(JetComb::kSoftMuon, JetComb::kAdd));
0194   values.add("bTagSumSimpSecondVtx", jetComb.combinedBTags(JetComb::kSimpleSecondVtx, JetComb::kAdd));
0195   values.add("bTagSumCombSecondVtx", jetComb.combinedBTags(JetComb::kCombSecondVtx, JetComb::kAdd));
0196   values.add("bTagSumImpactParaMVA", jetComb.combinedBTags(JetComb::kCombSecondVtxMVA, JetComb::kAdd));
0197   // multiplied b-tags of the two b quark candidates
0198   values.add("bTagProdImpactParaMVA", jetComb.combinedBTags(JetComb::kCombSecondVtxMVA, JetComb::kMult));
0199   // summed b-tags of the two light quark candidates
0200   values.add("bTagSumHadQHadQBarTrkCntHighEff",
0201              jetComb.combinedBTagsForLightQuarks(JetComb::kTrackCountHighEff, JetComb::kAdd));
0202   values.add("bTagSumHadQHadQBarTrkCntHighPur",
0203              jetComb.combinedBTagsForLightQuarks(JetComb::kTrackCountHighPur, JetComb::kAdd));
0204   values.add("bTagSumHadQHadQBarSoftMuon", jetComb.combinedBTagsForLightQuarks(JetComb::kSoftMuon, JetComb::kAdd));
0205   values.add("bTagSumHadQHadQBarSimpSecondVtx",
0206              jetComb.combinedBTagsForLightQuarks(JetComb::kSimpleSecondVtx, JetComb::kAdd));
0207   values.add("bTagSumHadQHadQBarCombSecondVtx",
0208              jetComb.combinedBTagsForLightQuarks(JetComb::kCombSecondVtx, JetComb::kAdd));
0209   values.add("bTagSumHadQHadQBarImpactParaMVA",
0210              jetComb.combinedBTagsForLightQuarks(JetComb::kCombSecondVtxMVA, JetComb::kAdd));
0211   // multiplied b-tags of the two light quark candidates
0212   values.add("bTagProdHadQHadQBarImpactParaMVA",
0213              jetComb.combinedBTagsForLightQuarks(JetComb::kCombSecondVtxMVA, JetComb::kMult));
0214 }
0215 
0216 #endif