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 //
7 
8 #ifndef LRHelpFunctions_h
9 #define LRHelpFunctions_h
10 
19 #include <cmath>
20 #include <iostream>
21 
22 #include "TROOT.h"
23 #include "TString.h"
24 #include "TFile.h"
25 #include "TKey.h"
26 #include "TH1F.h"
27 #include "TH2F.h"
28 #include "TF1.h"
29 #include "TGraph.h"
30 #include "TList.h"
31 #include "TPaveText.h"
32 #include "TText.h"
33 #include "TCanvas.h"
34 
35 
37 
38  public:
40  LRHelpFunctions(const std::vector<int>&, int, const std::vector<double>&, const std::vector<double>&,const std::vector<const char*>&);
41  LRHelpFunctions(int, double, double, const char*);
43  void recreateFitFct(const std::vector<int>& obsNr, const std::vector<const char*>& functions);
44  void initLRHistsAndFits(int, double, double, const char*);
45  void setObsFitParameters(int obs,const std::vector<double>&);
46  void fillToSignalHists(const std::vector<double>&, double weight = 1.0);
47  void fillToBackgroundHists(const std::vector<double>&, double weight = 1.0);
48  void fillToSignalHists(int, double, double weight = 1.0);
49  void fillToBackgroundHists(int, double, double weight = 1.0);
50  void fillToSignalCorrelation(int obsNbr1, double obsVal1, int obsNbr2,
51  double obsVal2, double weight);
52  void normalizeSandBhists();
54  void readObsHistsAndFits(const TString&,const std::vector<int>&,bool);
55  void storeToROOTfile(const TString&);
56  void storeControlPlots(const TString&);
57  void fillLRSignalHist(double, double weight = 1.0);
58  void fillLRBackgroundHist(double, double weight = 1.0);
59  void makeAndFitPurityHists();
60  double calcLRval(const std::vector<double>&);
61  double calcPtdrLRval(const std::vector<double>& vals, bool useCorrelation = false);
62  double calcProb(double);
63  bool obsFitIncluded(int);
64  void setXlabels(const std::vector<std::string> & xLabels);
65  void setYlabels(const std::vector<std::string> & yLabels);
66  void singlePlot(const TString& fname, int obsNbr, const TString& extension= TString("eps"));
67  void purityPlot(const TString& fname, const TString& extension= TString("eps"));
68 
69 
70  private:
71  std::vector<TH1F*> hObsS, hObsB, hObsSoverSplusB;
72  std::vector<TH2F*> hObsCorr;
73  std::vector<TF1*> fObsSoverSplusB;
78  std::vector<int> obsNumbers;
79 };
80 
81 #endif
void storeControlPlots(const TString &)
double calcLRval(const std::vector< double > &)
std::vector< TH1F * > hObsSoverSplusB
void setXlabels(const std::vector< std::string > &xLabels)
void recreateFitFct(const std::vector< int > &obsNr, const std::vector< const char * > &functions)
std::vector< TH1F * > hObsS
double calcPtdrLRval(const std::vector< double > &vals, bool useCorrelation=false)
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.
TGraph * hLRValvsEff
bool obsFitIncluded(int)
std::vector< TH2F * > hObsCorr
TGraph * hLRValvsPur
void fillToBackgroundHists(const std::vector< double > &, double weight=1.0)
void fillToSignalCorrelation(int obsNbr1, double obsVal1, int obsNbr2, double obsVal2, double weight)
void makeAndFitSoverSplusBHists()
void storeToROOTfile(const TString &)
std::vector< int > obsNumbers
void fillLRSignalHist(double, double weight=1.0)
void singlePlot(const TString &fname, int obsNbr, const TString &extension=TString("eps"))
void readObsHistsAndFits(const TString &, const std::vector< int > &, bool)
void fillToSignalHists(const std::vector< double > &, double weight=1.0)
void setObsFitParameters(int obs, const std::vector< double > &)
string fname
main script
std::vector< TF1 * > fObsSoverSplusB
void initLRHistsAndFits(int, double, double, const char *)
void fillLRBackgroundHist(double, double weight=1.0)
TH1F * hLRtotSoverSplusB
void purityPlot(const TString &fname, const TString &extension=TString("eps"))