Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 // copied TtSemiLRJetCombCalc.cc,v 1.4 2007/06/18 14:08:16 by heyninck
0002 //
0003 #include "TopQuarkAnalysis/TopJetCombination/interface/TtHadLRJetCombCalc.h"
0004 
0005 // constructor with path; default should not be used
0006 TtHadLRJetCombCalc::TtHadLRJetCombCalc(const TString& fitInputPath, const std::vector<int>& observables) {
0007   std::cout << "=== Constructing a TtHadLRJetCombCalc... " << std::endl;
0008   myLR = new LRHelpFunctions();
0009   addPurity = false;
0010   if (observables[0] == -1)
0011     addPurity = true;
0012   myLR->readObsHistsAndFits(fitInputPath, observables, addPurity);
0013   std::cout << "=== done." << std::endl;
0014 }
0015 
0016 TtHadLRJetCombCalc::~TtHadLRJetCombCalc() { delete myLR; }
0017 
0018 void TtHadLRJetCombCalc::operator()(TtHadEvtSolution& sol) {
0019   // find the used observables
0020   std::vector<double> obsVals;
0021   for (unsigned int o = 0; o < 100; o++) {
0022     if (myLR->obsFitIncluded(o)) {
0023       obsVals.push_back(sol.getLRJetCombObsVal(o));
0024     };
0025   }
0026 
0027   // calculate the logLR and the purity
0028   double logLR = myLR->calcLRval(obsVals);
0029   double prob = -999.;
0030   if (addPurity)
0031     prob = myLR->calcProb(logLR);
0032 
0033   // fill these values to the members in the TtHadEvtSolution
0034   sol.setLRJetCombLRval(logLR);
0035   sol.setLRJetCombProb(prob);
0036 }