CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TtHadLRSignalSelCalc.cc
Go to the documentation of this file.
1 // $Id: TtHadLRSignalSelCalc.cc,v 1.3 2013/05/28 17:54:37 gartung Exp $
2 // copied TtSemiLRSignalSelCalc.cc,v 1.2 2007/06/18 14:12:18 heyninck Exp
3 // for fully hadronic channel
4 
6 
7 // constructor with path; default should not be used
8 TtHadLRSignalSelCalc::TtHadLRSignalSelCalc(const TString& fitInputPath, const std::vector<int>& observables)
9 {
10  std::cout << "=== Constructing a TtHadLRSignalSelCalc... " << std::endl;
11  myLR = new LRHelpFunctions();
12  addPurity = false;
13  if(observables[0] == -1) addPurity = true;
14  myLR -> readObsHistsAndFits(fitInputPath, observables, addPurity);
15  std::cout << "=== done." << std::endl;
16 }
17 
19 {
20  delete myLR;
21 }
22 
24 {
25  // find the used observables
26  std::vector<double> obsVals;
27  for(unsigned int o = 0; o<100; o++){
28  if( myLR->obsFitIncluded(o) ) obsVals.push_back(sol.getLRSignalEvtObsVal(o));
29  }
30 
31  // calculate the logLR and the purity
32  double logLR = myLR->calcLRval(obsVals);
33  double prob = -999.;
34  if(addPurity) prob = myLR->calcProb(logLR);
35 
36  // fill these values to the members in the TtHadEvtSolution
37  sol.setLRSignalEvtLRval(logLR);
38  sol.setLRSignalEvtProb(prob);
39 }
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 setLRSignalEvtLRval(double clr)
tuple cout
Definition: gather_cfg.py:121
void operator()(TtHadEvtSolution &)