CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
LRHelpFunctions.h
Go to the documentation of this file.
1 
2 //
3 // Author: Jan Heyninck
4 // Created: Tue Apr 3 17:33:23 PDT 2007
5 //
6 // $Id: LRHelpFunctions.h,v 1.10 2008/06/19 12:28:27 rwolf Exp $
7 //
8 
9 #ifndef LRHelpFunctions_h
10 #define LRHelpFunctions_h
11 
20 #include <cmath>
21 #include <iostream>
22 
23 #include "TROOT.h"
24 #include "TString.h"
25 #include "TFile.h"
26 #include "TKey.h"
27 #include "TH1F.h"
28 #include "TH2F.h"
29 #include "TF1.h"
30 #include "TGraph.h"
31 #include "TList.h"
32 #include "TPaveText.h"
33 #include "TText.h"
34 #include "TCanvas.h"
35 
36 
38 
39  public:
41  LRHelpFunctions(std::vector<int>, int, std::vector<double>, std::vector<double>,std::vector<const char*>);
42  LRHelpFunctions(int, double, double, const char*);
44  void recreateFitFct(std::vector<int> obsNr, std::vector<const char*> functions);
45  void initLRHistsAndFits(int, double, double, const char*);
46  void setObsFitParameters(int obs,std::vector<double>);
47  void fillToSignalHists(std::vector<double>, double weight = 1.0);
48  void fillToBackgroundHists(std::vector<double>, double weight = 1.0);
49  void fillToSignalHists(int, double, double weight = 1.0);
50  void fillToBackgroundHists(int, double, double weight = 1.0);
51  void fillToSignalCorrelation(int obsNbr1, double obsVal1, int obsNbr2,
52  double obsVal2, double weight);
53  void normalizeSandBhists();
55  void readObsHistsAndFits(TString,std::vector<int>,bool);
56  void storeToROOTfile(TString);
57  void storeControlPlots(TString);
58  void fillLRSignalHist(double, double weight = 1.0);
59  void fillLRBackgroundHist(double, double weight = 1.0);
60  void makeAndFitPurityHists();
61  double calcLRval(std::vector<double>);
62  double calcPtdrLRval(std::vector<double> vals, bool useCorrelation = false);
63  double calcProb(double);
64  bool obsFitIncluded(int);
65  void setXlabels(const std::vector<std::string> & xLabels);
66  void setYlabels(const std::vector<std::string> & yLabels);
67  void singlePlot(TString fname, int obsNbr, TString extension= TString("eps"));
68  void purityPlot(TString fname, TString extension= TString("eps"));
69 
70 
71  private:
72  std::vector<TH1F*> hObsS, hObsB, hObsSoverSplusB;
73  std::vector<TH2F*> hObsCorr;
74  std::vector<TF1*> fObsSoverSplusB;
79  std::vector<int> obsNumbers;
80 };
81 
82 #endif
std::vector< TH1F * > hObsSoverSplusB
void setXlabels(const std::vector< std::string > &xLabels)
std::vector< TH1F * > hObsS
void makeAndFitPurityHists()
double calcProb(double)
std::vector< TH1F * > hObsB
void setYlabels(const std::vector< std::string > &yLabels)
Help functionalities to implement and evaluate LR ratio method.
void singlePlot(TString fname, int obsNbr, TString extension=TString("eps"))
TGraph * hLRValvsEff
bool obsFitIncluded(int)
std::vector< TH2F * > hObsCorr
TGraph * hLRValvsPur
void fillToSignalCorrelation(int obsNbr1, double obsVal1, int obsNbr2, double obsVal2, double weight)
void makeAndFitSoverSplusBHists()
double calcPtdrLRval(std::vector< double > vals, bool useCorrelation=false)
void setObsFitParameters(int obs, std::vector< double >)
void purityPlot(TString fname, TString extension=TString("eps"))
void storeControlPlots(TString)
std::vector< int > obsNumbers
void fillLRSignalHist(double, double weight=1.0)
void fillToBackgroundHists(std::vector< double >, double weight=1.0)
void recreateFitFct(std::vector< int > obsNr, std::vector< const char * > functions)
void storeToROOTfile(TString)
double calcLRval(std::vector< double >)
string fname
main script
std::vector< TF1 * > fObsSoverSplusB
void fillToSignalHists(std::vector< double >, double weight=1.0)
void initLRHistsAndFits(int, double, double, const char *)
void fillLRBackgroundHist(double, double weight=1.0)
TH1F * hLRtotSoverSplusB
void readObsHistsAndFits(TString, std::vector< int >, bool)