CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
TtSemiLRJetCombCalc Class Reference

Class to calculate the jet combination LR value and purity from a root-file with fit functions. More...

#include "TopQuarkAnalysis/TopLeptonSelection/interface/TtSemiLRJetCombCalc.h"

Public Member Functions

void operator() (TtSemiEvtSolution &)
 
 TtSemiLRJetCombCalc ()
 
 TtSemiLRJetCombCalc (const TString &, const std::vector< int > &)
 
 ~TtSemiLRJetCombCalc ()
 

Private Attributes

bool addPurity
 
LRHelpFunctionsmyLR
 

Detailed Description

Class to calculate the jet combination LR value and purity from a root-file with fit functions.

Author
Jan Heyninck
Version
Id
TtSemiLRJetCombCalc.h,v 1.4 2008/02/17 11:27:11 rwolf Exp

Definition at line 31 of file TtSemiLRJetCombCalc.h.

Constructor & Destructor Documentation

TtSemiLRJetCombCalc::TtSemiLRJetCombCalc ( )
TtSemiLRJetCombCalc::TtSemiLRJetCombCalc ( const TString &  fitInputPath,
const std::vector< int > &  observables 
)

Definition at line 9 of file TtSemiLRJetCombCalc.cc.

References addPurity, gather_cfg::cout, and myLR.

9  {
10  std::cout << "=== Constructing a TtSemiLRJetCombCalc... " << std::endl;
11  myLR = new LRHelpFunctions();
12  addPurity = false;
13  if(observables[0] == -1) addPurity = true;
14  myLR -> readObsHistsAndFits(fitInputPath, observables, addPurity);
15  std::cout << "=== done." << std::endl;
16 }
Help functionalities to implement and evaluate LR ratio method.
LRHelpFunctions * myLR
TtSemiLRJetCombCalc::~TtSemiLRJetCombCalc ( )

Definition at line 20 of file TtSemiLRJetCombCalc.cc.

References myLR.

20  {
21  delete myLR;
22 }
LRHelpFunctions * myLR

Member Function Documentation

void TtSemiLRJetCombCalc::operator() ( TtSemiEvtSolution sol)

Definition at line 25 of file TtSemiLRJetCombCalc.cc.

References addPurity, LRHelpFunctions::calcLRval(), LRHelpFunctions::calcProb(), TtSemiEvtSolution::getLRJetCombObsVal(), myLR, connectstrParser::o, LRHelpFunctions::obsFitIncluded(), TtFullHadEvtBuilder_cfi::prob, TtSemiEvtSolution::setLRJetCombLRval(), and TtSemiEvtSolution::setLRJetCombProb().

25  {
26 
27  // find the used observables
28  std::vector<double> obsVals;
29  for(unsigned int o = 0; o<100; o++){
30  if( myLR->obsFitIncluded(o) ) {obsVals.push_back(sol.getLRJetCombObsVal(o)); };
31  }
32 
33  // calculate the logLR and the purity
34  double logLR = myLR->calcLRval(obsVals);
35  double prob = -999.;
36  if(addPurity) prob = myLR->calcProb(logLR);
37 
38  // fill these values to the members in the TtSemiEvtSolution
39  sol.setLRJetCombLRval(logLR);
40  sol.setLRJetCombProb(prob);
41 }
double calcLRval(const std::vector< double > &)
double calcProb(double)
bool obsFitIncluded(int)
double getLRJetCombObsVal(unsigned int) const
void setLRJetCombProb(double plr)
void setLRJetCombLRval(double clr)
LRHelpFunctions * myLR

Member Data Documentation

bool TtSemiLRJetCombCalc::addPurity
private

Definition at line 43 of file TtSemiLRJetCombCalc.h.

Referenced by operator()(), and TtSemiLRJetCombCalc().

LRHelpFunctions* TtSemiLRJetCombCalc::myLR
private

Definition at line 42 of file TtSemiLRJetCombCalc.h.

Referenced by operator()(), TtSemiLRJetCombCalc(), and ~TtSemiLRJetCombCalc().