CMS 3D CMS Logo

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
GenericPlotter::plot1D
void plot1D(std::string, std::vector< std::string > &, std::vector< TH1 * > &, int reference=-1) const
GenericPlotter::plotRatio
void plotRatio(bool, std::vector< std::string > &, std::vector< TH1 * > &, int reference, TCanvas &c) const
GenericPlotter::make_legend
TLegend make_legend(const std::vector< std::string > &, const std::vector< TH1 * > &) const
GenericPlotter::make_rebinned_ratios
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")
edm
HLT enums.
Definition: AlignableModifier.h:19
GenericPlotter::legend_
const bool legend_
Definition: GenericPlotter.h:16
GenericPlotter::printSuffix_
const std::string printSuffix_
Definition: GenericPlotter.h:15
GenericPlotter::normalize
void normalize(std::vector< TH1 * > &) const
GenericPlotter::setBounds
void setBounds(std::vector< TH1 * > &, bool, bool) const
GenericPlotter::plotDocumentClose
void plotDocumentClose() const
Book
Definition: Book.h:16
GenericPlotter::maxRatioUncertainty_
const double maxRatioUncertainty_
Definition: GenericPlotter.h:19
GenericPlotter::GenericPlotter
GenericPlotter(const edm::ParameterSet &)
GenericPlotter::hist_minimum
double hist_minimum(TH1 *) const
compare.hist
hist
Definition: compare.py:376
GenericPlotter
Definition: GenericPlotter.h:12
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
GenericPlotter::plotDocument_
const std::string plotDocument_
Definition: GenericPlotter.h:15
edm::ParameterSet
Definition: ParameterSet.h:36
ParameterSet
Definition: Functions.h:16
GenericPlotter::canvasHeight_
const unsigned canvasHeight_
Definition: GenericPlotter.h:17
GenericPlotter::ratioError2
static double ratioError2(double numerator, double numeratorError2, double denominator, double denominatorError2)
MaterialEffects_cfi.ratios
ratios
Definition: MaterialEffects_cfi.py:70
GenericPlotter::canvasWidth_
const unsigned canvasWidth_
Definition: GenericPlotter.h:17
GenericPlotter::hist_maximum
double hist_maximum(TH1 *) const
RecoTauValidation_cfi.reference
reference
Definition: RecoTauValidation_cfi.py:234
GenericPlotter::plot2D
void plot2D(std::string, std::vector< std::string > &, std::vector< TH1 * > &) const
HLTTauDQMOffline_cfi.numerator
numerator
Definition: HLTTauDQMOffline_cfi.py:194
GenericPlotter::normalize_
const bool normalize_
Definition: GenericPlotter.h:16
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
GenericPlotter::replace_text_
const std::vector< std::string > replace_text_
Definition: GenericPlotter.h:18
GenericPlotter::fixRatioYAxis_
const double fixRatioYAxis_
Definition: GenericPlotter.h:20
GenericPlotter::plot_all
void plot_all(std::vector< Book * > &, int reference=-1) const
GenericPlotter::printFile
void printFile(const std::string &, const TCanvas &) const
HLTTauDQMOffline_cfi.denominator
denominator
Definition: HLTTauDQMOffline_cfi.py:195
GenericPlotter::make_legend2D
TLegend * make_legend2D(const std::string, TH1 *) const
GenericPlotter::setLabels
void setLabels(std::vector< TH1 * > &) const
GenericPlotter::plotDocumentOpen
void plotDocumentOpen() const
GenericPlotter::drawOption2D_
const std::string drawOption2D_
Definition: GenericPlotter.h:15
GenericPlotter::plotDocumentAdd
void plotDocumentAdd(const TCanvas &) const