CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_0/src/TopQuarkAnalysis/TopTools/interface/LRHelpFunctions.h

Go to the documentation of this file.
00001 
00002 //
00003 // Author:  Jan Heyninck
00004 // Created: Tue Apr  3 17:33:23 PDT 2007
00005 //
00006 // $Id: LRHelpFunctions.h,v 1.10 2008/06/19 12:28:27 rwolf Exp $
00007 //
00008 
00009 #ifndef LRHelpFunctions_h
00010 #define LRHelpFunctions_h
00011 
00020 #include <cmath>
00021 #include <iostream>
00022 
00023 #include "TROOT.h"
00024 #include "TString.h"
00025 #include "TFile.h"
00026 #include "TKey.h"
00027 #include "TH1F.h"
00028 #include "TH2F.h"
00029 #include "TF1.h"
00030 #include "TGraph.h"
00031 #include "TList.h"
00032 #include "TPaveText.h"
00033 #include "TText.h"
00034 #include "TCanvas.h"
00035 
00036 
00037 class LRHelpFunctions {
00038 
00039   public:
00040     LRHelpFunctions();
00041     LRHelpFunctions(std::vector<int>, int, std::vector<double>, std::vector<double>,std::vector<const char*>);
00042     LRHelpFunctions(int, double, double, const char*);
00043     ~LRHelpFunctions(); 
00044     void        recreateFitFct(std::vector<int> obsNr, std::vector<const char*> functions);
00045     void        initLRHistsAndFits(int, double, double, const char*);
00046     void        setObsFitParameters(int obs,std::vector<double>);
00047     void        fillToSignalHists(std::vector<double>, double weight = 1.0);
00048     void        fillToBackgroundHists(std::vector<double>, double weight = 1.0);
00049     void        fillToSignalHists(int, double, double weight = 1.0);
00050     void        fillToBackgroundHists(int, double, double weight = 1.0);
00051     void        fillToSignalCorrelation(int obsNbr1, double obsVal1, int obsNbr2,
00052         double obsVal2, double weight);
00053     void        normalizeSandBhists();
00054     void        makeAndFitSoverSplusBHists();
00055     void        readObsHistsAndFits(TString,std::vector<int>,bool);
00056     void        storeToROOTfile(TString);
00057     void        storeControlPlots(TString); 
00058     void        fillLRSignalHist(double, double weight = 1.0);
00059     void        fillLRBackgroundHist(double, double weight = 1.0);
00060     void        makeAndFitPurityHists(); 
00061     double      calcLRval(std::vector<double>);
00062     double      calcPtdrLRval(std::vector<double> vals, bool useCorrelation = false);
00063     double      calcProb(double);
00064     bool        obsFitIncluded(int);
00065     void setXlabels(const std::vector<std::string> & xLabels);
00066     void setYlabels(const std::vector<std::string> & yLabels);
00067     void singlePlot(TString fname, int obsNbr, TString extension= TString("eps"));
00068     void purityPlot(TString fname, TString extension= TString("eps"));
00069 
00070 
00071   private:
00072     std::vector<TH1F*> hObsS, hObsB, hObsSoverSplusB;
00073     std::vector<TH2F*> hObsCorr;
00074     std::vector<TF1*>  fObsSoverSplusB;
00075     TH1F               *hLRtotS, *hLRtotB, *hLRtotSoverSplusB;
00076     TF1                *fLRtotSoverSplusB;
00077     TGraph             *hEffvsPur, *hLRValvsPur, *hLRValvsEff;
00078     bool               constructPurity;
00079     std::vector<int> obsNumbers;
00080 };
00081 
00082 #endif