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 (TString, std::vector< int >)
 
 ~TtHadLRJetCombCalc ()
 

Private Attributes

bool addPurity
 
LRHelpFunctionsmyLR
 

Detailed Description

Definition at line 19 of file TtHadLRJetCombCalc.h.

Constructor & Destructor Documentation

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

Definition at line 7 of file TtHadLRJetCombCalc.cc.

References addPurity, gather_cfg::cout, and myLR.

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

Definition at line 17 of file TtHadLRJetCombCalc.cc.

References myLR.

18 {
19  delete myLR;
20 }
LRHelpFunctions * myLR

Member Function Documentation

void TtHadLRJetCombCalc::operator() ( TtHadEvtSolution sol)

Definition at line 22 of file TtHadLRJetCombCalc.cc.

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

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

Member Data Documentation

bool TtHadLRJetCombCalc::addPurity
private

Definition at line 31 of file TtHadLRJetCombCalc.h.

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

LRHelpFunctions* TtHadLRJetCombCalc::myLR
private

Definition at line 30 of file TtHadLRJetCombCalc.h.

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