CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_2_9_HLT1_bphpatch4/src/TopQuarkAnalysis/TopJetCombination/src/TtHadLRJetCombCalc.cc

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