CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
TtSemiLRJetCombCalc Class Reference

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

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

Public Member Functions

void operator() (TtSemiEvtSolution &)
 
 TtSemiLRJetCombCalc ()
 
 TtSemiLRJetCombCalc (const TString &, const std::vector< int > &)
 
 ~TtSemiLRJetCombCalc ()
 

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
TtSemiLRJetCombCalc.h,v 1.4 2008/02/17 11:27:11 rwolf Exp

Definition at line 31 of file TtSemiLRJetCombCalc.h.

Constructor & Destructor Documentation

◆ TtSemiLRJetCombCalc() [1/2]

TtSemiLRJetCombCalc::TtSemiLRJetCombCalc ( )

◆ TtSemiLRJetCombCalc() [2/2]

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

Definition at line 9 of file TtSemiLRJetCombCalc.cc.

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

9  {
10  std::cout << "=== Constructing a TtSemiLRJetCombCalc... " << std::endl;
11  myLR = new LRHelpFunctions();
12  addPurity = false;
13  if (observables[0] == -1)
14  addPurity = true;
16  std::cout << "=== done." << std::endl;
17 }
Help functionalities to implement and evaluate LR ratio method.
void readObsHistsAndFits(const TString &, const std::vector< int > &, bool)
LRHelpFunctions * myLR

◆ ~TtSemiLRJetCombCalc()

TtSemiLRJetCombCalc::~TtSemiLRJetCombCalc ( )

Definition at line 20 of file TtSemiLRJetCombCalc.cc.

References myLR.

20 { delete myLR; }
LRHelpFunctions * myLR

Member Function Documentation

◆ operator()()

void TtSemiLRJetCombCalc::operator() ( TtSemiEvtSolution sol)

Definition at line 22 of file TtSemiLRJetCombCalc.cc.

References addPurity, LRHelpFunctions::calcLRval(), LRHelpFunctions::calcProb(), myLR, EcalTangentSkim_cfg::o, LRHelpFunctions::obsFitIncluded(), TtFullHadEvtBuilder_cfi::prob, and mkfit::Const::sol.

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)) {
27  obsVals.push_back(sol.getLRJetCombObsVal(o));
28  };
29  }
30 
31  // calculate the logLR and the purity
32  double logLR = myLR->calcLRval(obsVals);
33  double prob = -999.;
34  if (addPurity)
35  prob = myLR->calcProb(logLR);
36 
37  // fill these values to the members in the TtSemiEvtSolution
38  sol.setLRJetCombLRval(logLR);
39  sol.setLRJetCombProb(prob);
40 }
double calcLRval(const std::vector< double > &)
double calcProb(double)
bool obsFitIncluded(int)
constexpr float sol
Definition: Config.h:13
LRHelpFunctions * myLR

Member Data Documentation

◆ addPurity

bool TtSemiLRJetCombCalc::addPurity
private

Definition at line 41 of file TtSemiLRJetCombCalc.h.

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

◆ myLR

LRHelpFunctions* TtSemiLRJetCombCalc::myLR
private

Definition at line 40 of file TtSemiLRJetCombCalc.h.

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