CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TtSemiLRJetCombCalc.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 TtSemiLRJetCombCalc::TtSemiLRJetCombCalc(const TString& fitInputPath, const std::vector<int>& observables) {
10  std::cout << "=== Constructing a TtSemiLRJetCombCalc... " << 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 
18 
19 // destructor
21  delete myLR;
22 }
23 
24 
26 
27  // find the used observables
28  std::vector<double> obsVals;
29  for(unsigned int o = 0; o<100; o++){
30  if( myLR->obsFitIncluded(o) ) {obsVals.push_back(sol.getLRJetCombObsVal(o)); };
31  }
32 
33  // calculate the logLR and the purity
34  double logLR = myLR->calcLRval(obsVals);
35  double prob = -999.;
36  if(addPurity) prob = myLR->calcProb(logLR);
37 
38  // fill these values to the members in the TtSemiEvtSolution
39  sol.setLRJetCombLRval(logLR);
40  sol.setLRJetCombProb(prob);
41 }
double calcLRval(const std::vector< double > &)
double calcProb(double)
Help functionalities to implement and evaluate LR ratio method.
bool obsFitIncluded(int)
double getLRJetCombObsVal(unsigned int) const
void setLRJetCombProb(double plr)
void operator()(TtSemiEvtSolution &)
void setLRJetCombLRval(double clr)
LRHelpFunctions * myLR
tuple cout
Definition: gather_cfg.py:145