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 {
11  std::cout << "=== Constructing a TtSemiLRSignalSelCalc... " << std::endl;
12  myLR = new LRHelpFunctions();
13  addPurity = false;
14  if(observables[0] == -1) addPurity = true;
15  myLR -> readObsHistsAndFits(fitInputPath, observables, addPurity);
16  std::cout << "=== done." << std::endl;
17 }
18 
20 {
21  delete myLR;
22 }
23 
25 {
26  // find the used observables
27  std::vector<double> obsVals;
28  for(unsigned int o = 0; o<100; o++){
29  if( myLR->obsFitIncluded(o) ) obsVals.push_back(sol.getLRSignalEvtObsVal(o));
30  }
31 
32  // calculate the logLR and the purity
33  double logLR = myLR->calcLRval(obsVals);
34  double prob = -999.;
35  if(addPurity) prob = myLR->calcProb(logLR);
36 
37  // fill these values to the members in the TtSemiEvtSolution
38  sol.setLRSignalEvtLRval(logLR);
39  sol.setLRSignalEvtProb(prob);
40 }
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 setLRSignalEvtProb(double plr)