LOGO

RestFrames  v1.0.1
RestFrames HEP Event Analysis Software Library
RFPlot.hh
Go to the documentation of this file.
1 // RestFrames: particle physics event analysis library
3 // --------------------------------------------------------------------
4 // Copyright (c) 2014-2016, Christopher Rogan
14 // This file is part of RestFrames.
15 //
16 // RestFrames is free software; you can redistribute it and/or modify
17 // it under the terms of the GNU General Public License as published by
18 // the Free Software Foundation; either version 2 of the License, or
19 // (at your option) any later version.
20 //
21 // RestFrames is distributed in the hope that it will be useful,
22 // but WITHOUT ANY WARRANTY; without even the implied warranty of
23 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 // GNU General Public License for more details.
25 //
26 // You should have received a copy of the GNU General Public License
27 // along with RestFrames. If not, see <http://www.gnu.org/licenses/>.
29 
30 #ifndef RFPlot_HH
31 #define RFPlot_HH
32 
33 #include <TCanvas.h>
34 #include <TColor.h>
35 #include <TFile.h>
36 
37 #include "RestFrames/RFBase.hh"
38 
39 namespace RestFrames {
40 
41  class RFPlot : public RFBase {
42  public:
43 
48  RFPlot(const std::string& sname, const std::string& stitle);
49  ~RFPlot();
50 
52  virtual void Clear();
53 
57  void WriteOutput(const std::string& filename);
58 
59  static const TColor rf_blue0;
60  static const TColor rf_blue1;
61  static const TColor rf_blue2;
62  static const TColor rf_blue3;
63  static const TColor rf_blue4;
64  static const TColor rf_green0;
65  static const TColor rf_green1;
66  static const TColor rf_green2;
67  static const TColor rf_green3;
68  static const TColor rf_green4;
69  static const TColor rf_red0;
70  static const TColor rf_red1;
71  static const TColor rf_red2;
72  static const TColor rf_red3;
73  static const TColor rf_red4;
74  static const TColor rf_yellow0;
75  static const TColor rf_yellow1;
76  static const TColor rf_yellow2;
77  static const TColor rf_yellow3;
78  static const TColor rf_yellow4;
79  static const TColor rf_cyan0;
80  static const TColor rf_cyan1;
81  static const TColor rf_cyan2;
82  static const TColor rf_cyan3;
83  static const TColor rf_cyan4;
84  static const TColor rf_lime0;
85  static const TColor rf_lime1;
86  static const TColor rf_lime2;
87  static const TColor rf_lime3;
88  static const TColor rf_lime4;
89  static const TColor rf_purple0;
90  static const TColor rf_purple1;
91  static const TColor rf_purple2;
92  static const TColor rf_purple3;
93  static const TColor rf_purple4;
94  static const TColor rf_orange0;
95  static const TColor rf_orange1;
96  static const TColor rf_orange2;
97  static const TColor rf_orange3;
98  static const TColor rf_orange4;
99 
104  friend void SetStyle(bool invert_colors);
105 
110  friend void SetZPalette(bool invert_colors);
111 
112  protected:
113  TCanvas* m_CanvasPtr;
114  void AddCanvas(TCanvas* can);
115  void AddTObject(TObject* obj);
116  int GetNCanvases();
117  std::string GetUniqueName(const std::string& name);
118 
119  private:
120  std::vector<TObject*> m_TObjects;
121  std::vector<TCanvas*> m_Canvases;
122 
123  static const int rf_NZPalette;
124  static int rf_ZPalette;
125  static int rf_iZPalette;
126  static const double rf_zcolor_s[5];
127  static const double rf_zcolor_r[5];
128  static const double rf_zcolor_g[5];
129  static const double rf_zcolor_b[5];
130  static const double rf_zcolor_is[5];
131  static const double rf_zcolor_ir[5];
132  static const double rf_zcolor_ig[5];
133  static const double rf_zcolor_ib[5];
134 
135  };
136 
137  void SetStyle();
138  void SetStyle(bool invert_colors);
139  void SetZPalette(bool invert_colors = false);
140 
141 }
142 
143 #endif
RestFrames::RFPlot::Clear
virtual void Clear()
Clears RFPlot from all connections to other objects.
Definition: RFPlot.cc:48
RestFrames::RFBase
Base class for all RestFrame package objects.
Definition: RFBase.hh:53
RestFrames::RFPlot::WriteOutput
void WriteOutput(const std::string &filename)
Stores all plots in root file.
Definition: RFPlot.cc:59
RestFrames::RFPlot::RFPlot
RFPlot(const std::string &sname, const std::string &stitle)
Standard constructor.
Definition: RFPlot.cc:38
RFBase.hh
RestFrames::SetZPalette
void SetZPalette(bool invert_colors=false)
Definition: RFPlot.cc:189
RestFrames::RFPlot
Abstract base class for all plotting objects.
Definition: RFPlot.hh:41
RestFrames::RFPlot::SetZPalette
friend void SetZPalette(bool invert_colors)
Definition: RFPlot.cc:189
RestFrames::RFPlot::SetStyle
friend void SetStyle(bool invert_colors)
Sets "RestFrames" style for plots.
Definition: RFPlot.cc:100