CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch12/src/TopQuarkAnalysis/TopEventSelection/src/TtHadLRSignalSelCalc.cc

Go to the documentation of this file.
00001 // $Id: TtHadLRSignalSelCalc.cc,v 1.2 2008/02/17 11:18:10 rwolf Exp $
00002 // copied TtSemiLRSignalSelCalc.cc,v 1.2 2007/06/18 14:12:18 heyninck Exp 
00003 // for fully hadronic channel
00004 
00005 #include "TopQuarkAnalysis/TopEventSelection/interface/TtHadLRSignalSelCalc.h"
00006 
00007 // constructor with path; default should not be used
00008 TtHadLRSignalSelCalc::TtHadLRSignalSelCalc(TString fitInputPath, std::vector<int> observables) 
00009 {
00010   std::cout << "=== Constructing a TtHadLRSignalSelCalc... " << std::endl; 
00011   myLR = new LRHelpFunctions();
00012   addPurity = false;
00013   if(observables[0] == -1) addPurity = true;
00014   myLR -> readObsHistsAndFits(fitInputPath, observables, addPurity);
00015   std::cout << "=== done." << std::endl;
00016 }
00017 
00018 TtHadLRSignalSelCalc::~TtHadLRSignalSelCalc() 
00019 {
00020   delete myLR;
00021 }
00022 
00023 void  TtHadLRSignalSelCalc::operator()(TtHadEvtSolution & sol)
00024 {
00025   // find the used observables
00026   std::vector<double> obsVals;
00027   for(unsigned int o = 0; o<100; o++){
00028     if( myLR->obsFitIncluded(o) ) obsVals.push_back(sol.getLRSignalEvtObsVal(o)); 
00029   }
00030   
00031   // calculate the logLR and the purity
00032   double logLR = myLR->calcLRval(obsVals);
00033   double prob  = -999.;
00034   if(addPurity) prob = myLR->calcProb(logLR);
00035   
00036   // fill these values to the members in the TtHadEvtSolution
00037   sol.setLRSignalEvtLRval(logLR);
00038   sol.setLRSignalEvtProb(prob);
00039 }