CMS 3D CMS Logo

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
LRHelpFunctions::normalizeSandBhists
void normalizeSandBhists()
Definition: LRHelpFunctions.cc:172
LRHelpFunctions::recreateFitFct
void recreateFitFct(const std::vector< int > &obsNr, const std::vector< const char * > &functions)
Definition: LRHelpFunctions.cc:53
LRHelpFunctions::calcPtdrLRval
double calcPtdrLRval(const std::vector< double > &vals, bool useCorrelation=false)
Definition: LRHelpFunctions.cc:391
edmStreamStallGrapher.extension
extension
Definition: edmStreamStallGrapher.py:893
LRHelpFunctions::~LRHelpFunctions
~LRHelpFunctions()
Definition: LRHelpFunctions.cc:83
LRHelpFunctions::hLRValvsEff
TGraph * hLRValvsEff
Definition: LRHelpFunctions.h:76
LRHelpFunctions::singlePlot
void singlePlot(const TString &fname, int obsNbr, const TString &extension=TString("eps"))
Definition: LRHelpFunctions.cc:527
LRHelpFunctions::readObsHistsAndFits
void readObsHistsAndFits(const TString &, const std::vector< int > &, bool)
Definition: LRHelpFunctions.cc:212
tools.TF1
TF1
Definition: tools.py:23
LRHelpFunctions::makeAndFitPurityHists
void makeAndFitPurityHists()
Definition: LRHelpFunctions.cc:434
LRHelpFunctions::fillLRBackgroundHist
void fillLRBackgroundHist(double, double weight=1.0)
Definition: LRHelpFunctions.cc:428
LRHelpFunctions::obsFitIncluded
bool obsFitIncluded(int)
Definition: LRHelpFunctions.cc:489
LRHelpFunctions::hObsCorr
std::vector< TH2F * > hObsCorr
Definition: LRHelpFunctions.h:72
LRHelpFunctions::setYlabels
void setYlabels(const std::vector< std::string > &yLabels)
Definition: LRHelpFunctions.cc:515
LRHelpFunctions::fillToBackgroundHists
void fillToBackgroundHists(const std::vector< double > &, double weight=1.0)
Definition: LRHelpFunctions.cc:153
LRHelpFunctions::purityPlot
void purityPlot(const TString &fname, const TString &extension=TString("eps"))
Definition: LRHelpFunctions.cc:572
LRHelpFunctions::fObsSoverSplusB
std::vector< TF1 * > fObsSoverSplusB
Definition: LRHelpFunctions.h:73
LRHelpFunctions::hLRtotSoverSplusB
TH1F * hLRtotSoverSplusB
Definition: LRHelpFunctions.h:74
LRHelpFunctions::hObsSoverSplusB
std::vector< TH1F * > hObsSoverSplusB
Definition: LRHelpFunctions.h:71
LRHelpFunctions::storeControlPlots
void storeControlPlots(const TString &)
Definition: LRHelpFunctions.cc:311
LRHelpFunctions::hLRtotB
TH1F * hLRtotB
Definition: LRHelpFunctions.h:74
LRHelpFunctions::fillLRSignalHist
void fillLRSignalHist(double, double weight=1.0)
Definition: LRHelpFunctions.cc:422
LRHelpFunctions::obsNumbers
std::vector< int > obsNumbers
Definition: LRHelpFunctions.h:78
LRHelpFunctions::constructPurity
bool constructPurity
Definition: LRHelpFunctions.h:77
LRHelpFunctions::storeToROOTfile
void storeToROOTfile(const TString &)
Definition: LRHelpFunctions.cc:280
LRHelpFunctions::LRHelpFunctions
LRHelpFunctions()
Definition: LRHelpFunctions.cc:5
LRHelpFunctions::calcProb
double calcProb(double)
Definition: LRHelpFunctions.cc:486
LRHelpFunctions::hObsB
std::vector< TH1F * > hObsB
Definition: LRHelpFunctions.h:71
stringResolutionProvider_cfi.functions
functions
Definition: stringResolutionProvider_cfi.py:7
LRHelpFunctions::hObsS
std::vector< TH1F * > hObsS
Definition: LRHelpFunctions.h:71
LRHelpFunctions::fillToSignalHists
void fillToSignalHists(const std::vector< double > &, double weight=1.0)
Definition: LRHelpFunctions.cc:110
alignmentValidation.fname
string fname
main script
Definition: alignmentValidation.py:959
muonME0PseudoDigis_cfi.useCorrelation
useCorrelation
Definition: muonME0PseudoDigis_cfi.py:12
LRHelpFunctions::hLRtotS
TH1F * hLRtotS
Definition: LRHelpFunctions.h:74
LRHelpFunctions::setObsFitParameters
void setObsFitParameters(int obs, const std::vector< double > &)
Definition: LRHelpFunctions.cc:97
LRHelpFunctions::makeAndFitSoverSplusBHists
void makeAndFitSoverSplusBHists()
Definition: LRHelpFunctions.cc:192
LRHelpFunctions::hLRValvsPur
TGraph * hLRValvsPur
Definition: LRHelpFunctions.h:76
LRHelpFunctions::fillToSignalCorrelation
void fillToSignalCorrelation(int obsNbr1, double obsVal1, int obsNbr2, double obsVal2, double weight)
Definition: LRHelpFunctions.cc:135
LRHelpFunctions
Help functionalities to implement and evaluate LR ratio method.
Definition: LRHelpFunctions.h:35
LRHelpFunctions::initLRHistsAndFits
void initLRHistsAndFits(int, double, double, const char *)
Definition: LRHelpFunctions.cc:86
LRHelpFunctions::fLRtotSoverSplusB
TF1 * fLRtotSoverSplusB
Definition: LRHelpFunctions.h:75
LRHelpFunctions::hEffvsPur
TGraph * hEffvsPur
Definition: LRHelpFunctions.h:76
LRHelpFunctions::calcLRval
double calcLRval(const std::vector< double > &)
Definition: LRHelpFunctions.cc:378
weight
Definition: weight.py:1
LRHelpFunctions::setXlabels
void setXlabels(const std::vector< std::string > &xLabels)
Definition: LRHelpFunctions.cc:501