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