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