CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
TtSemiLRSignalSelCalc Class Reference

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

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

Public Member Functions

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

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:
TtSemiLRSignalSelCalc.h,v 1.3 2013/05/28 17:54:36 gartung Exp

Definition at line 32 of file TtSemiLRSignalSelCalc.h.

Constructor & Destructor Documentation

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

Definition at line 10 of file TtSemiLRSignalSelCalc.cc.

References addPurity, gather_cfg::cout, and myLR.

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

Definition at line 20 of file TtSemiLRSignalSelCalc.cc.

References myLR.

21 {
22  delete myLR;
23 }

Member Function Documentation

void TtSemiLRSignalSelCalc::operator() ( TtSemiEvtSolution sol)

Definition at line 25 of file TtSemiLRSignalSelCalc.cc.

References addPurity, LRHelpFunctions::calcLRval(), LRHelpFunctions::calcProb(), TtSemiEvtSolution::getLRSignalEvtObsVal(), myLR, python.connectstrParser::o, LRHelpFunctions::obsFitIncluded(), mix_2012_Summer_inTimeOnly_cff::prob, TtSemiEvtSolution::setLRSignalEvtLRval(), and TtSemiEvtSolution::setLRSignalEvtProb().

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.getLRSignalEvtObsVal(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.setLRSignalEvtLRval(logLR);
40  sol.setLRSignalEvtProb(prob);
41 }
double calcLRval(const std::vector< double > &)
void setLRSignalEvtLRval(double clr)
double getLRSignalEvtObsVal(unsigned int) const
double calcProb(double)
bool obsFitIncluded(int)
void setLRSignalEvtProb(double plr)

Member Data Documentation

bool TtSemiLRSignalSelCalc::addPurity
private

Definition at line 45 of file TtSemiLRSignalSelCalc.h.

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

LRHelpFunctions* TtSemiLRSignalSelCalc::myLR
private