CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_4_5_patch3/src/TopQuarkAnalysis/TopJetCombination/interface/TtSemiLepJetComb.h

Go to the documentation of this file.
00001 #ifndef TtSemiLepJetComb_h
00002 #define TtSemiLepJetComb_h
00003 
00004 #include <vector>
00005 #include <string>
00006 
00007 #include "TMath.h"
00008 
00009 #include "DataFormats/PatCandidates/interface/Jet.h"
00010 #include "DataFormats/PatCandidates/interface/MET.h"
00011 
00012 namespace JetComb{
00015   enum DecayType {kHad, kLep};
00017   enum VarType   {kMass, kPt, kEta, kPhi, kTheta};
00019   enum CompType  {kDeltaM, kDeltaR, kDeltaPhi, kDeltaTheta};
00021   enum BTagAlgo  {kTrackCountHighEff, kTrackCountHighPur, kSoftMuon, kSoftMuonByPt, kSofMuonByIP3d, 
00022                   kSoftElec, kBProbability, kProbability, kSimpleSecondVtx, kCombSecondVtx, kCombSecondVtxMVA};
00024   enum Operator  {kAdd, kMult};
00025 }
00026 
00037 class TtSemiLepJetComb {
00038 
00039  public:
00040   
00042   TtSemiLepJetComb();
00044   TtSemiLepJetComb(const std::vector<pat::Jet>&, const std::vector<int>&, const math::XYZTLorentzVector&, const pat::MET&);
00046   ~TtSemiLepJetComb();
00047 
00049   double topVar(JetComb::DecayType decay, JetComb::VarType var) const;
00051   double wBosonVar(JetComb::DecayType decay, JetComb::VarType var) const;
00053   double bQuarkVar(JetComb::DecayType decay, JetComb::VarType var) const;
00055   double lightQVar(bool qbar, JetComb::VarType var) const;
00057   double leptonVar(JetComb::VarType var) const;
00059   double neutrinoVar(JetComb::VarType var) const;
00060 
00062   double compareHadTopLepTop(JetComb::CompType comp) const;
00064   double compareHadWLepW(JetComb::CompType comp) const;
00066   double compareHadBLepB(JetComb::CompType comp) const;
00068   double compareLightQuarks(JetComb::CompType comp) const;
00070   double compareLeptonNeutrino(JetComb::CompType comp) const;
00072   double compareTopW(JetComb::DecayType dec1, JetComb::DecayType dec2, JetComb::CompType comp) const;
00074   double compareTopB(JetComb::DecayType dec1, JetComb::DecayType dec2, JetComb::CompType comp) const;
00076   double compareWB(JetComb::DecayType dec1, JetComb::DecayType dec2, JetComb::CompType comp) const;
00078   double compareTopLepton(JetComb::DecayType decay, JetComb::CompType comp) const;
00080   double compareTopNeutrino(JetComb::DecayType decay, JetComb::CompType comp) const;
00082   double compareWLepton(JetComb::DecayType decay, JetComb::CompType comp) const;
00084   double compareWNeutrino(JetComb::DecayType decay, JetComb::CompType comp) const;
00086   double compareBLepton(JetComb::DecayType decay, JetComb::CompType comp) const;
00088   double compareBNeutrino(JetComb::DecayType decay, JetComb::CompType comp) const;
00089  
00093   double relativePtHadronicTop() const;
00096   double bOverLightQPt() const;
00097 
00099   double bTag(JetComb::DecayType decay, JetComb::BTagAlgo algo) const { return bTag(bQuark(decay), algo); };
00101   double combinedBTags(JetComb::BTagAlgo algo, JetComb::Operator op) const;
00103   double combinedBTagsForLightQuarks(JetComb::BTagAlgo algo, JetComb::Operator op) const;
00104 
00106   double addUserVar(std::string key, double value) { return userVariables_[key]=value;};
00108   double userVar(const std::string& key) const {
00109     return (userVariables_.find(key)!=userVariables_.end() ? userVariables_.find(key)->second : -9999.);};
00110 
00111  private:
00112 
00114   void deduceMothers();
00116   double bTag(const pat::Jet& jet, JetComb::BTagAlgo algo) const;
00118   double lightQVar(JetComb::VarType var) const { return lightQVar(false, var); };
00120   const pat::Jet& lightQ(bool qbar=false) const { return (qbar ? hadQBarJet_ : hadQJet_); }
00122   const pat::Jet& bQuark(JetComb::DecayType decay) const { return (decay==JetComb::kHad ? hadBJet_ : lepBJet_); }
00124   const math::XYZTLorentzVector& wBoson(JetComb::DecayType decay) const { return (decay==JetComb::kHad ? hadW_ : lepW_); }
00126   const math::XYZTLorentzVector& top(JetComb::DecayType decay) const { return (decay==JetComb::kHad ? hadTop_ : lepTop_); }  
00127 
00128  private:
00129 
00131   pat::Jet hadQJet_;
00133   pat::Jet hadQBarJet_;
00135   pat::Jet hadBJet_;
00137   pat::Jet lepBJet_;
00139   pat::MET neutrino_;
00141   math::XYZTLorentzVector lepton_;
00143   math::XYZTLorentzVector hadTop_;
00145   math::XYZTLorentzVector hadW_;
00147   math::XYZTLorentzVector lepTop_;
00149   math::XYZTLorentzVector lepW_;
00151   std::map<std::string, double> userVariables_;
00152 };
00153 
00154 #endif