Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:31:21

0001 //
0002 // Author:  Jan Heyninck
0003 // Created: Tue Apr  3 17:33:23 PDT 2007
0004 //
0005 //
0006 #include "TopQuarkAnalysis/TopJetCombination/interface/TtSemiLRJetCombCalc.h"
0007 
0008 // constructor with path; default should not be used
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 // destructor
0020 TtSemiLRJetCombCalc::~TtSemiLRJetCombCalc() { delete myLR; }
0021 
0022 void TtSemiLRJetCombCalc::operator()(TtSemiEvtSolution& sol) {
0023   // find the used observables
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   // calculate the logLR and the purity
0032   double logLR = myLR->calcLRval(obsVals);
0033   double prob = -999.;
0034   if (addPurity)
0035     prob = myLR->calcProb(logLR);
0036 
0037   // fill these values to the members in the TtSemiEvtSolution
0038   sol.setLRJetCombLRval(logLR);
0039   sol.setLRJetCombProb(prob);
0040 }