Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 // copied TtSemiLRSignalSelCalc.cc,v 1.2 2007/06/18 14:12:18 heyninck Exp
0002 // for fully hadronic channel
0003 
0004 #include "TopQuarkAnalysis/TopEventSelection/interface/TtHadLRSignalSelCalc.h"
0005 
0006 // constructor with path; default should not be used
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   // find the used observables
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   // 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.setLRSignalEvtLRval(logLR);
0035   sol.setLRSignalEvtProb(prob);
0036 }