ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/FGolf/Tools/tdrStyle.C
Revision: 1.5
Committed: Sat Mar 17 19:38:24 2012 UTC (13 years, 1 month ago) by fgolf
Content type: text/plain
Branch: MAIN
CVS Tags: HEAD
Changes since 1.4: +0 -0 lines
State: FILE REMOVED
Error occurred while calculating annotation data.
Log Message:
replace C with cc

File Contents

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