HybridPlot.h

Go to the documentation of this file.
00001 // @(#)root/roostats:$Id: HybridPlot.h 30654 2009-10-09 15:07:52Z moneta $
00002 
00003 /*************************************************************************
00004  * Project: RooStats                                                     *
00005  * Package: RooFit/RooStats                                              *
00006  * Authors:                                                              *
00007  *   Kyle Cranmer, Lorenzo Moneta, Gregory Schott, Wouter Verkerke       *
00008  *************************************************************************
00009  * Copyright (C) 1995-2008, Rene Brun and Fons Rademakers.               *
00010  * All rights reserved.                                                  *
00011  *                                                                       *
00012  * For the licensing terms see $ROOTSYS/LICENSE.                         *
00013  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
00014  *************************************************************************/
00015 
00016 #ifndef ROOSTATS_HybridPlot
00017 #define ROOSTATS_HybridPlot
00018 
00019 #include <vector>
00020 #include <iostream>
00021 
00022 #ifndef ROOT_TNamed 
00023 #include "TNamed.h"
00024 #endif
00025 
00026 // these  should be maybe forward decleared 
00027 // by moving implementations in source file 
00028 #include "TH1.h"
00029 
00030 
00031 class TLine; 
00032 class TLegend; 
00033 class TH1; 
00034 class TVirtualPad; 
00035 
00036 
00037 namespace RooStats {
00038 
00039    class HybridPlot : public TNamed {
00040 
00041    public:
00042 
00043       /// Constructor
00044       HybridPlot(const char* name,
00045                  const char* title,
00046                  const std::vector<double> & sb_values,
00047                  const std::vector<double> & b_values,
00048                  double testStat_data,
00049                  int n_bins,
00050                  bool verbosity=true);
00051 
00052       /// Destructor
00053       ~HybridPlot();
00054 
00055       /// Draw on current pad
00056       void Draw (const char* options="");
00057 
00058       /// All the objects are written to rootfile
00059       void DumpToFile (const char* RootFileName, const char* options);
00060 
00061       /// Get B histo mean
00062       double GetBmean(){return fB_histo->GetMean();};
00063 
00064       /// Get B histo RMS
00065       double GetBrms(){return fB_histo->GetRMS();};
00066 
00067       /// Get B histo
00068       TH1F * GetBhisto(){return fB_histo;}
00069 
00070       /// Get B histo center
00071       double GetBCenter(double n_sigmas=1, bool display=false)
00072       {return GetHistoCenter(fB_histo,n_sigmas,display);};
00073 
00074       /// Get B histo integration extremes to obtain the requested area fraction
00075       double* GetBIntExtremes(double frac)
00076       {return GetHistoPvals(fB_histo,frac);};
00077 
00078       /// Get SB histo mean
00079       double GetSBmean(){return fSb_histo->GetMean();};
00080 
00081       /// Get SB histo center
00082       double GetSBCenter(double n_sigmas=1, bool display=false)
00083       {return GetHistoCenter(fSb_histo,n_sigmas,display);};
00084 
00085       /// Get SB histo RMS
00086       double GetSBrms(){return fSb_histo->GetRMS();};
00087 
00088       /// Get SB histo integration extremes to obtain the requested area fraction
00089       double* GetSBIntExtremes(double frac)
00090       {return GetHistoPvals(fSb_histo,frac);};
00091 
00092       /// Get B histo
00093       TH1F* GetSBhisto(){return fSb_histo;}
00094 
00095        /// Get the pad (or canvas) where it has been drawn 
00096       TVirtualPad * GetCanvas() { return fPad; }
00097 
00098       /// Write an image on disk
00099       void DumpToImage (const char* filename);
00100 
00101 
00102       /// Get the center of the histo
00103       double GetHistoCenter(TH1* histo, double n_rms=1,bool display_result=false);
00104 
00105       /// Get the "effective sigmas" of the histo
00106       double* GetHistoPvals (TH1* histo, double percentage);
00107 
00108       /// Get the median of an histogram
00109       double GetMedian(TH1* histo);
00110 
00111    private:
00112 
00113       TH1F* fSb_histo; // The sb Histo
00114       TH1F* fSb_histo_shaded; // The sb Histo shaded
00115       TH1F* fB_histo; // The b Histo
00116       TH1F* fB_histo_shaded; // The b Histo shaded
00117       TLine* fData_testStat_line; // The line for the data value of the test statistic
00118       TLegend* fLegend; // The legend of the plot
00119       TVirtualPad * fPad;   // The pad where it has been drawn
00120       bool fVerbose; // verbosity flag
00121 
00122       ClassDef(HybridPlot,1)   // Provides the plots for an HybridResult
00123    };
00124 }
00125 
00126 #endif

Generated on Tue Jul 5 14:26:23 2011 for ROOT_528-00b_version by  doxygen 1.5.1