CMS 3D CMS Logo

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, myLR, and LRHelpFunctions::readObsHistsAndFits().

6  {
7  std::cout << "=== Constructing a TtHadLRJetCombCalc... " << std::endl;
8  myLR = new LRHelpFunctions();
9  addPurity = false;
10  if (observables[0] == -1)
11  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.
void readObsHistsAndFits(const TString &, const std::vector< int > &, bool)
TtHadLRJetCombCalc::~TtHadLRJetCombCalc ( )

Definition at line 16 of file TtHadLRJetCombCalc.cc.

References myLR.

16 { delete myLR; }
LRHelpFunctions * myLR

Member Function Documentation

void TtHadLRJetCombCalc::operator() ( TtHadEvtSolution sol)

Definition at line 18 of file TtHadLRJetCombCalc.cc.

References addPurity, LRHelpFunctions::calcLRval(), LRHelpFunctions::calcProb(), TtHadEvtSolution::getLRJetCombObsVal(), myLR, EcalTangentSkim_cfg::o, LRHelpFunctions::obsFitIncluded(), TtFullHadEvtBuilder_cfi::prob, TtHadEvtSolution::setLRJetCombLRval(), and TtHadEvtSolution::setLRJetCombProb().

18  {
19  // find the used observables
20  std::vector<double> obsVals;
21  for (unsigned int o = 0; o < 100; o++) {
22  if (myLR->obsFitIncluded(o)) {
23  obsVals.push_back(sol.getLRJetCombObsVal(o));
24  };
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.setLRJetCombLRval(logLR);
35  sol.setLRJetCombProb(prob);
36 }
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 28 of file TtHadLRJetCombCalc.h.

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

LRHelpFunctions* TtHadLRJetCombCalc::myLR
private

Definition at line 27 of file TtHadLRJetCombCalc.h.

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