File indexing completed on 2023-03-17 10:40:54
0001
0002
0003
0004
0005 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0006 #include "AnalysisDataFormats/TopObjects/interface/TtHadEvtSolution.h"
0007
0008 TtHadEvtSolution::TtHadEvtSolution() {
0009 jetCorrScheme_ = 0;
0010 sumAnglejp_ = -999.;
0011 angleHadp_ = -999.;
0012 angleHadq_ = -999.;
0013 angleHadb_ = -999.;
0014 angleHadj_ = -999.;
0015 angleHadk_ = -999.;
0016 angleHadbbar_ = -999.;
0017 changeW1Q_ = -999;
0018 changeW2Q_ = -999;
0019 probChi2_ = -999.;
0020 mcBestJetComb_ = -999;
0021 simpleBestJetComb_ = -999;
0022 lrBestJetComb_ = -999;
0023 lrJetCombLRval_ = -999.;
0024 lrJetCombProb_ = -999.;
0025 lrSignalEvtLRval_ = -999.;
0026 lrSignalEvtProb_ = -999.;
0027 }
0028
0029 TtHadEvtSolution::~TtHadEvtSolution() {}
0030
0031
0032
0033
0034 pat::Jet TtHadEvtSolution::getHadb() const {
0035
0036
0037 if (jetCorrScheme_ == 1) {
0038
0039 return hadb_->correctedJet("HAD", "B");
0040 } else if (jetCorrScheme_ == 2) {
0041 return hadb_->correctedJet("HAD", "B");
0042 } else {
0043 return *hadb_;
0044 }
0045 }
0046
0047 pat::Jet TtHadEvtSolution::getHadp() const {
0048
0049
0050 if (jetCorrScheme_ == 1) {
0051
0052 return hadp_->correctedJet("HAD", "UDS");
0053 } else if (jetCorrScheme_ == 2) {
0054 return hadp_->correctedJet("HAD", "UDS");
0055 } else {
0056 return *hadp_;
0057 }
0058 }
0059
0060 pat::Jet TtHadEvtSolution::getHadq() const {
0061
0062
0063 if (jetCorrScheme_ == 1) {
0064
0065 return hadq_->correctedJet("HAD", "UDS");
0066 } else if (jetCorrScheme_ == 2) {
0067 return hadq_->correctedJet("HAD", "UDS");
0068 } else {
0069 return *hadq_;
0070 }
0071 }
0072
0073 pat::Jet TtHadEvtSolution::getHadbbar() const {
0074
0075
0076 if (jetCorrScheme_ == 1) {
0077
0078 return hadbbar_->correctedJet("HAD", "B");
0079 } else if (jetCorrScheme_ == 2) {
0080 return hadbbar_->correctedJet("HAD", "B");
0081 } else {
0082 return *hadbbar_;
0083 }
0084 }
0085
0086 pat::Jet TtHadEvtSolution::getHadj() const {
0087
0088
0089 if (jetCorrScheme_ == 1) {
0090
0091 return hadj_->correctedJet("HAD", "UDS");
0092 } else if (jetCorrScheme_ == 2) {
0093 return hadj_->correctedJet("HAD", "UDS");
0094 } else {
0095 return *hadj_;
0096 }
0097 }
0098
0099 pat::Jet TtHadEvtSolution::getHadk() const {
0100
0101
0102 if (jetCorrScheme_ == 1) {
0103
0104 return hadk_->correctedJet("HAD", "UDS");
0105 } else if (jetCorrScheme_ == 2) {
0106 return hadk_->correctedJet("HAD", "UDS");
0107 } else {
0108 return *hadk_;
0109 }
0110 }
0111
0112
0113
0114
0115
0116
0117
0118 reco::Particle TtHadEvtSolution::getRecHadt() const {
0119
0120 return reco::Particle(0, this->getRecHadp().p4() + this->getRecHadq().p4() + this->getRecHadb().p4());
0121 }
0122
0123 reco::Particle TtHadEvtSolution::getRecHadtbar() const {
0124
0125 return reco::Particle(0, this->getRecHadj().p4() + this->getRecHadk().p4() + this->getRecHadbbar().p4());
0126 }
0127
0128 reco::Particle TtHadEvtSolution::getRecHadW_plus() const {
0129
0130 return reco::Particle(0, this->getRecHadp().p4() + this->getRecHadq().p4());
0131 }
0132
0133 reco::Particle TtHadEvtSolution::getRecHadW_minus() const {
0134
0135 return reco::Particle(0, this->getRecHadj().p4() + this->getRecHadk().p4());
0136 }
0137
0138 reco::Particle TtHadEvtSolution::getCalHadt() const {
0139 return reco::Particle(0, this->getCalHadp().p4() + this->getCalHadq().p4() + this->getCalHadb().p4());
0140 }
0141
0142 reco::Particle TtHadEvtSolution::getCalHadtbar() const {
0143 return reco::Particle(0, this->getCalHadj().p4() + this->getCalHadk().p4() + this->getCalHadbbar().p4());
0144 }
0145
0146 reco::Particle TtHadEvtSolution::getCalHadW_plus() const {
0147 return reco::Particle(0, this->getCalHadp().p4() + this->getCalHadq().p4());
0148 }
0149
0150 reco::Particle TtHadEvtSolution::getCalHadW_minus() const {
0151 return reco::Particle(0, this->getCalHadj().p4() + this->getCalHadk().p4());
0152 }
0153
0154
0155
0156
0157 reco::Particle TtHadEvtSolution::getFitHadt() const {
0158
0159 return reco::Particle(0, this->getFitHadp().p4() + this->getFitHadq().p4() + this->getFitHadb().p4());
0160 }
0161
0162 reco::Particle TtHadEvtSolution::getFitHadtbar() const {
0163
0164 return reco::Particle(0, this->getFitHadj().p4() + this->getFitHadk().p4() + this->getFitHadbbar().p4());
0165 }
0166
0167 reco::Particle TtHadEvtSolution::getFitHadW_plus() const {
0168
0169 return reco::Particle(0, this->getFitHadp().p4() + this->getFitHadq().p4());
0170 }
0171
0172 reco::Particle TtHadEvtSolution::getFitHadW_minus() const {
0173
0174 return reco::Particle(0, this->getFitHadj().p4() + this->getFitHadk().p4());
0175 }
0176
0177
0178
0179
0180
0181 double TtHadEvtSolution::getLRSignalEvtObsVal(unsigned int selObs) const {
0182 double val = -999.;
0183 for (size_t o = 0; o < lrSignalEvtVarVal_.size(); o++) {
0184 if (lrSignalEvtVarVal_[o].first == selObs)
0185 val = lrSignalEvtVarVal_[o].second;
0186 }
0187 return val;
0188 }
0189
0190
0191
0192
0193
0194 double TtHadEvtSolution::getLRJetCombObsVal(unsigned int selObs) const {
0195 double val = -999.;
0196 for (size_t o = 0; o < lrJetCombVarVal_.size(); o++) {
0197 if (lrJetCombVarVal_[o].first == selObs)
0198 val = lrJetCombVarVal_[o].second;
0199 }
0200 return val;
0201 }
0202
0203
0204
0205
0206 void TtHadEvtSolution::setGenEvt(const edm::Handle<TtGenEvent>& aGenEvt) {
0207 if (!aGenEvt->isFullHadronic()) {
0208 edm::LogWarning("TtGenEventNotFilled") << "genEvt is not fully hadronic; TtGenEvent is not filled";
0209 return;
0210 }
0211 theGenEvt_ = edm::RefProd<TtGenEvent>(aGenEvt);
0212 }
0213
0214
0215
0216
0217
0218 void TtHadEvtSolution::setLRJetCombObservables(const std::vector<std::pair<unsigned int, double> >& varval) {
0219 lrJetCombVarVal_.clear();
0220 for (size_t ijc = 0; ijc < varval.size(); ijc++)
0221 lrJetCombVarVal_.push_back(varval[ijc]);
0222 }
0223
0224
0225
0226
0227
0228 void TtHadEvtSolution::setLRSignalEvtObservables(const std::vector<std::pair<unsigned int, double> >& varval) {
0229 lrSignalEvtVarVal_.clear();
0230 for (size_t ise = 0; ise < varval.size(); ise++)
0231 lrSignalEvtVarVal_.push_back(varval[ise]);
0232 }