CMS 3D CMS Logo

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.2 2008/02/17 11:18:54 rwolf Exp

Definition at line 31 of file TtSemiLRSignalSelCalc.h.

Constructor & Destructor Documentation

◆ TtSemiLRSignalSelCalc() [1/2]

TtSemiLRSignalSelCalc::TtSemiLRSignalSelCalc ( )

◆ TtSemiLRSignalSelCalc() [2/2]

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

Definition at line 9 of file TtSemiLRSignalSelCalc.cc.

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

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

◆ ~TtSemiLRSignalSelCalc()

TtSemiLRSignalSelCalc::~TtSemiLRSignalSelCalc ( )

Definition at line 19 of file TtSemiLRSignalSelCalc.cc.

19 { delete myLR; }

References myLR.

Member Function Documentation

◆ operator()()

void TtSemiLRSignalSelCalc::operator() ( TtSemiEvtSolution sol)

Definition at line 21 of file TtSemiLRSignalSelCalc.cc.

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

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

Member Data Documentation

◆ addPurity

bool TtSemiLRSignalSelCalc::addPurity
private

Definition at line 41 of file TtSemiLRSignalSelCalc.h.

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

◆ myLR

LRHelpFunctions* TtSemiLRSignalSelCalc::myLR
private
TtSemiLRSignalSelCalc::myLR
LRHelpFunctions * myLR
Definition: TtSemiLRSignalSelCalc.h:40
TtSemiEvtSolution::setLRSignalEvtLRval
void setLRSignalEvtLRval(double clr)
Definition: TtSemiEvtSolution.h:308
gather_cfg.cout
cout
Definition: gather_cfg.py:144
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:36
TtSemiLRSignalSelCalc::addPurity
bool addPurity
Definition: TtSemiLRSignalSelCalc.h:41
TtSemiEvtSolution::setLRSignalEvtProb
void setLRSignalEvtProb(double plr)
Definition: TtSemiEvtSolution.h:309
LRHelpFunctions::calcProb
double calcProb(double)
Definition: LRHelpFunctions.cc:486
TtSemiEvtSolution::getLRSignalEvtObsVal
double getLRSignalEvtObsVal(unsigned int) const
Definition: TtSemiEvtSolution.cc:165
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