MINT2
RootPlotter.h
Go to the documentation of this file.
1 
11 #ifndef ROOT_PLOTTER_HH
12 #define ROOT_PLOTTER_HH
13 
14 #include "TH1.h"
15 #include "THStack.h"
16 #include "Plotter.h"
17 #include "TASImage.h"
18 #include "TSystem.h"
19 #include "MessageService.h"
20 #include "TLatex.h"
21 #include "TGraph.h"
22 
23 class RootPlotter : public Plotter{
24 
25  protected:
26 
27  TString _xAxisName;
28  TString _yAxisName;
30  std::vector<TString> _drawOptions;
31  std::vector<TString> _objDrawOptions;
34  virtual void setHistogramStyle(TH1* histogram, bool setMinMax = 1) = 0;
35 
36 
37  TH1* getHistogram(int i);
38 
39  public:
40 
41  void setXaxisName(TString name){_xAxisName = name;}
42  void setYaxisName(TString name){_yAxisName = name;}
44  virtual double getGlobalMax(){return 0.0;}
45  virtual double getGlobalMin(){return 0.0;}
47  RootPlotter(TH1* histogram, double width = 300, double height = 200);
48 
49  TString& drawOptions(int i);
50  TString& objDrawOptions(int i);
51 
52  //void plotDivisons(TPad* pad);
53  void plotStacked(TPad* pad, double scaleFactor);
54  void plotSame (TPad* pad, TString plotOptions, double scaleFactor = 1.0);
55  virtual void plot(TString plotDirectory, TString plotOptions = "", TPad* pad = 0, double scaleFactor = 1.0);
56 
57  void addText(TString text, double x, double y, int alignh = 1, int alignv = 2, double size = 0.06, int ndc = true, int color = kBlack);
58 
59  void drawLegend();
60 
61  virtual ~RootPlotter();
62 
63 };
64 
65 #endif
void setYaxisName(TString name)
Definition: RootPlotter.h:42
void drawLegend()
Definition: RootPlotter.cpp:49
virtual ~RootPlotter()
virtual double getGlobalMin()
Definition: RootPlotter.h:45
void plotSame(TPad *pad, TString plotOptions, double scaleFactor=1.0)
TString & objDrawOptions(int i)
Definition: RootPlotter.cpp:27
RootPlotter(TH1 *histogram, double width=300, double height=200)
Definition: RootPlotter.cpp:4
virtual double getGlobalMax()
Definition: RootPlotter.h:44
virtual void plot(TString plotDirectory, TString plotOptions="", TPad *pad=0, double scaleFactor=1.0)
TString & drawOptions(int i)
Definition: RootPlotter.cpp:21
TString _yAxisName
Definition: RootPlotter.h:28
void plotStacked(TPad *pad, double scaleFactor)
Definition: RootPlotter.cpp:74
TString _xAxisName
Definition: RootPlotter.h:27
virtual void setHistogramStyle(TH1 *histogram, bool setMinMax=1)=0
void addText(TString text, double x, double y, int alignh=1, int alignv=2, double size=0.06, int ndc=true, int color=kBlack)
Definition: RootPlotter.cpp:33
TH1 * getHistogram(int i)
Definition: RootPlotter.cpp:16
void setXaxisName(TString name)
Definition: RootPlotter.h:41
std::vector< TString > _drawOptions
Definition: RootPlotter.h:30
std::vector< TString > _objDrawOptions
Definition: RootPlotter.h:31