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
TtHadLRSignalSelCalc Class Reference

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

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

Public Member Functions

void operator() (TtHadEvtSolution &)
 
 TtHadLRSignalSelCalc ()
 
 TtHadLRSignalSelCalc (const TString &, const std::vector< int > &)
 
 ~TtHadLRSignalSelCalc ()
 

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 - adapted hadronic version mfhansen

Definition at line 29 of file TtHadLRSignalSelCalc.h.

Constructor & Destructor Documentation

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

Definition at line 8 of file TtHadLRSignalSelCalc.cc.

References addPurity, gather_cfg::cout, and myLR.

9 {
10  std::cout << "=== Constructing a TtHadLRSignalSelCalc... " << 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
tuple cout
Definition: gather_cfg.py:121
TtHadLRSignalSelCalc::~TtHadLRSignalSelCalc ( )

Definition at line 18 of file TtHadLRSignalSelCalc.cc.

References myLR.

19 {
20  delete myLR;
21 }
LRHelpFunctions * myLR

Member Function Documentation

void TtHadLRSignalSelCalc::operator() ( TtHadEvtSolution sol)

Definition at line 23 of file TtHadLRSignalSelCalc.cc.

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

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

Member Data Documentation

bool TtHadLRSignalSelCalc::addPurity
private

Definition at line 41 of file TtHadLRSignalSelCalc.h.

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

LRHelpFunctions* TtHadLRSignalSelCalc::myLR
private

Definition at line 40 of file TtHadLRSignalSelCalc.h.

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