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.11 2013/05/30 20:47:31 gartung 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(const std::vector<int>&, int, const std::vector<double>&, const std::vector<double>&,const std::vector<const char*>&);
42  LRHelpFunctions(int, double, double, const char*);
44  void recreateFitFct(const std::vector<int>& obsNr, const std::vector<const char*>& functions);
45  void initLRHistsAndFits(int, double, double, const char*);
46  void setObsFitParameters(int obs,const std::vector<double>&);
47  void fillToSignalHists(const std::vector<double>&, double weight = 1.0);
48  void fillToBackgroundHists(const 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(const TString&,const std::vector<int>&,bool);
56  void storeToROOTfile(const TString&);
57  void storeControlPlots(const TString&);
58  void fillLRSignalHist(double, double weight = 1.0);
59  void fillLRBackgroundHist(double, double weight = 1.0);
60  void makeAndFitPurityHists();
61  double calcLRval(const std::vector<double>&);
62  double calcPtdrLRval(const 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(const TString& fname, int obsNbr, const TString& extension= TString("eps"));
68  void purityPlot(const TString& fname, const 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
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)
int weight
Definition: histoStyle.py:50
TH1F * hLRtotSoverSplusB
void purityPlot(const TString &fname, const TString &extension=TString("eps"))