1 |
#include "TStyle.h"
|
2 |
|
3 |
void setTDRStyle() {
|
4 |
TStyle *tdrStyle = new TStyle("tdrStyle","Style for P-TDR");
|
5 |
tdrStyle->SetLegendBorderSize(0);
|
6 |
|
7 |
// For the canvas:
|
8 |
tdrStyle->SetCanvasBorderMode(0);
|
9 |
tdrStyle->SetCanvasColor(0);
|
10 |
tdrStyle->SetCanvasDefH(600); //Height of canvas
|
11 |
tdrStyle->SetCanvasDefW(600); //Width of canvas
|
12 |
tdrStyle->SetCanvasDefX(0); //POsition on screen
|
13 |
tdrStyle->SetCanvasDefY(0);
|
14 |
|
15 |
// tdrStyle->SetCanvasFillStyle(4000); // transparent -> does not exist
|
16 |
// tdrStyle->SetFillStyle(4000); // transparent ?
|
17 |
|
18 |
|
19 |
// For the Pad:
|
20 |
tdrStyle->SetPadBorderMode(0);
|
21 |
// tdrStyle->SetPadBorderSize(Width_t size = 1);
|
22 |
tdrStyle->SetPadColor(0);
|
23 |
tdrStyle->SetPadGridX(false);
|
24 |
tdrStyle->SetPadGridY(false);
|
25 |
tdrStyle->SetGridColor(0);
|
26 |
tdrStyle->SetGridStyle(3);
|
27 |
tdrStyle->SetGridWidth(1);
|
28 |
|
29 |
// For the frame:
|
30 |
tdrStyle->SetFrameBorderMode(0);
|
31 |
tdrStyle->SetFrameBorderSize(1);
|
32 |
tdrStyle->SetFrameFillColor(1);
|
33 |
tdrStyle->SetFrameFillStyle(0); //was 0
|
34 |
tdrStyle->SetFrameLineColor(1);
|
35 |
tdrStyle->SetFrameLineStyle(1);
|
36 |
tdrStyle->SetFrameLineWidth(1);
|
37 |
// needded for transparency
|
38 |
tdrStyle->SetFrameFillStyle(1000);
|
39 |
tdrStyle->SetFrameFillColor(0);
|
40 |
|
41 |
|
42 |
|
43 |
|
44 |
// For the histo:
|
45 |
// tdrStyle->SetHistFillColor(1);
|
46 |
// tdrStyle->SetHistFillStyle(0);
|
47 |
tdrStyle->SetHistLineColor(1);
|
48 |
tdrStyle->SetHistLineStyle(0);
|
49 |
tdrStyle->SetHistLineWidth(1);
|
50 |
// tdrStyle->SetLegoInnerR(Float_t rad = 0.5);
|
51 |
// tdrStyle->SetNumberContours(Int_t number = 20);
|
52 |
|
53 |
tdrStyle->SetEndErrorSize(2);
|
54 |
//tdrStyle->SetErrorMarker(20);
|
55 |
tdrStyle->SetErrorX(0.);
|
56 |
|
57 |
// tdrStyle->SetMarkerStyle(20);
|
58 |
|
59 |
//For the fit/function:
|
60 |
tdrStyle->SetOptFit(1);
|
61 |
tdrStyle->SetFitFormat("5.4g");
|
62 |
tdrStyle->SetFuncColor(2);
|
63 |
tdrStyle->SetFuncStyle(1);
|
64 |
tdrStyle->SetFuncWidth(1);
|
65 |
|
66 |
//For the date:
|
67 |
tdrStyle->SetOptDate(0);
|
68 |
// tdrStyle->SetDateX(Float_t x = 0.01);
|
69 |
// tdrStyle->SetDateY(Float_t y = 0.01);
|
70 |
|
71 |
// For the statistics box:
|
72 |
tdrStyle->SetOptFile(0);
|
73 |
tdrStyle->SetOptStat(0); // To display the mean and RMS: SetOptStat("mr");
|
74 |
tdrStyle->SetStatColor(kWhite);
|
75 |
tdrStyle->SetStatFont(42);
|
76 |
tdrStyle->SetStatFontSize(0.025);
|
77 |
tdrStyle->SetStatTextColor(1);
|
78 |
tdrStyle->SetStatFormat("6.4g");
|
79 |
tdrStyle->SetStatBorderSize(1);
|
80 |
tdrStyle->SetStatH(0.1);
|
81 |
tdrStyle->SetStatW(0.15);
|
82 |
// tdrStyle->SetStatStyle(Style_t style = 1001);
|
83 |
// tdrStyle->SetStatX(Float_t x = 0);
|
84 |
// tdrStyle->SetStatY(Float_t y = 0);
|
85 |
|
86 |
// Margins:
|
87 |
tdrStyle->SetPadTopMargin(0.05);
|
88 |
tdrStyle->SetPadBottomMargin(0.13);
|
89 |
tdrStyle->SetPadLeftMargin(0.13);
|
90 |
tdrStyle->SetPadRightMargin(0.05);
|
91 |
|
92 |
// For the Global title:
|
93 |
|
94 |
tdrStyle->SetOptTitle(0);
|
95 |
tdrStyle->SetTitleFont(42);
|
96 |
tdrStyle->SetTitleColor(1);
|
97 |
tdrStyle->SetTitleTextColor(1);
|
98 |
tdrStyle->SetTitleFillColor(10);
|
99 |
tdrStyle->SetTitleFontSize(0.05);
|
100 |
// tdrStyle->SetTitleH(0); // Set the height of the title box
|
101 |
// tdrStyle->SetTitleW(0); // Set the width of the title box
|
102 |
// tdrStyle->SetTitleX(0); // Set the position of the title box
|
103 |
// tdrStyle->SetTitleY(0.985); // Set the position of the title box
|
104 |
// tdrStyle->SetTitleStyle(Style_t style = 1001);
|
105 |
// tdrStyle->SetTitleBorderSize(2);
|
106 |
|
107 |
// For the axis titles:
|
108 |
|
109 |
tdrStyle->SetTitleColor(1, "XYZ");
|
110 |
tdrStyle->SetTitleFont(42, "XYZ");
|
111 |
tdrStyle->SetTitleSize(0.06, "XYZ");
|
112 |
// tdrStyle->SetTitleXSize(Float_t size = 0.02); // Another way to set the size?
|
113 |
// tdrStyle->SetTitleYSize(Float_t size = 0.02);
|
114 |
tdrStyle->SetTitleXOffset(0.9);
|
115 |
tdrStyle->SetTitleYOffset(1.05);
|
116 |
// tdrStyle->SetTitleOffset(1.1, "Y"); // Another way to set the Offset
|
117 |
|
118 |
// For the axis labels:
|
119 |
|
120 |
tdrStyle->SetLabelColor(1, "XYZ");
|
121 |
// tdrStyle->SetLabelFont(42, "XYZ");
|
122 |
tdrStyle->SetLabelOffset(0.007, "XYZ");
|
123 |
tdrStyle->SetLabelSize(0.05, "XYZ");
|
124 |
|
125 |
// For the axis:
|
126 |
|
127 |
tdrStyle->SetAxisColor(1, "XYZ");
|
128 |
tdrStyle->SetStripDecimals(kTRUE);
|
129 |
tdrStyle->SetTickLength(0.03, "XYZ");
|
130 |
tdrStyle->SetNdivisions(510, "XYZ");
|
131 |
tdrStyle->SetPadTickX(1); // To get tick marks on the opposite side of the frame
|
132 |
tdrStyle->SetPadTickY(1);
|
133 |
|
134 |
// Change for log plots:
|
135 |
tdrStyle->SetOptLogx(0);
|
136 |
tdrStyle->SetOptLogy(0);
|
137 |
tdrStyle->SetOptLogz(0);
|
138 |
|
139 |
// Postscript options:
|
140 |
// tdrStyle->SetPaperSize(15.,15.);
|
141 |
// tdrStyle->SetLineScalePS(Float_t scale = 3);
|
142 |
// tdrStyle->SetLineStyleString(Int_t i, const char* text);
|
143 |
// tdrStyle->SetHeaderPS(const char* header);
|
144 |
// tdrStyle->SetTitlePS(const char* pstitle);
|
145 |
|
146 |
// tdrStyle->SetBarOffset(Float_t baroff = 0.5);
|
147 |
// tdrStyle->SetBarWidth(Float_t barwidth = 0.5);
|
148 |
// tdrStyle->SetPaintTextFormat(const char* format = "g");
|
149 |
// tdrStyle->SetPalette(Int_t ncolors = 0, Int_t* colors = 0);
|
150 |
// tdrStyle->SetTimeOffset(Double_t toffset);
|
151 |
// tdrStyle->SetHistMinimumZero(kTRUE);
|
152 |
|
153 |
tdrStyle->cd();
|
154 |
}
|