forked from ltikvica/WZanalysis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMSStyle.C
executable file
·85 lines (67 loc) · 2.56 KB
/
CMSStyle.C
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
//##########################################################################
// Initialization code executed at the start of a ROOT session.
//
// File: $Id: CMSStyle.C,v 1.1 2010/06/11 15:42:30 vuko Exp $
//##########################################################################
//#include <iostream>
//using namespace std;
void CMSstyle(){
// use the 'plain' style for plots (white backgrounds, etc)
// cout << "...using style 'Plain'" << endl;
gROOT->SetStyle("Plain");
// Create the 'CMS' style for approved plots. Note that this style may need
// some fine tuning in your macro depending on what you are plotting, e.g.
//
// gStyle->SetMarkerSize(0.75); // use smaller markers in a histogram with many bins
// gStyle->SetTitleOffset(0.65,"y"); // bring y axis label closer to narrow values
TStyle *cmsStyle= new TStyle("CMS","CMS approved plots style");
// use plain black on white colors
cmsStyle->SetFrameBorderMode(0);
cmsStyle->SetCanvasBorderMode(0);
cmsStyle->SetPadBorderMode(0);
cmsStyle->SetPadColor(0);
cmsStyle->SetCanvasColor(0);
cmsStyle->SetTitleColor(1);
cmsStyle->SetStatColor(0);
// cmsStyle->SetFillColor(0);
// set the paper & margin sizes
cmsStyle->SetPaperSize(20,26);
cmsStyle->SetPadTopMargin(0.05);
cmsStyle->SetPadRightMargin(0.05);
cmsStyle->SetPadBottomMargin(0.16);
cmsStyle->SetPadLeftMargin(0.12);
// use large Times-Roman fonts
cmsStyle->SetTextFont(132);
cmsStyle->SetTextSize(0.08);
cmsStyle->SetLabelFont(132,"x");
cmsStyle->SetLabelFont(132,"y");
cmsStyle->SetLabelFont(132,"z");
// NEW: Vuko : axis title font
cmsStyle->SetTitleFont(132, "XYZ");
cmsStyle->SetLabelSize(0.05,"x");
cmsStyle->SetTitleSize(0.06,"x");
cmsStyle->SetLabelSize(0.05,"y");
cmsStyle->SetTitleSize(0.06,"y");
cmsStyle->SetLabelSize(0.05,"z");
cmsStyle->SetTitleSize(0.06,"z");
// use bold lines and markers
cmsStyle->SetMarkerStyle(8);
cmsStyle->SetHistLineWidth(1.85);
cmsStyle->SetLineStyleString(2,"[12 12]"); // postscript dashes
// do not display any of the standard histogram decorations
cmsStyle->SetOptTitle(0);
cmsStyle->SetOptStat(0);
cmsStyle->SetOptFit(0);
// cmsStyle->SetOptStat(1);
// cmsStyle->SetOptFit(1);
// put tick marks on top and RHS of plots
cmsStyle->SetPadTickX(1);
cmsStyle->SetPadTickY(1);
// cout << endl << " For approved plots use: gROOT->SetStyle(\"CMS\");"
// << endl << " To add a CMS label use: CMSLabel();"
// << endl << endl;
// restore the plain style
gROOT->SetStyle("Plain");
gROOT->SetStyle("CMS");
return ;
}