CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
GenericPlotter.h
Go to the documentation of this file.
1 #ifndef SUSYCAF_GENERIC_PLOTTER_H
2 #define SUSYCAF_GENERIC_PLOTTER_H
3 
4 #include <vector>
5 #include <string>
6 #include <TLegend.h>
7 namespace edm { class ParameterSet;}
8 class Book;
9 class TH1;
10 class TCanvas;
11 
13  public:
16  const bool normalize_,legend_;
17  const unsigned canvasWidth_,canvasHeight_;
18  const std::vector<std::string> replace_text_;
19  const double maxRatioUncertainty_;
20  const double fixRatioYAxis_;
21 
22  void plot_all(std::vector<Book*>&, int reference = -1) const;
23  void plot1D(std::string, std::vector<std::string>&, std::vector<TH1*>&, int reference = -1) const;
24  void plot2D(std::string, std::vector<std::string>&, std::vector<TH1*>&) const;
25  void plotRatio(bool, std::vector<std::string>&, std::vector<TH1*>&, int reference, TCanvas& c) const;
26 
27  TLegend* make_legend2D(const std::string, TH1*) const;
28  TLegend make_legend(const std::vector<std::string>&, const std::vector<TH1*>&) const;
29  void normalize(std::vector<TH1*>&) const;
30  void setLabels(std::vector<TH1*>&) const;
31  void setBounds(std::vector<TH1*>&, bool, bool) const;
32  double hist_maximum(TH1*) const;
33  double hist_minimum(TH1*) const;
34 
35  void plotDocumentOpen() const;
36  void plotDocumentClose() const;
37  void plotDocumentAdd(const TCanvas&) const;
38  void printFile(const std::string&, const TCanvas&) const;
39 
40  // User must clean up the created ratio histograms.
41  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");
42  static double ratioError2(double numerator, double numeratorError2, double denominator, double denominatorError2);
43 
44 };
45 
46 #endif
static double ratioError2(double numerator, double numeratorError2, double denominator, double denominatorError2)
double hist_maximum(TH1 *) const
const std::string plotDocument_
list numerator
Definition: cuy.py:483
void plotDocumentClose() const
void setLabels(std::vector< TH1 * > &) const
dictionary ratios
Definition: plotFactory.py:68
const std::string printSuffix_
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")
const double maxRatioUncertainty_
void plotRatio(bool, std::vector< std::string > &, std::vector< TH1 * > &, int reference, TCanvas &c) const
GenericPlotter(const edm::ParameterSet &)
void normalize(std::vector< TH1 * > &) const
void plot2D(std::string, std::vector< std::string > &, std::vector< TH1 * > &) const
list denominator
Definition: cuy.py:484
TLegend * make_legend2D(const std::string, TH1 *) const
const bool normalize_
TLegend make_legend(const std::vector< std::string > &, const std::vector< TH1 * > &) const
double hist_minimum(TH1 *) const
const unsigned canvasHeight_
void printFile(const std::string &, const TCanvas &) const
void plot_all(std::vector< Book * > &, int reference=-1) const
const unsigned canvasWidth_
void plotDocumentAdd(const TCanvas &) const
const std::vector< std::string > replace_text_
Definition: Book.h:16
void setBounds(std::vector< TH1 * > &, bool, bool) const
const double fixRatioYAxis_
const bool legend_
const std::string drawOption2D_
void plot1D(std::string, std::vector< std::string > &, std::vector< TH1 * > &, int reference=-1) const
void plotDocumentOpen() const