CMS 3D CMS Logo

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 28 of file TtHadLRSignalSelCalc.h.

Constructor & Destructor Documentation

◆ TtHadLRSignalSelCalc() [1/2]

TtHadLRSignalSelCalc::TtHadLRSignalSelCalc ( )

◆ TtHadLRSignalSelCalc() [2/2]

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

Definition at line 7 of file TtHadLRSignalSelCalc.cc.

7  {
8  std::cout << "=== Constructing a TtHadLRSignalSelCalc... " << std::endl;
9  myLR = new LRHelpFunctions();
10  addPurity = false;
11  if (observables[0] == -1)
12  addPurity = true;
13  myLR->readObsHistsAndFits(fitInputPath, observables, addPurity);
14  std::cout << "=== done." << std::endl;
15 }

References addPurity, gather_cfg::cout, myLR, and LRHelpFunctions::readObsHistsAndFits().

◆ ~TtHadLRSignalSelCalc()

TtHadLRSignalSelCalc::~TtHadLRSignalSelCalc ( )

Definition at line 17 of file TtHadLRSignalSelCalc.cc.

17 { delete myLR; }

References myLR.

Member Function Documentation

◆ operator()()

void TtHadLRSignalSelCalc::operator() ( TtHadEvtSolution sol)

Definition at line 19 of file TtHadLRSignalSelCalc.cc.

19  {
20  // find the used observables
21  std::vector<double> obsVals;
22  for (unsigned int o = 0; o < 100; o++) {
23  if (myLR->obsFitIncluded(o))
24  obsVals.push_back(sol.getLRSignalEvtObsVal(o));
25  }
26 
27  // calculate the logLR and the purity
28  double logLR = myLR->calcLRval(obsVals);
29  double prob = -999.;
30  if (addPurity)
31  prob = myLR->calcProb(logLR);
32 
33  // fill these values to the members in the TtHadEvtSolution
34  sol.setLRSignalEvtLRval(logLR);
36 }

References addPurity, LRHelpFunctions::calcLRval(), LRHelpFunctions::calcProb(), TtHadEvtSolution::getLRSignalEvtObsVal(), myLR, EcalTangentSkim_cfg::o, LRHelpFunctions::obsFitIncluded(), TtFullHadEvtBuilder_cfi::prob, TtHadEvtSolution::setLRSignalEvtLRval(), and TtHadEvtSolution::setLRSignalEvtProb().

Member Data Documentation

◆ addPurity

bool TtHadLRSignalSelCalc::addPurity
private

Definition at line 37 of file TtHadLRSignalSelCalc.h.

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

◆ myLR

LRHelpFunctions* TtHadLRSignalSelCalc::myLR
private

Definition at line 36 of file TtHadLRSignalSelCalc.h.

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

gather_cfg.cout
cout
Definition: gather_cfg.py:144
TtHadEvtSolution::setLRSignalEvtLRval
void setLRSignalEvtLRval(double clr)
Definition: TtHadEvtSolution.h:275
LRHelpFunctions::readObsHistsAndFits
void readObsHistsAndFits(const TString &, const std::vector< int > &, bool)
Definition: LRHelpFunctions.cc:212
LRHelpFunctions::obsFitIncluded
bool obsFitIncluded(int)
Definition: LRHelpFunctions.cc:489
EcalTangentSkim_cfg.o
o
Definition: EcalTangentSkim_cfg.py:42
TtHadLRSignalSelCalc::myLR
LRHelpFunctions * myLR
Definition: TtHadLRSignalSelCalc.h:36
TtHadLRSignalSelCalc::addPurity
bool addPurity
Definition: TtHadLRSignalSelCalc.h:37
LRHelpFunctions::calcProb
double calcProb(double)
Definition: LRHelpFunctions.cc:486
TtHadEvtSolution::setLRSignalEvtProb
void setLRSignalEvtProb(double plr)
Definition: TtHadEvtSolution.h:276
LRHelpFunctions
Help functionalities to implement and evaluate LR ratio method.
Definition: LRHelpFunctions.h:35
TtFullHadEvtBuilder_cfi.prob
prob
Definition: TtFullHadEvtBuilder_cfi.py:33
LRHelpFunctions::calcLRval
double calcLRval(const std::vector< double > &)
Definition: LRHelpFunctions.cc:378
TtHadEvtSolution::getLRSignalEvtObsVal
double getLRSignalEvtObsVal(unsigned int) const
Definition: TtHadEvtSolution.cc:181