File indexing completed on 2024-04-06 12:31:16
0001
0002
0003
0004 #include "TopQuarkAnalysis/TopEventSelection/interface/TtHadLRSignalSelCalc.h"
0005
0006
0007 TtHadLRSignalSelCalc::TtHadLRSignalSelCalc(const TString& fitInputPath, const std::vector<int>& observables) {
0008 std::cout << "=== Constructing a TtHadLRSignalSelCalc... " << std::endl;
0009 myLR = new LRHelpFunctions();
0010 addPurity = false;
0011 if (observables[0] == -1)
0012 addPurity = true;
0013 myLR->readObsHistsAndFits(fitInputPath, observables, addPurity);
0014 std::cout << "=== done." << std::endl;
0015 }
0016
0017 TtHadLRSignalSelCalc::~TtHadLRSignalSelCalc() { delete myLR; }
0018
0019 void TtHadLRSignalSelCalc::operator()(TtHadEvtSolution& sol) {
0020
0021 std::vector<double> obsVals;
0022 for (unsigned int o = 0; o < 100; o++) {
0023 if (myLR->obsFitIncluded(o))
0024 obsVals.push_back(sol.getLRSignalEvtObsVal(o));
0025 }
0026
0027
0028 double logLR = myLR->calcLRval(obsVals);
0029 double prob = -999.;
0030 if (addPurity)
0031 prob = myLR->calcProb(logLR);
0032
0033
0034 sol.setLRSignalEvtLRval(logLR);
0035 sol.setLRSignalEvtProb(prob);
0036 }