CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
TtHadLRSignalSelCalc.cc
Go to the documentation of this file.
1 // copied TtSemiLRSignalSelCalc.cc,v 1.2 2007/06/18 14:12:18 heyninck Exp
2 // for fully hadronic channel
3 
5 
6 // constructor with path; default should not be used
7 TtHadLRSignalSelCalc::TtHadLRSignalSelCalc(const TString& fitInputPath, const std::vector<int>& observables) {
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 }
16 
18 
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);
35  sol.setLRSignalEvtProb(prob);
36 }
double calcLRval(const std::vector< double > &)
double getLRSignalEvtObsVal(unsigned int) const
double calcProb(double)
Help functionalities to implement and evaluate LR ratio method.
bool obsFitIncluded(int)
void setLRSignalEvtProb(double plr)
LRHelpFunctions * myLR
void readObsHistsAndFits(const TString &, const std::vector< int > &, bool)
constexpr float sol
Definition: Config.h:48
void setLRSignalEvtLRval(double clr)
tuple cout
Definition: gather_cfg.py:144
void operator()(TtHadEvtSolution &)