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

#include <TtHadLRJetCombCalc.h>

Public Member Functions

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

Private Attributes

bool addPurity
 
LRHelpFunctionsmyLR
 

Detailed Description

Definition at line 18 of file TtHadLRJetCombCalc.h.

Constructor & Destructor Documentation

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

Definition at line 6 of file TtHadLRJetCombCalc.cc.

References addPurity, gather_cfg::cout, and myLR.

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

Definition at line 16 of file TtHadLRJetCombCalc.cc.

References myLR.

17 {
18  delete myLR;
19 }
LRHelpFunctions * myLR

Member Function Documentation

void TtHadLRJetCombCalc::operator() ( TtHadEvtSolution sol)

Definition at line 21 of file TtHadLRJetCombCalc.cc.

References addPurity, LRHelpFunctions::calcLRval(), LRHelpFunctions::calcProb(), TtHadEvtSolution::getLRJetCombObsVal(), myLR, python.connectstrParser::o, LRHelpFunctions::obsFitIncluded(), TtHadEvtSolution::setLRJetCombLRval(), and TtHadEvtSolution::setLRJetCombProb().

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

Member Data Documentation

bool TtHadLRJetCombCalc::addPurity
private

Definition at line 30 of file TtHadLRJetCombCalc.h.

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

LRHelpFunctions* TtHadLRJetCombCalc::myLR
private

Definition at line 29 of file TtHadLRJetCombCalc.h.

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