CMS 3D CMS Logo

StatisticalPlot.h
Go to the documentation of this file.
1 
12 #ifndef __StatisticalPlot__
13 #define __StatisticalPlot__
14 
15 #include "TNamed.h"
16 #include "TCanvas.h"
17 
18 #include "TFile.h"
19 
20 class StatisticalPlot : public TNamed {
21 public:
23  StatisticalPlot(const char* name, const char* title, bool verbosity = true);
24 
26  ~StatisticalPlot() override;
27 
29  void setVerbosity(bool verbosity);
30 
32  bool is_verbose();
33 
35  TCanvas* getCanvas() { return m_canvas; }
36 
38  void setCanvas(TCanvas* new_canvas) { m_canvas = new_canvas; }
39 
41  void dumpToImage(const char* filename) { m_canvas->Print(filename); }
42 
44  virtual void draw(const char* options = "") = 0;
45 
47  virtual void print(const char* options = "") = 0;
48 
50  virtual void dumpToFile(const char* RootFileName, const char* options = "") = 0;
51 
52 private:
54  bool m_verbose;
55 
57  TCanvas* m_canvas;
58 
59 //For Cint
60 #if (defined(STANDALONE) or defined(__CINT__))
61  ClassDef(StatisticalPlot, 1)
62 #endif
63 };
64 
65 #endif
66 // Automatically converted from the standalone version Wed Apr 15 11:36:34 2009
bool m_verbose
Verbosity flag.
virtual void print(const char *options="")=0
Print the relevant information.
virtual void draw(const char *options="")=0
Draw on canvas.
void setCanvas(TCanvas *new_canvas)
Set the canvas.
TCanvas * m_canvas
Canvas.
~StatisticalPlot() override
Destructor.
StatisticalPlot: the base class for the statistical plots.
void dumpToImage(const char *filename)
Write an image on disk.
TCanvas * getCanvas()
Get the canvas.
StatisticalPlot(const char *name, const char *title, bool verbosity=true)
Constructor.
bool is_verbose()
get the verbosity
virtual void dumpToFile(const char *RootFileName, const char *options="")=0
All the objects are written to rootfile.
void setVerbosity(bool verbosity)
Set the verbosity.