LOGO

RestFrames  v1.0.0
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  RFPlot(const std::string& sname, const std::string& stitle);
44  ~RFPlot();
45 
46  virtual void Clear();
47 
48  void WriteOutput(const std::string& filename);
49 
50  static const TColor rf_blue0;
51  static const TColor rf_blue1;
52  static const TColor rf_blue2;
53  static const TColor rf_blue3;
54  static const TColor rf_blue4;
55  static const TColor rf_green0;
56  static const TColor rf_green1;
57  static const TColor rf_green2;
58  static const TColor rf_green3;
59  static const TColor rf_green4;
60  static const TColor rf_red0;
61  static const TColor rf_red1;
62  static const TColor rf_red2;
63  static const TColor rf_red3;
64  static const TColor rf_red4;
65  static const TColor rf_yellow0;
66  static const TColor rf_yellow1;
67  static const TColor rf_yellow2;
68  static const TColor rf_yellow3;
69  static const TColor rf_yellow4;
70  static const TColor rf_cyan0;
71  static const TColor rf_cyan1;
72  static const TColor rf_cyan2;
73  static const TColor rf_cyan3;
74  static const TColor rf_cyan4;
75  static const TColor rf_lime0;
76  static const TColor rf_lime1;
77  static const TColor rf_lime2;
78  static const TColor rf_lime3;
79  static const TColor rf_lime4;
80  static const TColor rf_purple0;
81  static const TColor rf_purple1;
82  static const TColor rf_purple2;
83  static const TColor rf_purple3;
84  static const TColor rf_purple4;
85  static const TColor rf_orange0;
86  static const TColor rf_orange1;
87  static const TColor rf_orange2;
88  static const TColor rf_orange3;
89  static const TColor rf_orange4;
90 
91  friend void SetStyle(bool invert_colors);
92  friend void SetZPalette(bool invert_colors);
93 
94  protected:
95  TCanvas* m_CanvasPtr;
96  void AddCanvas(TCanvas* can);
97  void AddTObject(TObject* obj);
98  int GetNCanvases();
99  std::string GetUniqueName(const std::string& name);
100 
101  private:
102  std::vector<TObject*> m_TObjects;
103  std::vector<TCanvas*> m_Canvases;
104 
105  static const int rf_NZPalette;
106  static int rf_ZPalette;
107  static int rf_iZPalette;
108  static const double rf_zcolor_s[5];
109  static const double rf_zcolor_r[5];
110  static const double rf_zcolor_g[5];
111  static const double rf_zcolor_b[5];
112  static const double rf_zcolor_is[5];
113  static const double rf_zcolor_ir[5];
114  static const double rf_zcolor_ig[5];
115  static const double rf_zcolor_ib[5];
116 
117  };
118 
119  void SetStyle();
120  void SetStyle(bool invert_colors);
121  void SetZPalette(bool invert_colors = false);
122 
123 }
124 
125 #endif
Base class for all RestFrame package objects.
Definition: RFBase.hh:53
virtual void Clear()
Clears RFBase of all connections to other objects.
Definition: RFPlot.cc:48