CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 
36 public:
38  LRHelpFunctions(const std::vector<int>&,
39  int,
40  const std::vector<double>&,
41  const std::vector<double>&,
42  const std::vector<const char*>&);
43  LRHelpFunctions(int, double, double, const char*);
45  void recreateFitFct(const std::vector<int>& obsNr, const std::vector<const char*>& functions);
46  void initLRHistsAndFits(int, double, double, const char*);
47  void setObsFitParameters(int obs, const std::vector<double>&);
48  void fillToSignalHists(const std::vector<double>&, double weight = 1.0);
49  void fillToBackgroundHists(const std::vector<double>&, double weight = 1.0);
50  void fillToSignalHists(int, double, double weight = 1.0);
51  void fillToBackgroundHists(int, double, double weight = 1.0);
52  void fillToSignalCorrelation(int obsNbr1, double obsVal1, int obsNbr2, 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 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)
int weight
Definition: histoStyle.py:51
TH1F * hLRtotSoverSplusB
void purityPlot(const TString &fname, const TString &extension=TString("eps"))