-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathPlotter.cxx
More file actions
88 lines (85 loc) · 3.12 KB
/
Plotter.cxx
File metadata and controls
88 lines (85 loc) · 3.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#include "Plotter.h"
#include "TStyle.h"
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
void Plotter::SetStyle(bool graypalette, bool title) {
gStyle->Reset("Plain");
gStyle->SetCanvasPreferGL(1);
gStyle->SetOptTitle(title);
gStyle->SetTitleBorderSize(0);
gStyle->SetOptStat(0);
if (graypalette) {
gStyle->SetPalette(8, 0);
} else {
gStyle->SetPalette(1);
}
gStyle->SetCanvasBorderMode(0);
gStyle->SetFrameLineWidth(1);
gStyle->SetCanvasColor(kWhite);
gStyle->SetPadBorderMode(0);
gStyle->SetCanvasBorderMode(0);
gStyle->SetFrameBorderMode(0);
gStyle->SetPadColor(10);
gStyle->SetPadTickX(1);
gStyle->SetPadTickY(1);
gStyle->SetPadBottomMargin(0.15);
gStyle->SetPadLeftMargin(0.15);
gStyle->SetHistLineWidth(1);
gStyle->SetHistLineColor(kBlack);
gStyle->SetMarkerColor(kBlack);
gStyle->SetMarkerStyle(24);
gStyle->SetFuncWidth(2);
gStyle->SetFuncColor(kOrange + 2);
gStyle->SetLineWidth(2);
gStyle->SetLabelSize(0.045, "xyz");
gStyle->SetLabelOffset(0.01, "y");
gStyle->SetLabelOffset(0.01, "x");
gStyle->SetLabelColor(kBlack, "xyz");
gStyle->SetTitleSize(0.05, "xyz");
gStyle->SetTitleOffset(1.25, "y");
gStyle->SetTitleOffset(1.2, "x");
gStyle->SetTitleColor(kBlack, "xyz");
gStyle->SetTextSizePixels(26);
gStyle->SetTextFont(42);
gStyle->SetLegendBorderSize(0);
gStyle->SetLegendFont(42);
gStyle->SetLegendBorderSize(0);
gStyle->SetPalette(55);
}
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
void Plotter::SetStyleHisto(TH1 *histo, int marker, int color) {
histo->GetXaxis()->SetLabelSize(fLabelSize);
histo->GetXaxis()->SetTitleSize(fTitleSize);
histo->GetXaxis()->SetLabelOffset(0.01);
histo->GetXaxis()->SetTitleOffset(1.2);
histo->GetXaxis()->SetLabelFont(42);
histo->GetYaxis()->SetLabelSize(fLabelSize);
histo->GetYaxis()->SetTitleSize(fTitleSize);
histo->GetYaxis()->SetLabelOffset(0.01);
histo->GetYaxis()->SetTitleOffset(1.25);
histo->GetZaxis()->SetLabelSize(fLabelSize);
histo->GetZaxis()->SetTitleSize(fTitleSize);
histo->GetZaxis()->SetLabelOffset(0.01);
histo->GetZaxis()->SetTitleOffset(1.25);
gStyle->SetTitleColor(kBlack, "xyz");
gStyle->SetLabelColor(kBlack, "xyz");
histo->SetMarkerStyle(marker);
histo->SetMarkerColor(color);
histo->SetLineColor(color);
}
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
void Plotter::SetStyleGraph(TGraph *graph, int marker, int color) {
graph->GetXaxis()->SetLabelSize(fLabelSize);
graph->GetXaxis()->SetTitleSize(fTitleSize);
graph->GetXaxis()->SetTitleColor(kBlack);
graph->GetXaxis()->SetLabelFont(42);
graph->GetYaxis()->SetLabelSize(fLabelSize);
graph->GetYaxis()->SetTitleSize(fTitleSize);
graph->GetYaxis()->SetLabelFont(42);
gStyle->SetTitleColor(kBlack, "xyz");
gStyle->SetLabelColor(kBlack, "xyz");
graph->SetMarkerStyle(marker);
graph->SetMarkerColor(color);
graph->SetLineColor(color);
graph->GetXaxis()->SetTitleOffset(1.15);
graph->GetYaxis()->SetTitleOffset(1.25);
}