-
Notifications
You must be signed in to change notification settings - Fork 0
/
sPhenixStyle.C
118 lines (95 loc) · 3.59 KB
/
sPhenixStyle.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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
//
// sPHENIX Style, based on a style file from BaBar, v0.1
//
#include "sPhenixStyle.h"
#include <TROOT.h>
#include <TColor.h>
#include <iostream>
void SetsPhenixStyle ()
{
static TStyle* sphenixStyle = 0;
// std::cout << "sPhenixStyle: Applying nominal settings." << std::endl ;
if ( sphenixStyle==0 ) sphenixStyle = sPhenixStyle();
gROOT->SetStyle("sPHENIX");
gROOT->ForceStyle();
}
TStyle* sPhenixStyle()
{
TStyle *sphenixStyle = new TStyle("sPHENIX","sPHENIX style");
// use plain black on white colors
Int_t icol=0; // WHITE
sphenixStyle->SetFrameBorderMode(icol);
sphenixStyle->SetFrameFillColor(icol);
sphenixStyle->SetCanvasBorderMode(icol);
sphenixStyle->SetCanvasColor(icol);
sphenixStyle->SetPadBorderMode(icol);
sphenixStyle->SetPadColor(icol);
sphenixStyle->SetStatColor(icol);
//sphenixStyle->SetFillColor(icol); // don't use: white fill color for *all* objects
// set the paper & margin sizes
sphenixStyle->SetPaperSize(20,26);
// set margin sizes
sphenixStyle->SetPadTopMargin(0.05);
sphenixStyle->SetPadRightMargin(0.16);
sphenixStyle->SetPadBottomMargin(0.16);
sphenixStyle->SetPadLeftMargin(0.16);
// set title offsets (for axis label)
sphenixStyle->SetTitleXOffset(1.4);
sphenixStyle->SetTitleYOffset(1.4);
// use large fonts
//Int_t font=72; // Helvetica italics
Int_t font=42; // Helvetica
Double_t tsize=0.05;
sphenixStyle->SetTextFont(font);
sphenixStyle->SetTextSize(tsize);
sphenixStyle->SetLabelFont(font,"x");
sphenixStyle->SetTitleFont(font,"x");
sphenixStyle->SetLabelFont(font,"y");
sphenixStyle->SetTitleFont(font,"y");
sphenixStyle->SetLabelFont(font,"z");
sphenixStyle->SetTitleFont(font,"z");
sphenixStyle->SetLabelSize(tsize,"x");
sphenixStyle->SetTitleSize(tsize,"x");
sphenixStyle->SetLabelSize(tsize,"y");
sphenixStyle->SetTitleSize(tsize,"y");
sphenixStyle->SetLabelSize(tsize,"z");
sphenixStyle->SetTitleSize(tsize,"z");
// use bold lines and markers
sphenixStyle->SetMarkerStyle(20);
sphenixStyle->SetMarkerSize(1.2);
sphenixStyle->SetHistLineWidth(2.);
sphenixStyle->SetLineStyleString(2,"[12 12]"); // postscript dashes
// get rid of X error bars
//sphenixStyle->SetErrorX(0.001);
// get rid of error bar caps
sphenixStyle->SetEndErrorSize(0.);
// do not display any of the standard histogram decorations
sphenixStyle->SetOptTitle(0);
//sphenixStyle->SetOptStat(1111);
sphenixStyle->SetOptStat(0);
//sphenixStyle->SetOptFit(1111);
sphenixStyle->SetOptFit(0);
// put tick marks on top and RHS of plots
sphenixStyle->SetPadTickX(1);
sphenixStyle->SetPadTickY(1);
// legend modificatin
sphenixStyle->SetLegendBorderSize(0);
sphenixStyle->SetLegendFillColor(0);
sphenixStyle->SetLegendFont(font);
#if ROOT_VERSION_CODE >= ROOT_VERSION(6,00,0)
// std::cout << "sPhenixStyle: ROOT6 mode" << std::endl;
sphenixStyle->SetLegendTextSize(tsize);
sphenixStyle->SetPalette(kBird);
#else
// std::cout << "sPhenixStyle: ROOT5 mode" << std::endl;
// color palette - manually define 'kBird' palette only available in ROOT 6
Int_t alpha = 0;
Double_t stops[9] = { 0.0000, 0.1250, 0.2500, 0.3750, 0.5000, 0.6250, 0.7500, 0.8750, 1.0000};
Double_t red[9] = { 0.2082, 0.0592, 0.0780, 0.0232, 0.1802, 0.5301, 0.8186, 0.9956, 0.9764};
Double_t green[9] = { 0.1664, 0.3599, 0.5041, 0.6419, 0.7178, 0.7492, 0.7328, 0.7862, 0.9832};
Double_t blue[9] = { 0.5293, 0.8684, 0.8385, 0.7914, 0.6425, 0.4662, 0.3499, 0.1968, 0.0539};
TColor::CreateGradientColorTable(9, stops, red, green, blue, 255, alpha);
#endif
sphenixStyle->SetNumberContours(80);
return sphenixStyle;
}