1 #ifndef Analysis_Tools_HttStylesNew_h 2 #define Analysis_Tools_HttStylesNew_h 1 16 TCanvas*
MakeCanvas(
const char*
name,
const char* title,
int dX=600,
int dY=600);
20 void InitHist(TH1* hist,
const char* xtit,
const char* ytit=
"Number of Entries",
int color=kBlack,
int style=0);
40 TStyle *HttStyle =
new TStyle(
"Htt-Style",
"The Perfect Style for Plots ;-)");
44 HttStyle->SetCanvasColor (0);
45 HttStyle->SetCanvasBorderSize(10);
46 HttStyle->SetCanvasBorderMode(0);
47 HttStyle->SetCanvasDefH (700);
48 HttStyle->SetCanvasDefW (700);
49 HttStyle->SetCanvasDefX (100);
50 HttStyle->SetCanvasDefY (100);
53 HttStyle->SetPalette(1,0);
56 HttStyle->SetPadColor (0);
57 HttStyle->SetPadBorderSize (10);
58 HttStyle->SetPadBorderMode (0);
59 HttStyle->SetPadBottomMargin(0.13);
60 HttStyle->SetPadTopMargin (0.08);
61 HttStyle->SetPadLeftMargin (0.15);
62 HttStyle->SetPadRightMargin (0.05);
63 HttStyle->SetPadGridX (0);
64 HttStyle->SetPadGridY (0);
65 HttStyle->SetPadTickX (1);
66 HttStyle->SetPadTickY (1);
69 HttStyle->SetLineWidth(3);
70 HttStyle->SetFrameFillStyle ( 0);
71 HttStyle->SetFrameFillColor ( 0);
72 HttStyle->SetFrameLineColor ( 1);
73 HttStyle->SetFrameLineStyle ( 0);
74 HttStyle->SetFrameLineWidth ( 2);
75 HttStyle->SetFrameBorderSize(10);
76 HttStyle->SetFrameBorderMode( 0);
79 HttStyle->SetHistFillColor(2);
80 HttStyle->SetHistFillStyle(0);
81 HttStyle->SetHistLineColor(1);
82 HttStyle->SetHistLineStyle(0);
83 HttStyle->SetHistLineWidth(3);
84 HttStyle->SetNdivisions(505);
87 HttStyle->SetFuncColor(1);
88 HttStyle->SetFuncStyle(0);
89 HttStyle->SetFuncWidth(2);
92 HttStyle->SetMarkerStyle(20);
93 HttStyle->SetMarkerColor(kBlack);
94 HttStyle->SetMarkerSize (1.4);
96 HttStyle->SetTitleBorderSize(0);
97 HttStyle->SetTitleFillColor (0);
98 HttStyle->SetTitleX (0.2);
100 HttStyle->SetTitleSize (0.055,
"X");
101 HttStyle->SetTitleOffset(1.200,
"X");
102 HttStyle->SetLabelOffset(0.005,
"X");
103 HttStyle->SetLabelSize (0.050,
"X");
104 HttStyle->SetLabelFont (42 ,
"X");
106 HttStyle->SetStripDecimals(kFALSE);
107 HttStyle->SetLineStyleString(11,
"20 10");
109 HttStyle->SetTitleSize (0.055,
"Y");
110 HttStyle->SetTitleOffset(1.600,
"Y");
111 HttStyle->SetLabelOffset(0.010,
"Y");
112 HttStyle->SetLabelSize (0.050,
"Y");
113 HttStyle->SetLabelFont (42 ,
"Y");
115 HttStyle->SetTextSize (0.055);
116 HttStyle->SetTextFont (42);
118 HttStyle->SetStatFont (42);
119 HttStyle->SetTitleFont (42);
120 HttStyle->SetTitleFont (42,
"X");
121 HttStyle->SetTitleFont (42,
"Y");
123 HttStyle->SetOptStat (0);
130 TCanvas *canvas =
new TCanvas(name,title,0,0,dX,dY);
132 canvas->SetFillColor (0);
133 canvas->SetBorderMode (0);
134 canvas->SetBorderSize (10);
136 canvas->SetLeftMargin (0.18);
137 canvas->SetRightMargin (0.05);
138 canvas->SetTopMargin (0.08);
139 canvas->SetBottomMargin (0.15);
141 canvas->SetFrameFillStyle (0);
142 canvas->SetFrameLineStyle (0);
143 canvas->SetFrameBorderMode(0);
144 canvas->SetFrameBorderSize(10);
145 canvas->SetFrameFillStyle (0);
146 canvas->SetFrameLineStyle (0);
147 canvas->SetFrameBorderMode(0);
148 canvas->SetFrameBorderSize(10);
156 TPad *tmpPad = (TPad*) pad->GetPad(i);
157 tmpPad->SetLeftMargin (0.18);
158 tmpPad->SetTopMargin (0.05);
159 tmpPad->SetRightMargin (0.07);
160 tmpPad->SetBottomMargin(0.15);
166 hist->SetFillStyle(0.);
167 hist->SetLineStyle(11);
168 hist->SetLineWidth(2.);
169 hist->SetLineColor(kBlue+3);
172 void InitHist(TH1 *hist,
const char *xtit,
const char *ytit,
int color,
int style)
174 hist->SetXTitle(xtit);
175 hist->SetYTitle(ytit);
176 hist->SetLineColor(kBlack);
177 hist->SetLineWidth( 2.);
178 hist->SetFillColor(color );
179 hist->SetFillStyle(style );
180 hist->SetTitleSize (0.055,
"Y");
181 hist->SetTitleOffset(1.600,
"Y");
182 hist->SetLabelOffset(0.014,
"Y");
183 hist->SetLabelSize (0.040,
"Y");
184 hist->SetLabelFont (42 ,
"Y");
185 hist->SetTitleSize (0.055,
"X");
186 hist->SetTitleOffset(1.300,
"X");
187 hist->SetLabelOffset(0.014,
"X");
188 hist->SetLabelSize (0.050,
"X");
189 hist->SetLabelFont (42 ,
"X");
190 hist->SetMarkerStyle(20);
191 hist->SetMarkerColor(color);
192 hist->SetMarkerSize (0.6);
193 hist->GetYaxis()->SetTitleFont(42);
194 hist->GetXaxis()->SetTitleFont(42);
201 hist->SetMarkerStyle(20.);
202 hist->SetMarkerSize (1.3);
203 hist->SetLineWidth ( 2.);
208 leg->SetFillStyle (0);
209 leg->SetFillColor (0);
210 leg->SetBorderSize(0);
215 TPaveText* cmsprel =
new TPaveText(lowX, lowY+0.06, lowX+0.30, lowY+0.16,
"NDC");
216 cmsprel->SetBorderSize( 0 );
217 cmsprel->SetFillStyle( 0 );
218 cmsprel->SetTextAlign( 12 );
219 cmsprel->SetTextSize ( 0.05 );
220 cmsprel->SetTextColor( 1 );
221 cmsprel->SetTextFont ( 62 );
222 cmsprel->AddText(
"CMS");
225 TPaveText* lumi =
new TPaveText(lowX+0.08, lowY+0.061, lowX+0.45, lowY+0.161,
"NDC");
226 lumi->SetBorderSize( 0 );
227 lumi->SetFillStyle( 0 );
228 lumi->SetTextAlign( 12 );
229 lumi->SetTextSize ( 0.05 );
230 lumi->SetTextColor( 1 );
231 lumi->SetTextFont ( 62 );
232 lumi->AddText(dataset);
238 TLatex * tex =
new TLatex(0.2,0.94,channel);
240 tex->SetTextSize(0.06);
241 tex->SetLineWidth(2);
void plotchannel(TString channel)
void SetLegendStyle(TLegend *leg)
define common legend style
void InitSignal(TH1 *hist)
define line style, width and color for signal sample
void InitData(TH1 *hist)
define poly markers and line width for data
void InitSubPad(TPad *pad, int i)
define common style of pads
TCanvas * MakeCanvas(const char *name, const char *title, int dX=600, int dY=600)
create a canveas in common style (default is square)
void InitHist(TH1 *hist, const char *xtit, const char *ytit="Number of Entries", int color=kBlack, int style=0)
define a histogram file (not yet including poly markers, which are used fro data) ...
void SetStyle()
define common styles
void CMSPrelim(const char *dataset, double lowX=0.4, double lowY=0.74)
add CMSPreliminary logo, lumi and channel