CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC2_patch1/src/TopQuarkAnalysis/TopEventSelection/interface/TtFullHadSignalSel.h

Go to the documentation of this file.
00001 #ifndef TtFullHadSignalSel_h
00002 #define TtFullHadSignalSel_h
00003 
00004 #include <vector>
00005 #include "TMath.h"
00006 #include "Math/VectorUtil.h"
00007 
00008 #include "DataFormats/PatCandidates/interface/Jet.h"
00009 
00010 class TtFullHadSignalSel {
00011   // common calculator class for likelihood
00012   // variables in fully hadronic ttbar decays
00013 public:
00014 
00015   TtFullHadSignalSel();
00016   TtFullHadSignalSel(const std::vector<pat::Jet>&);
00017   ~TtFullHadSignalSel();
00018   
00019   double H()      const { return H_;      }
00020   double Ht()     const { return Ht_;     }
00021   double Ht123()  const { return Ht123_;  }
00022   double Ht3jet() const { return Ht3jet_; }
00023   double sqrt_s() const { return sqrt_s_; }
00024   double Et56()   const { return Et56_;   }
00025   double M3()     const { return M3_;     }
00026 
00027   double TCHE_Bjets()   const { return TCHE_Bjets_;   }
00028   double TCHP_Bjets()   const { return TCHP_Bjets_;   }
00029   double SSVHE_Bjets()  const { return SSVHE_Bjets_;  }
00030   double SSVHP_Bjets()  const { return SSVHP_Bjets_;  }
00031   double CSV_Bjets()    const { return CSV_Bjets_;    }
00032   double CSVMVA_Bjets() const { return CSVMVA_Bjets_; }
00033   double SM_Bjets()     const { return SM_Bjets_;     }
00034 
00035   double TCHE_Bjet  (unsigned short i) const { return (TCHE_BJet_Discs_  .size() >= i) ? TCHE_BJet_Discs_  .at(TCHE_BJet_Discs_  .size()-i) : -100.; }
00036   double TCHP_Bjet  (unsigned short i) const { return (TCHP_BJet_Discs_  .size() >= i) ? TCHP_BJet_Discs_  .at(TCHP_BJet_Discs_  .size()-i) : -100.; }
00037   double SSVHE_Bjet (unsigned short i) const { return (SSVHE_BJet_Discs_ .size() >= i) ? SSVHE_BJet_Discs_ .at(SSVHE_BJet_Discs_ .size()-i) : -100.; }
00038   double SSVHP_Bjet (unsigned short i) const { return (SSVHP_BJet_Discs_ .size() >= i) ? SSVHP_BJet_Discs_ .at(SSVHP_BJet_Discs_ .size()-i) : -100.; }
00039   double CSV_Bjet   (unsigned short i) const { return (CSV_BJet_Discs_   .size() >= i) ? CSV_BJet_Discs_   .at(CSV_BJet_Discs_   .size()-i) : -100.; }
00040   double CSVMVA_Bjet(unsigned short i) const { return (CSVMVA_BJet_Discs_.size() >= i) ? CSVMVA_BJet_Discs_.at(CSVMVA_BJet_Discs_.size()-i) : -100.; }
00041   double SM_Bjet    (unsigned short i) const { return (SM_BJet_Discs_    .size() >= i) ? SM_BJet_Discs_    .at(SM_BJet_Discs_    .size()-i) : -100.; }
00042 
00043   double pt(unsigned short i) const { return (pts_.size() >= i) ? pts_.at(i-1) : -1.; }
00044 
00045   double EtSin2Theta (unsigned short i, bool boosted=false) const { return boosted? ( (EtStars_     .size() >= i) ? EtStars_       .at(i-1)  : -1.) :
00046                                                                                       (EtSin2Thetas_.size() >= i) ? EtSin2Thetas_  .at(i-1)  : -1.; }
00047   double theta       (unsigned short i, bool boosted=false) const { return boosted? ( (thetaStars_  .size() >= i) ? thetaStars_    .at(i-1)  : -1.) :
00048                                                                                       (thetas_      .size() >= i) ? thetas_        .at(i-1)  : -1.; }
00049   double sinTheta    (unsigned short i, bool boosted=false) const { return boosted? ( (thetaStars_  .size() >= i) ? sin(thetaStars_.at(i-1)) : -1.) :
00050                                                                                       (thetas_      .size() >= i) ? sin(thetas_    .at(i-1)) : -1.; }
00051 
00052   double EtSin2Theta3jet(bool boosted=false) const { return boosted?       EtStar3jet_ : EtSin2Theta3jet_; }
00053   double theta3jet      (bool boosted=false) const { return boosted?    thetaStar3jet_ :       theta3jet_; }
00054   double sinTheta3jet   (bool boosted=false) const { return boosted? sinThetaStar3jet_ :    sinTheta3jet_; }
00055 
00056   double pti_ptj(unsigned short i, unsigned short j, bool norm=false) const { return (pts_.size() >= j) ? ( norm ? (pt(i) - pt(j))/(pt(i) + pt(j)) : (pt(i) - pt(j)) ) : -1.; }
00057 
00058   double jet_etaetaMoment(unsigned short i, bool noB=false) const { return noB? ( (etaetaMomentsNoB_.size()>= i)? etaetaMomentsNoB_.at(etaetaMomentsNoB_.size() - i) : -100.) :
00059                                                                                   (etaetaMoments_   .size()>= i)? etaetaMoments_   .at(etaetaMoments_   .size() - i) : -100.; }
00060   double jet_etaphiMoment(unsigned short i, bool noB=false) const { return noB? ( (etaphiMomentsNoB_.size()>= i)? etaphiMomentsNoB_.at(etaphiMomentsNoB_.size() - i) : -100.) :
00061                                                                                   (etaphiMoments_   .size()>= i)? etaphiMoments_   .at(etaphiMoments_   .size() - i) : -100.; }
00062   double jet_phiphiMoment(unsigned short i, bool noB=false) const { return noB? ( (phiphiMomentsNoB_.size()>= i)? phiphiMomentsNoB_.at(phiphiMomentsNoB_.size() - i) : -100.) :
00063                                                                                   (phiphiMoments_   .size()>= i)? phiphiMoments_   .at(phiphiMoments_   .size() - i) : -100.; }
00064 
00065   double jet_etaetaMomentMoment(unsigned short i) const { return (etaetaMomentsMoment_.size()>= i)? etaetaMomentsMoment_.at(etaetaMomentsMoment_.size() - i) : -100.; }
00066   double jet_etaphiMomentMoment(unsigned short i) const { return (etaphiMomentsMoment_.size()>= i)? etaphiMomentsMoment_.at(etaphiMomentsMoment_.size() - i) : -100.; }
00067   double jet_phiphiMomentMoment(unsigned short i) const { return (phiphiMomentsMoment_.size()>= i)? phiphiMomentsMoment_.at(phiphiMomentsMoment_.size() - i) : -100.; }
00068 
00069   double jets_etaetaMoment(bool noB=false) const { return noB ? jets_etaetaMomentNoB_ : jets_etaetaMoment_; }
00070   double jets_etaphiMoment(bool noB=false) const { return noB ? jets_etaphiMomentNoB_ : jets_etaphiMoment_; }
00071   double jets_phiphiMoment(bool noB=false) const { return noB ? jets_phiphiMomentNoB_ : jets_phiphiMoment_; }
00072 
00073   double jet_etaetaMomentLogEt(unsigned short i) const { return (etaetaMomentsLogEt_.size()>= i)? etaetaMomentsLogEt_.at(etaetaMomentsLogEt_.size() - i) : -100.; }
00074   double jet_etaphiMomentLogEt(unsigned short i) const { return (etaphiMomentsLogEt_.size()>= i)? etaphiMomentsLogEt_.at(etaphiMomentsLogEt_.size() - i) : -100.; }
00075   double jet_phiphiMomentLogEt(unsigned short i) const { return (phiphiMomentsLogEt_.size()>= i)? phiphiMomentsLogEt_.at(phiphiMomentsLogEt_.size() - i) : -100.; }
00076 
00077   double jet_etaetaMomentMomentLogEt(unsigned short i) const { return (etaetaMomentsMomentLogEt_.size()>= i)? etaetaMomentsMomentLogEt_.at(etaetaMomentsMomentLogEt_.size() - i) : -100.; }
00078   double jet_etaphiMomentMomentLogEt(unsigned short i) const { return (etaphiMomentsMomentLogEt_.size()>= i)? etaphiMomentsMomentLogEt_.at(etaphiMomentsMomentLogEt_.size() - i) : -100.; }
00079   double jet_phiphiMomentMomentLogEt(unsigned short i) const { return (phiphiMomentsMomentLogEt_.size()>= i)? phiphiMomentsMomentLogEt_.at(phiphiMomentsMomentLogEt_.size() - i) : -100.; }
00080 
00081   double jets_etaetaMomentLogEt() const { return jets_etaetaMomentLogEt_; }
00082   double jets_etaphiMomentLogEt() const { return jets_etaphiMomentLogEt_; }
00083   double jets_phiphiMomentLogEt() const { return jets_phiphiMomentLogEt_; }
00084 
00085   double aplanarity (bool allJets=false) const { return allJets ? aplanarityAll_  : aplanarity_;  }
00086   double sphericity (bool allJets=false) const { return allJets ? sphericityAll_  : sphericity_;  }
00087   double circularity(bool allJets=false) const { return allJets ? circularityAll_ : circularity_; }
00088   double isotropy   (bool allJets=false) const { return allJets ? isotropyAll_    : isotropy_;    }
00089   double C          (bool allJets=false) const { return allJets ? CAll_           : C_;           }
00090   double D          (bool allJets=false) const { return allJets ? DAll_           : D_;           }
00091 
00092   double aplanarityAllCMS () const { return aplanarityAllCMS_;  }
00093   double sphericityAllCMS () const { return sphericityAllCMS_;  }
00094   double circularityAllCMS() const { return circularityAllCMS_; }
00095   double isotropyAllCMS   () const { return isotropyAllCMS_;    }
00096   double CAllCMS          () const { return CAllCMS_;           }
00097   double DAllCMS          () const { return DAllCMS_;           }
00098 
00099   double centrality(bool alternative=false)  const { return alternative ? (Ht_/sqrt_s_) : (Ht_/H_); }
00100 
00101   double thrust(bool inCMS=false) const { return inCMS ? thrustCMS_ : thrust_; }
00102 
00103   double dRMin     (unsigned short i)  const { return (dR_     .size() >= i) ? dR_     .at(i-1) : -1.; }
00104   double dRMinMass (unsigned short i)  const { return (dRMass_ .size() >= i) ? dRMass_ .at(i-1) : -1.; }
00105   double dRMinAngle(unsigned short i)  const { return (dRAngle_.size() >= i) ? dRAngle_.at(i-1) : -1.; }
00106 
00107   double sumDR3JetMin    (unsigned short i) const { return (dR3Jets_        .size() >= i) ? dR3Jets_        .at(i-1) : -1.; }
00108   double sumDR3JetMinMass(unsigned short i) const { return (dR3JetsMass_    .size() >= i) ? dR3JetsMass_    .at(i-1) : -1.; }
00109   double massDiffMWCands (unsigned short i) const { return (massDiffMWCands_.size() >= i) ? massDiffMWCands_.at(i-1) : -1.; }
00110 
00111 private:
00112   
00113   double H_;
00114   double Ht_;
00115   double Ht123_;
00116   double Ht3jet_;
00117   double sqrt_s_;
00118   double Et56_;
00119   double M3_;
00120   
00121   double TCHE_Bjets_;
00122   double TCHP_Bjets_;
00123   double SSVHE_Bjets_;
00124   double SSVHP_Bjets_;
00125   double CSV_Bjets_;
00126   double CSVMVA_Bjets_;
00127   double SM_Bjets_;
00128 
00129   std::vector<double> TCHE_BJet_Discs_;
00130   std::vector<double> TCHP_BJet_Discs_;
00131   std::vector<double> SSVHE_BJet_Discs_;
00132   std::vector<double> SSVHP_BJet_Discs_;
00133   std::vector<double> CSV_BJet_Discs_;
00134   std::vector<double> CSVMVA_BJet_Discs_;
00135   std::vector<double> SM_BJet_Discs_;
00136 
00137   std::vector<double> pts_;
00138   std::vector<double> EtSin2Thetas_;
00139   std::vector<double> thetas_;
00140   std::vector<double> thetaStars_;
00141   std::vector<double> EtStars_;
00142 
00143   double EtSin2Theta3jet_;
00144   double theta3jet_;
00145   double thetaStar3jet_;
00146   double sinTheta3jet_;
00147   double sinThetaStar3jet_;
00148   double EtStar3jet_;
00149 
00150   std::vector<double> etaetaMoments_;
00151   std::vector<double> etaphiMoments_;
00152   std::vector<double> phiphiMoments_;
00153 
00154   std::vector<double> etaetaMomentsMoment_;
00155   std::vector<double> etaphiMomentsMoment_;
00156   std::vector<double> phiphiMomentsMoment_;
00157 
00158   std::vector<double> etaetaMomentsLogEt_;
00159   std::vector<double> etaphiMomentsLogEt_;
00160   std::vector<double> phiphiMomentsLogEt_;
00161 
00162   std::vector<double> etaetaMomentsMomentLogEt_;
00163   std::vector<double> etaphiMomentsMomentLogEt_;
00164   std::vector<double> phiphiMomentsMomentLogEt_;
00165 
00166   std::vector<double> etaetaMomentsNoB_;
00167   std::vector<double> etaphiMomentsNoB_;
00168   std::vector<double> phiphiMomentsNoB_;
00169 
00170   double jets_etaetaMoment_;
00171   double jets_etaphiMoment_;
00172   double jets_phiphiMoment_;
00173 
00174   double jets_etaetaMomentLogEt_;
00175   double jets_etaphiMomentLogEt_;
00176   double jets_phiphiMomentLogEt_;
00177 
00178   double jets_etaetaMomentNoB_;
00179   double jets_etaphiMomentNoB_;
00180   double jets_phiphiMomentNoB_;
00181 
00182   double aplanarity_;
00183   double sphericity_;
00184   double circularity_;
00185   double isotropy_;
00186   double C_;
00187   double D_;
00188 
00189   double aplanarityAll_;
00190   double sphericityAll_;
00191   double circularityAll_;
00192   double isotropyAll_;
00193   double CAll_;
00194   double DAll_;
00195 
00196   double aplanarityAllCMS_;
00197   double sphericityAllCMS_;
00198   double circularityAllCMS_;
00199   double isotropyAllCMS_;
00200   double CAllCMS_;
00201   double DAllCMS_;
00202 
00203   double thrust_;
00204   double thrustCMS_;
00205 
00206   std::vector<double> dR_;
00207   std::vector<double> dRMass_;
00208   std::vector<double> dRAngle_;
00209 
00210   std::vector<double> dR3Jets_;
00211   std::vector<double> dR3JetsMass_;
00212 
00213   std::vector<double> massDiffMWCands_;
00214 
00215 };
00216 
00217 #endif