CMS 3D CMS Logo

TtSemiLRSignalSelCalc.cc
Go to the documentation of this file.
1 //
2 // Author: Jan Heyninck
3 // Created: Tue Apr 3 17:33:23 PDT 2007
4 //
5 //
7 
8 // constructor with path; default should not be used
9 TtSemiLRSignalSelCalc::TtSemiLRSignalSelCalc(const TString& fitInputPath, const std::vector<int>& observables) {
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 }
18 
20 
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);
37  sol.setLRSignalEvtProb(prob);
38 }
double calcLRval(const std::vector< double > &)
void setLRSignalEvtLRval(double clr)
double getLRSignalEvtObsVal(unsigned int) const
double calcProb(double)
Help functionalities to implement and evaluate LR ratio method.
bool obsFitIncluded(int)
void operator()(TtSemiEvtSolution &)
void readObsHistsAndFits(const TString &, const std::vector< int > &, bool)
void setLRSignalEvtProb(double plr)