ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/FGolf/Tools/tdrStyle.C
Revision: 1.2
Committed: Fri Sep 3 23:26:20 2010 UTC (14 years, 8 months ago) by fgolf
Content type: text/plain
Branch: MAIN
CVS Tags: ss2010_10_06, fkwsynch3pbv2, fkw_3pb_samesign_synch
Changes since 1.1: +3 -2 lines
Log Message:
changes from Puneeth

File Contents

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