74 TStyle* defaultSty =
new TStyle(
"default",
"default");
75 defaultSty->SetPaperSize(TStyle::kA4);
76 defaultSty->SetTextFont(font);
79 defaultSty->SetCanvasBorderMode(0);
80 defaultSty->SetCanvasColor(bgrdcolor);
81 defaultSty->SetCanvasDefH(600);
82 defaultSty->SetCanvasDefW(600);
83 defaultSty->SetCanvasDefX(0);
84 defaultSty->SetCanvasDefY(0);
87 defaultSty->SetPadBorderMode(0);
89 defaultSty->SetPadColor(bgrdcolor);
90 defaultSty->SetPadGridX(
false);
91 defaultSty->SetPadGridY(
false);
92 defaultSty->SetGridColor(0);
93 defaultSty->SetGridStyle(3);
94 defaultSty->SetGridWidth(1);
97 defaultSty->SetFrameBorderMode(0);
98 defaultSty->SetFrameBorderSize(1);
99 defaultSty->SetFrameFillColor(bgrdcolor);
100 defaultSty->SetFrameFillStyle(0);
101 defaultSty->SetFrameLineColor(1);
102 defaultSty->SetFrameLineStyle(1);
103 defaultSty->SetFrameLineWidth(1);
106 defaultSty->SetPadTopMargin(0.075);
107 defaultSty->SetPadBottomMargin(0.18);
108 defaultSty->SetPadLeftMargin(0.18);
109 defaultSty->SetPadRightMargin(0.075);
112 defaultSty->SetHistFillColor(bgrdcolor);
114 defaultSty->SetHatchesSpacing(2.);
115 defaultSty->SetHatchesLineWidth(2);
116 defaultSty->SetHistLineColor(1);
117 defaultSty->SetHistLineStyle(0);
118 defaultSty->SetHistLineWidth(2);
120 defaultSty->SetHistMinimumZero();
122 defaultSty->SetErrorX(0.0);
123 defaultSty->SetLineColor(1);
124 defaultSty->SetMarkerColor(1);
125 defaultSty->SetMarkerStyle(kFullCircle);
126 defaultSty->SetMarkerSize(1.5);
130 defaultSty->SetOptFit(1);
131 defaultSty->SetFitFormat(
"5.4g");
132 defaultSty->SetFuncColor(2);
133 defaultSty->SetFuncStyle(1);
134 defaultSty->SetFuncWidth(1);
137 defaultSty->SetOptDate(22);
140 defaultSty->GetAttDate()->SetTextColor(kGray);
141 defaultSty->GetAttDate()->SetTextFont(font);
142 defaultSty->GetAttDate()->SetTextSize(0.02);
145 defaultSty->SetOptFile(0);
146 defaultSty->SetOptStat(0);
148 defaultSty->SetStatColor(kWhite);
149 defaultSty->SetStatFont(font);
150 defaultSty->SetStatFontSize(0.02);
151 defaultSty->SetStatTextColor(kGray);
152 defaultSty->SetStatFormat(
"6.4g");
153 defaultSty->SetStatBorderSize(1);
154 defaultSty->SetStatH(0.1);
155 defaultSty->SetStatW(0.5);
156 defaultSty->SetStatStyle(kFEmpty);
157 defaultSty->SetStatX(0.01);
158 defaultSty->SetStatY(0.01);
161 defaultSty->SetOptTitle(0);
162 defaultSty->SetTitleFont(font,
"T");
163 defaultSty->SetTitleSize(0.05,
"T");
164 defaultSty->SetTitleColor(bgrdcolor,
"T");
165 defaultSty->SetTitleTextColor(1);
166 defaultSty->SetTitleFillColor(bgrdcolor);
167 defaultSty->SetTitleFontSize(0.06);
169 defaultSty->SetTitleW(0.5);
170 defaultSty->SetTitleX(0.25);
172 defaultSty->SetTitleStyle(kFEmpty);
174 defaultSty->SetPaintTextFormat(
".3f");
178 defaultSty->SetFillStyle(kFEmpty);
179 defaultSty->SetLineColor(0);
180 defaultSty->SetLineWidth(0);
181 defaultSty->SetLineStyle(1);
184 defaultSty->SetTitleColor(1,
"XYZ");
185 defaultSty->SetTitleFont(font,
"XYZ");
186 defaultSty->SetTitleSize(0.06,
"XYZ");
189 defaultSty->SetTitleXOffset(1.0);
190 defaultSty->SetTitleYOffset(1.25);
194 defaultSty->SetLabelColor(1,
"XYZ");
195 defaultSty->SetLabelFont(font,
"XYZ");
196 defaultSty->SetLabelOffset(0.007,
"XYZ");
197 defaultSty->SetLabelSize(0.04,
199 defaultSty->SetLabelSize(0.03,
203 defaultSty->SetHistMinimumZero();
204 defaultSty->SetAxisColor(1,
"XYZ");
207 defaultSty->SetNdivisions(810,
"XYZ");
208 defaultSty->SetPadTickX(1);
209 defaultSty->SetPadTickY(1);
212 defaultSty->SetOptLogx(0);
213 defaultSty->SetOptLogy(0);
214 defaultSty->SetOptLogz(0);
218 const Int_t NRGBs = 5;
219 const Int_t NCont = 255;
221 Double_t red[NRGBs] = {0.00, 0.00, 0.87, 1.00, 0.51};
222 Double_t green[NRGBs] = {0.00, 0.81, 1.00, 0.20, 0.00};
225 Double_t blue[NRGBs] = {0.51, 1.00, 0.12, 0.00, 0.00};
226 Double_t stops[NRGBs] = {0.00, 0.34, 0.61, 0.84, 1.00};
227 TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
228 defaultSty->SetNumberContours(NCont);
232 defaultSty->SetLegendFillColor(bgrdcolor);
234 defaultSty->SetLegendFont(font);
238 defaultSty->SetFillStyle(4000);
239 defaultSty->SetStatStyle(0);
240 defaultSty->SetTitleStyle(0);
241 defaultSty->SetCanvasBorderSize(0);
242 defaultSty->SetFrameBorderSize(0);
243 defaultSty->SetLegendBorderSize(0);
244 defaultSty->SetStatBorderSize(0);
245 defaultSty->SetTitleBorderSize(0);
251 fUserDielStyle = defaultSty;
255 TGaxis::SetMaxDigits(3);
256 TGaxis::SetExponentOffset(-1. * 0.06, 0.,
"y");
270 if (obj->InheritsFrom(TH1::Class()) && gPad) {
272 dynamic_cast<TH1*
>(obj)->GetXaxis()->SetName(
"xaxis");
273 dynamic_cast<TH1*
>(obj)->GetYaxis()->SetName(
"yaxis");
275 if (gPad->GetLogx()) {
276 dynamic_cast<TH1*
>(obj)->GetXaxis()->SetMoreLogLabels(kTRUE);
277 dynamic_cast<TH1*
>(obj)->GetXaxis()->SetNoExponent(kTRUE);
279 if (gPad->GetLogy()) {
280 dynamic_cast<TH1*
>(obj)->GetYaxis()->SetMoreLogLabels(kTRUE);
281 dynamic_cast<TH1*
>(obj)->GetYaxis()->SetNoExponent(kTRUE);
283 if (gPad->GetLogz()) {
284 dynamic_cast<TH1*
>(obj)->GetZaxis()->SetMoreLogLabels(kTRUE);
285 dynamic_cast<TH1*
>(obj)->GetZaxis()->SetNoExponent(kTRUE);
290 if (obj->InheritsFrom(TAttMarker::Class())) {
292 dynamic_cast<TAttMarker*
>(obj)->SetMarkerSize(fSze[idx -
static_cast<Int_t
>(Eidx::kRaw)]);
293 dynamic_cast<TAttMarker*
>(obj)->SetMarkerStyle(fMrk[idx -
static_cast<Int_t
>(Eidx::kRaw)]);
294 dynamic_cast<TAttMarker*
>(obj)->SetMarkerColor(fCol[idx -
static_cast<Int_t
>(Eidx::kRaw)]);
297 dynamic_cast<TAttMarker*
>(obj)->SetMarkerSize(1.5);
298 dynamic_cast<TAttMarker*
>(obj)->SetMarkerStyle(Marker[idx %
static_cast<Int_t
>(Estyle::kNMaxMarker)]);
299 dynamic_cast<TAttMarker*
>(obj)->SetMarkerColor(Color[idx %
static_cast<Int_t
>(Estyle::kNMaxColor)]);
300 if (idx >=
static_cast<Int_t
>(Estyle::kNMaxColor) && idx <
static_cast<Int_t
>(Estyle::kNMaxColor) * 2) {
301 idx = idx %
static_cast<Int_t
>(Estyle::kNMaxColor);
302 dynamic_cast<TAttMarker*
>(obj)->SetMarkerColor(TColor::GetColorDark(Color[idx]));
304 else if (idx >=
static_cast<Int_t
>(Estyle::kNMaxColor) * 2) {
305 idx = idx % (2 *
static_cast<Int_t
>(Estyle::kNMaxColor));
306 dynamic_cast<TAttMarker*
>(obj)->SetMarkerColor(TColor::GetColorBright(Color[idx]));
312 if (obj->InheritsFrom(TAttLine::Class())) {
315 dynamic_cast<TAttLine*
>(obj)->SetLineWidth(fWdt[idx -
static_cast<Int_t
>(Eidx::kRaw)]);
316 dynamic_cast<TAttLine*
>(obj)->SetLineStyle(fLne[idx -
static_cast<Int_t
>(Eidx::kRaw)]);
317 dynamic_cast<TAttLine*
>(obj)->SetLineColor(fCol[idx -
static_cast<Int_t
>(Eidx::kRaw)]);
320 dynamic_cast<TAttLine*
>(obj)->SetLineWidth(2);
321 dynamic_cast<TAttLine*
>(obj)->SetLineStyle(Line[idx %
static_cast<Int_t
>(Estyle::kNMaxLine)]);
322 dynamic_cast<TAttLine*
>(obj)->SetLineColor(Color[idx %
static_cast<Int_t
>(Estyle::kNMaxColor)]);
323 if (idx >=
static_cast<Int_t
>(Estyle::kNMaxColor) && idx <
static_cast<Int_t
>(Estyle::kNMaxColor) * 2) {
324 idx = idx %
static_cast<Int_t
>(Estyle::kNMaxColor);
325 dynamic_cast<TAttLine*
>(obj)->SetLineColor(TColor::GetColorDark(Color[idx]));
327 else if (idx >=
static_cast<Int_t
>(Estyle::kNMaxColor) * 2) {
328 idx = idx % (2 *
static_cast<Int_t
>(Estyle::kNMaxColor));
329 dynamic_cast<TAttLine*
>(obj)->SetLineColor(TColor::GetColorBright(Color[idx]));
335 if (obj->InheritsFrom(TAttFill::Class())) {
337 if (idx >= 100 && fFll[idx -
static_cast<Int_t
>(Eidx::kRaw)] >= 0) {
338 dynamic_cast<TAttFill*
>(obj)->SetFillColor(fCol[idx -
static_cast<Int_t
>(Eidx::kRaw)]);
339 dynamic_cast<TAttFill*
>(obj)->SetFillStyle(fFll[idx -
static_cast<Int_t
>(Eidx::kRaw)]);
341 else if (Fill[0] >= 0) {
342 dynamic_cast<TAttFill*
>(obj)->SetFillColor(Color[idx %
static_cast<Int_t
>(Estyle::kNMaxColor)]);
343 if (idx >=
static_cast<Int_t
>(Estyle::kNMaxColor) && idx <
static_cast<Int_t
>(Estyle::kNMaxColor) * 2) {
344 idx = idx %
static_cast<Int_t
>(Estyle::kNMaxColor);
345 dynamic_cast<TAttFill*
>(obj)->SetFillColor(TColor::GetColorDark(Color[idx]));
347 else if (idx >=
static_cast<Int_t
>(Estyle::kNMaxColor) * 2) {
348 idx = idx % (2 *
static_cast<Int_t
>(Estyle::kNMaxColor));
349 dynamic_cast<TAttFill*
>(obj)->SetFillColor(TColor::GetColorBright(Color[idx]));
351 dynamic_cast<TAttFill*
>(obj)->SetFillStyle(Fill[0]);
479 Double_t maxhgth = 0.0;
480 Double_t symblwdth = 0.065;
481 Double_t txtsze = 0.04;
483 Double_t entrysep = 1.25;
486 Double_t maxwdth = 0.0;
487 TList* llist = leg->GetListOfPrimitives();
488 Int_t nent = llist->GetEntries();
490 if (nent > 5) txtsze = 0.03;
491 leg->SetTextSize(txtsze);
495 for (Int_t il = 0; il < nent; il++) {
496 TLegendEntry* lent =
static_cast<TLegendEntry*
>(llist->At(il));
497 TString lst(lent->GetLabel());
500 lst.ReplaceAll(
"{",
"");
501 lst.ReplaceAll(
"}",
"");
502 lst.ReplaceAll(
"^",
"");
503 lst.ReplaceAll(
"_",
"");
504 lst.ReplaceAll(
"#LT",
"#");
505 lst.ReplaceAll(
"#GT",
"#");
506 lst.ReplaceAll(
"#phi",
"#");
507 lst.ReplaceAll(
"#rho",
"#");
508 lst.ReplaceAll(
"#omega",
"#");
509 lst.ReplaceAll(
"#eta",
"#");
510 lst.ReplaceAll(
"#epsilon",
"#");
511 lst.ReplaceAll(
"#psi",
"#");
512 lst.ReplaceAll(
"#pi",
"#");
513 lst.ReplaceAll(
"#alpha",
"#");
514 lst.ReplaceAll(
"#gamma",
"#");
515 lst.ReplaceAll(
"#rightarrow",
"#");
518 TLatex entrytex(0., 0., lst.Data());
519 entrytex.SetNDC(kTRUE);
520 entrytex.SetTextSize(txtsze);
521 entrytex.SetTextFont(gStyle->GetLegendFont());
523 Double_t wdth = entrytex.GetXsize();
524 Double_t hgth = entrytex.GetYsize();
526 if (maxwdth < wdth) maxwdth = wdth;
532 maxhgth = nent * txtsze * entrysep;
537 if (fLegAlign == 12 || fLegAlign == 22) {
538 leg->SetY2(1. - gPad->GetTopMargin() - gStyle->GetTickLength(
"X"));
539 leg->SetY1(leg->GetY2() - maxhgth);
542 leg->SetY1(0. + gPad->GetBottomMargin() + gStyle->GetTickLength(
"X"));
543 leg->SetY2(leg->GetY1() + maxhgth);
545 if (fLegAlign == 22 || fLegAlign == 21) {
546 leg->SetX2(1. - gPad->GetRightMargin() - gStyle->GetTickLength(
"Y") * 1.0);
547 leg->SetX1(leg->GetX2() - maxwdth * 1.0 - symblwdth);
549 else if (fLegAlign == 12 || fLegAlign == 11) {
550 leg->SetX1(0. + gPad->GetLeftMargin() + gStyle->GetTickLength(
"Y"));
551 leg->SetX2(leg->GetX1() + maxwdth * 1.0 + symblwdth);
555 leg->SetMargin(symblwdth / (leg->GetX2() - leg->GetX1()));
556 leg->SetEntrySeparation(entrysep - 1.);
559 if (fill) leg->SetFillStyle(1001);
561 leg->SetFillStyle(kFEmpty);
575 const Int_t NRGBs = 5;
576 const Int_t NCont = 255;
577 Double_t stops[NRGBs] = {0.00, 0.34, 0.61, 0.84, 1.00};
580 case Epalette::kDefault: {
581 Double_t red[NRGBs] = {0.00, 0.00, 0.87, 1.00, 0.51};
582 Double_t green[NRGBs] = {0.00, 0.81, 1.00, 0.20, 0.00};
583 Double_t blue[NRGBs] = {0.51, 1.00, 0.12, 0.00, 0.00};
584 if (reverse) TColor::CreateGradientColorTable(NRGBs, stops, blue, green, red, NCont);
586 TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
589 case Epalette::kGoodBad: {
590 Double_t red[NRGBs] = {0.00, 0.00, 0.87, 1.00, 0.36};
591 Double_t green[NRGBs] = {0.20, 0.81, 1.00, 0.20, 0.00};
592 Double_t blue[NRGBs] = {0.00, 0.00, 0.00, 0.00, 0.00};
593 if (reverse) TColor::CreateGradientColorTable(NRGBs, stops, green, red, blue, NCont);
595 TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
601 gStyle->SetNumberContours(NCont);