Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-06-11 04:40:42

0001 #ifndef TtFullHadSignalSel_h
0002 #define TtFullHadSignalSel_h
0003 
0004 #include <vector>
0005 #include "TMath.h"
0006 #include "Math/VectorUtil.h"
0007 
0008 #include "DataFormats/PatCandidates/interface/Jet.h"
0009 
0010 class TtFullHadSignalSel {
0011   // common calculator class for likelihood
0012   // variables in fully hadronic ttbar decays
0013 public:
0014   TtFullHadSignalSel();
0015   TtFullHadSignalSel(const std::vector<pat::Jet>&);
0016   ~TtFullHadSignalSel();
0017 
0018   double H() const { return H_; }
0019   double Ht() const { return Ht_; }
0020   double Ht123() const { return Ht123_; }
0021   double Ht3jet() const { return Ht3jet_; }
0022   double sqrt_s() const { return sqrt_s_; }
0023   double Et56() const { return Et56_; }
0024   double M3() const { return M3_; }
0025 
0026   double TCHE_Bjets() const { return TCHE_Bjets_; }
0027   double TCHP_Bjets() const { return TCHP_Bjets_; }
0028   double SSVHE_Bjets() const { return SSVHE_Bjets_; }
0029   double SSVHP_Bjets() const { return SSVHP_Bjets_; }
0030   double CSV_Bjets() const { return CSV_Bjets_; }
0031   double CSVMVA_Bjets() const { return CSVMVA_Bjets_; }
0032   double SM_Bjets() const { return SM_Bjets_; }
0033 
0034   double TCHE_Bjet(unsigned short i) const {
0035     return (TCHE_BJet_Discs_.size() >= i) ? TCHE_BJet_Discs_.at(TCHE_BJet_Discs_.size() - i) : -100.;
0036   }
0037   double TCHP_Bjet(unsigned short i) const {
0038     return (TCHP_BJet_Discs_.size() >= i) ? TCHP_BJet_Discs_.at(TCHP_BJet_Discs_.size() - i) : -100.;
0039   }
0040   double SSVHE_Bjet(unsigned short i) const {
0041     return (SSVHE_BJet_Discs_.size() >= i) ? SSVHE_BJet_Discs_.at(SSVHE_BJet_Discs_.size() - i) : -100.;
0042   }
0043   double SSVHP_Bjet(unsigned short i) const {
0044     return (SSVHP_BJet_Discs_.size() >= i) ? SSVHP_BJet_Discs_.at(SSVHP_BJet_Discs_.size() - i) : -100.;
0045   }
0046   double CSV_Bjet(unsigned short i) const {
0047     return (CSV_BJet_Discs_.size() >= i) ? CSV_BJet_Discs_.at(CSV_BJet_Discs_.size() - i) : -100.;
0048   }
0049   double CSVMVA_Bjet(unsigned short i) const {
0050     return (CSVMVA_BJet_Discs_.size() >= i) ? CSVMVA_BJet_Discs_.at(CSVMVA_BJet_Discs_.size() - i) : -100.;
0051   }
0052   double SM_Bjet(unsigned short i) const {
0053     return (SM_BJet_Discs_.size() >= i) ? SM_BJet_Discs_.at(SM_BJet_Discs_.size() - i) : -100.;
0054   }
0055 
0056   double pt(unsigned short i) const { return (pts_.size() >= i) ? pts_.at(i - 1) : -1.; }
0057 
0058   double EtSin2Theta(unsigned short i, bool boosted = false) const {
0059     return boosted                       ? ((EtStars_.size() >= i) ? EtStars_.at(i - 1) : -1.)
0060            : (EtSin2Thetas_.size() >= i) ? EtSin2Thetas_.at(i - 1)
0061                                          : -1.;
0062   }
0063   double theta(unsigned short i, bool boosted = false) const {
0064     return boosted                 ? ((thetaStars_.size() >= i) ? thetaStars_.at(i - 1) : -1.)
0065            : (thetas_.size() >= i) ? thetas_.at(i - 1)
0066                                    : -1.;
0067   }
0068   double sinTheta(unsigned short i, bool boosted = false) const {
0069     return boosted                 ? ((thetaStars_.size() >= i) ? sin(thetaStars_.at(i - 1)) : -1.)
0070            : (thetas_.size() >= i) ? sin(thetas_.at(i - 1))
0071                                    : -1.;
0072   }
0073 
0074   double EtSin2Theta3jet(bool boosted = false) const { return boosted ? EtStar3jet_ : EtSin2Theta3jet_; }
0075   double theta3jet(bool boosted = false) const { return boosted ? thetaStar3jet_ : theta3jet_; }
0076   double sinTheta3jet(bool boosted = false) const { return boosted ? sinThetaStar3jet_ : sinTheta3jet_; }
0077 
0078   double pti_ptj(unsigned short i, unsigned short j, bool norm = false) const {
0079     return (pts_.size() >= j) ? (norm ? (pt(i) - pt(j)) / (pt(i) + pt(j)) : (pt(i) - pt(j))) : -1.;
0080   }
0081 
0082   double jet_etaetaMoment(unsigned short i, bool noB = false) const {
0083     return noB ? ((etaetaMomentsNoB_.size() >= i) ? etaetaMomentsNoB_.at(etaetaMomentsNoB_.size() - i) : -100.)
0084            : (etaetaMoments_.size() >= i) ? etaetaMoments_.at(etaetaMoments_.size() - i)
0085                                           : -100.;
0086   }
0087   double jet_etaphiMoment(unsigned short i, bool noB = false) const {
0088     return noB ? ((etaphiMomentsNoB_.size() >= i) ? etaphiMomentsNoB_.at(etaphiMomentsNoB_.size() - i) : -100.)
0089            : (etaphiMoments_.size() >= i) ? etaphiMoments_.at(etaphiMoments_.size() - i)
0090                                           : -100.;
0091   }
0092   double jet_phiphiMoment(unsigned short i, bool noB = false) const {
0093     return noB ? ((phiphiMomentsNoB_.size() >= i) ? phiphiMomentsNoB_.at(phiphiMomentsNoB_.size() - i) : -100.)
0094            : (phiphiMoments_.size() >= i) ? phiphiMoments_.at(phiphiMoments_.size() - i)
0095                                           : -100.;
0096   }
0097 
0098   double jet_etaetaMomentMoment(unsigned short i) const {
0099     return (etaetaMomentsMoment_.size() >= i) ? etaetaMomentsMoment_.at(etaetaMomentsMoment_.size() - i) : -100.;
0100   }
0101   double jet_etaphiMomentMoment(unsigned short i) const {
0102     return (etaphiMomentsMoment_.size() >= i) ? etaphiMomentsMoment_.at(etaphiMomentsMoment_.size() - i) : -100.;
0103   }
0104   double jet_phiphiMomentMoment(unsigned short i) const {
0105     return (phiphiMomentsMoment_.size() >= i) ? phiphiMomentsMoment_.at(phiphiMomentsMoment_.size() - i) : -100.;
0106   }
0107 
0108   double jets_etaetaMoment(bool noB = false) const { return noB ? jets_etaetaMomentNoB_ : jets_etaetaMoment_; }
0109   double jets_etaphiMoment(bool noB = false) const { return noB ? jets_etaphiMomentNoB_ : jets_etaphiMoment_; }
0110   double jets_phiphiMoment(bool noB = false) const { return noB ? jets_phiphiMomentNoB_ : jets_phiphiMoment_; }
0111 
0112   double jet_etaetaMomentLogEt(unsigned short i) const {
0113     return (etaetaMomentsLogEt_.size() >= i) ? etaetaMomentsLogEt_.at(etaetaMomentsLogEt_.size() - i) : -100.;
0114   }
0115   double jet_etaphiMomentLogEt(unsigned short i) const {
0116     return (etaphiMomentsLogEt_.size() >= i) ? etaphiMomentsLogEt_.at(etaphiMomentsLogEt_.size() - i) : -100.;
0117   }
0118   double jet_phiphiMomentLogEt(unsigned short i) const {
0119     return (phiphiMomentsLogEt_.size() >= i) ? phiphiMomentsLogEt_.at(phiphiMomentsLogEt_.size() - i) : -100.;
0120   }
0121 
0122   double jet_etaetaMomentMomentLogEt(unsigned short i) const {
0123     return (etaetaMomentsMomentLogEt_.size() >= i) ? etaetaMomentsMomentLogEt_.at(etaetaMomentsMomentLogEt_.size() - i)
0124                                                    : -100.;
0125   }
0126   double jet_etaphiMomentMomentLogEt(unsigned short i) const {
0127     return (etaphiMomentsMomentLogEt_.size() >= i) ? etaphiMomentsMomentLogEt_.at(etaphiMomentsMomentLogEt_.size() - i)
0128                                                    : -100.;
0129   }
0130   double jet_phiphiMomentMomentLogEt(unsigned short i) const {
0131     return (phiphiMomentsMomentLogEt_.size() >= i) ? phiphiMomentsMomentLogEt_.at(phiphiMomentsMomentLogEt_.size() - i)
0132                                                    : -100.;
0133   }
0134 
0135   double jets_etaetaMomentLogEt() const { return jets_etaetaMomentLogEt_; }
0136   double jets_etaphiMomentLogEt() const { return jets_etaphiMomentLogEt_; }
0137   double jets_phiphiMomentLogEt() const { return jets_phiphiMomentLogEt_; }
0138 
0139   double aplanarity(bool allJets = false) const { return allJets ? aplanarityAll_ : aplanarity_; }
0140   double sphericity(bool allJets = false) const { return allJets ? sphericityAll_ : sphericity_; }
0141   double circularity(bool allJets = false) const { return allJets ? circularityAll_ : circularity_; }
0142   double isotropy(bool allJets = false) const { return allJets ? isotropyAll_ : isotropy_; }
0143   double C(bool allJets = false) const { return allJets ? CAll_ : C_; }
0144   double D(bool allJets = false) const { return allJets ? DAll_ : D_; }
0145 
0146   double aplanarityAllCMS() const { return aplanarityAllCMS_; }
0147   double sphericityAllCMS() const { return sphericityAllCMS_; }
0148   double circularityAllCMS() const { return circularityAllCMS_; }
0149   double isotropyAllCMS() const { return isotropyAllCMS_; }
0150   double CAllCMS() const { return CAllCMS_; }
0151   double DAllCMS() const { return DAllCMS_; }
0152 
0153   double centrality(bool alternative = false) const { return alternative ? (Ht_ / sqrt_s_) : (Ht_ / H_); }
0154 
0155   double thrust(bool inCMS = false) const { return inCMS ? thrustCMS_ : thrust_; }
0156 
0157   double dRMin(unsigned short i) const { return (dR_.size() >= i) ? dR_.at(i - 1) : -1.; }
0158   double dRMinMass(unsigned short i) const { return (dRMass_.size() >= i) ? dRMass_.at(i - 1) : -1.; }
0159   double dRMinAngle(unsigned short i) const { return (dRAngle_.size() >= i) ? dRAngle_.at(i - 1) : -1.; }
0160 
0161   double sumDR3JetMin(unsigned short i) const { return (dR3Jets_.size() >= i) ? dR3Jets_.at(i - 1) : -1.; }
0162   double sumDR3JetMinMass(unsigned short i) const { return (dR3JetsMass_.size() >= i) ? dR3JetsMass_.at(i - 1) : -1.; }
0163   double massDiffMWCands(unsigned short i) const {
0164     return (massDiffMWCands_.size() >= i) ? massDiffMWCands_.at(i - 1) : -1.;
0165   }
0166 
0167 private:
0168   double H_;
0169   double Ht_;
0170   double Ht123_;
0171   double Ht3jet_;
0172   double sqrt_s_;
0173   double Et56_;
0174   double M3_;
0175 
0176   double TCHE_Bjets_;
0177   double TCHP_Bjets_;
0178   double SSVHE_Bjets_;
0179   double SSVHP_Bjets_;
0180   double CSV_Bjets_;
0181   double CSVMVA_Bjets_;
0182   double SM_Bjets_;
0183 
0184   std::vector<double> TCHE_BJet_Discs_;
0185   std::vector<double> TCHP_BJet_Discs_;
0186   std::vector<double> SSVHE_BJet_Discs_;
0187   std::vector<double> SSVHP_BJet_Discs_;
0188   std::vector<double> CSV_BJet_Discs_;
0189   std::vector<double> CSVMVA_BJet_Discs_;
0190   std::vector<double> SM_BJet_Discs_;
0191 
0192   std::vector<double> pts_;
0193   std::vector<double> EtSin2Thetas_;
0194   std::vector<double> thetas_;
0195   std::vector<double> thetaStars_;
0196   std::vector<double> EtStars_;
0197 
0198   double EtSin2Theta3jet_;
0199   double theta3jet_;
0200   double thetaStar3jet_;
0201   double sinTheta3jet_;
0202   double sinThetaStar3jet_;
0203   double EtStar3jet_;
0204 
0205   std::vector<double> etaetaMoments_;
0206   std::vector<double> etaphiMoments_;
0207   std::vector<double> phiphiMoments_;
0208 
0209   std::vector<double> etaetaMomentsMoment_;
0210   std::vector<double> etaphiMomentsMoment_;
0211   std::vector<double> phiphiMomentsMoment_;
0212 
0213   std::vector<double> etaetaMomentsLogEt_;
0214   std::vector<double> etaphiMomentsLogEt_;
0215   std::vector<double> phiphiMomentsLogEt_;
0216 
0217   std::vector<double> etaetaMomentsMomentLogEt_;
0218   std::vector<double> etaphiMomentsMomentLogEt_;
0219   std::vector<double> phiphiMomentsMomentLogEt_;
0220 
0221   std::vector<double> etaetaMomentsNoB_;
0222   std::vector<double> etaphiMomentsNoB_;
0223   std::vector<double> phiphiMomentsNoB_;
0224 
0225   double jets_etaetaMoment_;
0226   double jets_etaphiMoment_;
0227   double jets_phiphiMoment_;
0228 
0229   double jets_etaetaMomentLogEt_;
0230   double jets_etaphiMomentLogEt_;
0231   double jets_phiphiMomentLogEt_;
0232 
0233   double jets_etaetaMomentNoB_;
0234   double jets_etaphiMomentNoB_;
0235   double jets_phiphiMomentNoB_;
0236 
0237   double aplanarity_;
0238   double sphericity_;
0239   double circularity_;
0240   double isotropy_;
0241   double C_;
0242   double D_;
0243 
0244   double aplanarityAll_;
0245   double sphericityAll_;
0246   double circularityAll_;
0247   double isotropyAll_;
0248   double CAll_;
0249   double DAll_;
0250 
0251   double aplanarityAllCMS_;
0252   double sphericityAllCMS_;
0253   double circularityAllCMS_;
0254   double isotropyAllCMS_;
0255   double CAllCMS_;
0256   double DAllCMS_;
0257 
0258   double thrust_;
0259   double thrustCMS_;
0260 
0261   std::vector<double> dR_;
0262   std::vector<double> dRMass_;
0263   std::vector<double> dRAngle_;
0264 
0265   std::vector<double> dR3Jets_;
0266   std::vector<double> dR3JetsMass_;
0267 
0268   std::vector<double> massDiffMWCands_;
0269 };
0270 
0271 #endif