CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10_patch2/src/DQMOffline/JetMET/interface/SusyDQM/GenericPlotter.h

Go to the documentation of this file.
00001 #ifndef SUSYCAF_GENERIC_PLOTTER_H
00002 #define SUSYCAF_GENERIC_PLOTTER_H
00003 
00004 #include <vector>
00005 #include <string>
00006 #include <TLegend.h>
00007 namespace edm { class ParameterSet;}
00008 class Book;
00009 class TH1;
00010 class TCanvas;
00011 
00012 class GenericPlotter {
00013  public:
00014   GenericPlotter(const edm::ParameterSet&);
00015   const std::string printSuffix_, plotDocument_, drawOption2D_;
00016   const bool normalize_,legend_;
00017   const unsigned canvasWidth_,canvasHeight_;
00018   const std::vector<std::string> replace_text_;
00019   const double maxRatioUncertainty_;
00020   const double fixRatioYAxis_;
00021 
00022   void plot_all(std::vector<Book*>&, int reference = -1) const;
00023   void plot1D(std::string, std::vector<std::string>&, std::vector<TH1*>&, int reference = -1) const;
00024   void plot2D(std::string, std::vector<std::string>&, std::vector<TH1*>&) const;
00025   void plotRatio(bool, std::vector<std::string>&, std::vector<TH1*>&, int reference, TCanvas& c) const;
00026 
00027   TLegend* make_legend2D(const std::string, TH1*) const;
00028   TLegend make_legend(const std::vector<std::string>&, const std::vector<TH1*>&) const;
00029   void normalize(std::vector<TH1*>&) const;
00030   void setLabels(std::vector<TH1*>&) const;
00031   void setBounds(std::vector<TH1*>&, bool, bool) const;
00032   double hist_maximum(TH1*) const;
00033   double hist_minimum(TH1*) const;
00034 
00035   void plotDocumentOpen() const;
00036   void plotDocumentClose() const;
00037   void plotDocumentAdd(const TCanvas&) const;
00038   void printFile(const std::string&, const TCanvas&) const;
00039 
00040   // User must clean up the created ratio histograms.
00041   static void make_rebinned_ratios(std::vector<TH1*>& ratios, const std::vector<TH1*>& hist, int reference, double maxUncertainty, const std::string& refName, const std::string postfix = "_ratio");
00042   static double ratioError2(double numerator, double numeratorError2, double denominator, double denominatorError2);
00043 
00044 };
00045 
00046 #endif