35 namespace RestFrames {
39 const std::string& stitle)
40 :
RFBase(sname, stitle, -1){
49 int Ncan = m_Canvases.size();
50 for(
int i = 0; i < Ncan; i++)
53 int Nobj = m_TObjects.size();
54 for(
int i = 0; i < Nobj; i++)
60 int N = m_Canvases.size();
63 TFile* file =
new TFile(filename.c_str(),
"UPDATE");
66 for(
int i = 0; i < N; i++)
67 m_Canvases[i]->Write(
"",TObject::kOverwrite);
72 void RFPlot::AddCanvas(TCanvas* can){
73 m_Canvases.push_back(can);
76 void RFPlot::AddTObject(TObject* obj){
77 m_TObjects.push_back(obj);
80 int RFPlot::GetNCanvases(){
81 return m_Canvases.size();
84 std::string RFPlot::GetUniqueName(
const std::string& name){
86 std::string uniq_name = name;
87 while(gROOT->FindObject(uniq_name.c_str())){
90 uniq_name = name+
"_"+i.str();
100 void SetStyle(
bool invert_colors){
103 gStyle->SetCanvasBorderMode(0);
104 gStyle->SetCanvasColor(kWhite);
105 gStyle->SetCanvasDefX(0);
106 gStyle->SetCanvasDefY(0);
109 gStyle->SetPadBorderMode(0);
110 gStyle->SetPadColor(kWhite);
111 gStyle->SetGridColor(0);
112 gStyle->SetGridStyle(3);
113 gStyle->SetGridWidth(1);
116 gStyle->SetFrameBorderMode(0);
117 gStyle->SetFrameBorderSize(1);
118 gStyle->SetFrameFillColor(0);
119 gStyle->SetFrameFillStyle(0);
120 gStyle->SetFrameLineColor(1);
121 gStyle->SetFrameLineStyle(1);
122 gStyle->SetFrameLineWidth(1);
125 gStyle->SetPaperSize(20,26);
126 gStyle->SetPadTopMargin(0.09);
127 gStyle->SetPadRightMargin(0.25);
128 gStyle->SetPadBottomMargin(0.18);
129 gStyle->SetPadLeftMargin(0.15);
132 gStyle->SetTitleFont(132,
"xyz");
133 gStyle->SetTitleFont(132,
" ");
134 gStyle->SetTitleSize(0.06,
"xyz");
135 gStyle->SetTitleSize(0.06,
" ");
136 gStyle->SetLabelFont(132,
"xyz");
137 gStyle->SetLabelSize(0.05,
"xyz");
138 gStyle->SetLabelColor(1,
"xyz");
139 gStyle->SetTextFont(132);
140 gStyle->SetTextSize(0.08);
141 gStyle->SetStatFont(132);
144 gStyle->SetMarkerStyle(8);
145 gStyle->SetHistLineWidth(2);
146 gStyle->SetLineStyleString(2,
"[12 12]");
149 gStyle->SetErrorX(0.001);
152 gStyle->SetOptTitle(0);
153 gStyle->SetOptStat(0);
154 gStyle->SetOptFit(11111111);
157 gStyle->SetPadTickX(1);
158 gStyle->SetPadTickY(1);
161 double zcolor_s[5] = { 0.00, 0.50, 0.70, 0.82, 1.00 };
162 double zcolor_r[5] = { 0.00, 0.00, 0.74, 1.00, 1.00 };
163 double zcolor_g[5] = { 0.00, 0.61, 0.82, 0.70, 1.00 };
164 double zcolor_b[5] = { 0.31, 0.73, 0.08, 0.00, 1.00 };
165 double zcolor_is[5] = { 0.00, 0.15, 0.35, 0.60, 1.00 };
166 double zcolor_ir[5] = { 1.00, 1.00, 0.74, 0.00, 0.00 };
167 double zcolor_ig[5] = { 0.90, 0.70, 0.82, 0.61, 0.00 };
168 double zcolor_ib[5] = { 0.70, 0.00, 0.08, 0.73, 0.31 };
169 for(
int i = 0; i < 5; i++){
170 zcolor_s[i] = RFPlot::rf_zcolor_s[i];
171 zcolor_r[i] = RFPlot::rf_zcolor_r[i];
172 zcolor_g[i] = RFPlot::rf_zcolor_g[i];
173 zcolor_b[i] = RFPlot::rf_zcolor_b[i];
174 zcolor_is[i] = RFPlot::rf_zcolor_is[i];
175 zcolor_ir[i] = RFPlot::rf_zcolor_ir[i];
176 zcolor_ig[i] = RFPlot::rf_zcolor_ig[i];
177 zcolor_ib[i] = RFPlot::rf_zcolor_ib[i];
180 RFPlot::rf_iZPalette = TColor::CreateGradientColorTable(5, zcolor_is, zcolor_ir,
181 zcolor_ig, zcolor_ib,
182 RFPlot::rf_NZPalette);
183 RFPlot::rf_ZPalette = TColor::CreateGradientColorTable(5, zcolor_s, zcolor_r,
185 RFPlot::rf_NZPalette);
190 if(RFPlot::rf_ZPalette <= 0)
193 int palette[RFPlot::rf_NZPalette];
195 for(
int i = 0; i < RFPlot::rf_NZPalette; i++)
196 palette[i] = RFPlot::rf_iZPalette + i;
198 for(
int i = 0; i < RFPlot::rf_NZPalette; i++)
199 palette[i] = RFPlot::rf_ZPalette + i;
201 gStyle->SetPalette(RFPlot::rf_NZPalette, palette);
204 const int RFPlot::rf_NZPalette = 28;
205 int RFPlot::rf_ZPalette = 0;
206 int RFPlot::rf_iZPalette = 0;
207 const double RFPlot::rf_zcolor_s[5] = { 0.00, 0.50, 0.70, 0.82, 1.00 };
208 const double RFPlot::rf_zcolor_r[5] = { 0.00, 0.00, 0.74, 1.00, 1.00 };
209 const double RFPlot::rf_zcolor_g[5] = { 0.00, 0.61, 0.82, 0.70, 1.00 };
210 const double RFPlot::rf_zcolor_b[5] = { 0.31, 0.73, 0.08, 0.00, 1.00 };
211 const double RFPlot::rf_zcolor_is[5] = { 0.00, 0.15, 0.35, 0.60, 1.00 };
212 const double RFPlot::rf_zcolor_ir[5] = { 1.00, 1.00, 0.74, 0.00, 0.00 };
213 const double RFPlot::rf_zcolor_ig[5] = { 0.90, 0.70, 0.82, 0.61, 0.00 };
214 const double RFPlot::rf_zcolor_ib[5] = { 0.70, 0.00, 0.08, 0.73, 0.31 };
216 const TColor RFPlot::rf_blue0(7000,0.749,0.78,0.933);
217 const TColor RFPlot::rf_blue1(7001,0.424,0.467,0.651);
218 const TColor RFPlot::rf_blue2(7002,0.255,0.302,0.522);
219 const TColor RFPlot::rf_blue3(7003,0.114,0.165,0.396);
220 const TColor RFPlot::rf_blue4(7004,0.024,0.063,0.251);
221 const TColor RFPlot::rf_green0(7010,0.737,0.949,0.784);
222 const TColor RFPlot::rf_green1(7011,0.435,0.722,0.498);
223 const TColor RFPlot::rf_green2(7012,0.239,0.576,0.314);
224 const TColor RFPlot::rf_green3(7013,0.082,0.439,0.161);
225 const TColor RFPlot::rf_green4(7014,0,0.275,0.063);
226 const TColor RFPlot::rf_red0(7020,1,0.796,0.776);
227 const TColor RFPlot::rf_red1(7021,0.957,0.612,0.576);
228 const TColor RFPlot::rf_red2(7022,0.765,0.361,0.318);
229 const TColor RFPlot::rf_red3(7023,0.58,0.157,0.11);
230 const TColor RFPlot::rf_red4(7024,0.365,0.035,0);
231 const TColor RFPlot::rf_yellow0(7030,1,0.933,0.776);
232 const TColor RFPlot::rf_yellow1(7031,0.957,0.843,0.576);
233 const TColor RFPlot::rf_yellow2(7032,0.765,0.631,0.318);
234 const TColor RFPlot::rf_yellow3(7033,0.58,0.443,0.11);
235 const TColor RFPlot::rf_yellow4(7034,0.365,0.259,0);
236 const TColor RFPlot::rf_purple0(7040,0.937,0.729,0.898);
237 const TColor RFPlot::rf_purple1(7041,0.753,0.478,0.702);
238 const TColor RFPlot::rf_purple2(7042,0.6,0.286,0.541);
239 const TColor RFPlot::rf_purple3(7043,0.42,0.075,0.353);
240 const TColor RFPlot::rf_purple4(7044,0.196,0,0.161);
241 const TColor RFPlot::rf_cyan0(7050,0.714,0.898,0.918);
242 const TColor RFPlot::rf_cyan1(7051,0.424,0.639,0.659);
243 const TColor RFPlot::rf_cyan2(7052,0.247,0.49,0.51);
244 const TColor RFPlot::rf_cyan3(7053,0.067,0.329,0.357);
245 const TColor RFPlot::rf_cyan4(7054,0,0.153,0.169);
246 const TColor RFPlot::rf_orange0(7060,1,0.882,0.776);
247 const TColor RFPlot::rf_orange1(7061,1,0.808,0.639);
248 const TColor RFPlot::rf_orange2(7062,0.839,0.608,0.4);
249 const TColor RFPlot::rf_orange3(7063,0.584,0.329,0.106);
250 const TColor RFPlot::rf_orange4(7064,0.275,0.129,0);
251 const TColor RFPlot::rf_lime0(7070,0.941,0.992,0.769);
252 const TColor RFPlot::rf_lime1(7071,0.882,0.961,0.612);
253 const TColor RFPlot::rf_lime2(7072,0.706,0.8,0.38);
254 const TColor RFPlot::rf_lime3(7073,0.455,0.557,0.098);
255 const TColor RFPlot::rf_lime4(7074,0.204,0.263,0);