ATLAS Offline Software
Loading...
Searching...
No Matches
AtlasStyle.cxx
Go to the documentation of this file.
1
9
10//
11// ATLAS Style, based on a style file from BaBar
12//
13
14#include <iostream>
15
16#include "AtlasStyle.h"
17
18#include "TROOT.h"
19#include "TColor.h"
20
21void setpalette(TStyle* style);
22
23
25{
26 static TStyle* atlasStyle = 0;
27 std::cout << "\nApplying ATLAS style settings...\n" << std::endl ;
28 if ( atlasStyle==0 ) atlasStyle = AtlasStyle();
29 // gROOT->SetStyle("ATLAS");
30 gROOT->ForceStyle();
31 atlasStyle->cd();
32}
33
34TStyle* AtlasStyle()
35{
36 // TStyle *atlasStyle = new TStyle("ATLAS","Atlas style");
37 TStyle *atlasStyle = gROOT->GetStyle("Plain");
38
39 // use plain black on white colors
40 Int_t icol=0; // WHITE
41 atlasStyle->SetFrameBorderMode(icol);
42 atlasStyle->SetFrameFillColor(icol);
43 atlasStyle->SetCanvasBorderMode(icol);
44 atlasStyle->SetCanvasColor(icol);
45 atlasStyle->SetPadBorderMode(icol);
46 atlasStyle->SetPadColor(icol);
47 atlasStyle->SetStatColor(icol);
48 //atlasStyle->SetFillColor(icol); // don't use: white fill color for *all* objects
49
50 // set the paper & margin sizes
51 atlasStyle->SetPaperSize(20,26);
52
53 // set margin sizes
54 atlasStyle->SetPadTopMargin(0.05);
55 atlasStyle->SetPadRightMargin(0.05);
56 atlasStyle->SetPadBottomMargin(0.16);
57 atlasStyle->SetPadLeftMargin(0.16);
58
59 // set title offsets (for axis label)
60 atlasStyle->SetTitleXOffset(1.4);
61 atlasStyle->SetTitleYOffset(1.4);
62
63 // use large fonts
64 //Int_t font=72; // Helvetica italics
65 Int_t font=42; // Helvetica
66 Double_t tsize=0.05;
67 atlasStyle->SetTextFont(font);
68
69 atlasStyle->SetTextSize(tsize);
70 atlasStyle->SetLabelFont(font,"x");
71 atlasStyle->SetTitleFont(font,"x");
72 atlasStyle->SetLabelFont(font,"y");
73 atlasStyle->SetTitleFont(font,"y");
74 atlasStyle->SetLabelFont(font,"z");
75 atlasStyle->SetTitleFont(font,"z");
76
77 atlasStyle->SetLabelSize(tsize,"x");
78 atlasStyle->SetTitleSize(tsize,"x");
79 atlasStyle->SetLabelSize(tsize,"y");
80 atlasStyle->SetTitleSize(tsize,"y");
81 atlasStyle->SetLabelSize(tsize,"z");
82 atlasStyle->SetTitleSize(tsize,"z");
83
84 // use bold lines and markers
85 atlasStyle->SetMarkerStyle(20);
86 atlasStyle->SetMarkerSize(1.2);
87 atlasStyle->SetHistLineWidth(2.);
88 atlasStyle->SetLineStyleString(2,"[12 12]"); // postscript dashes
89
90 // get rid of X error bars
91 //atlasStyle->SetErrorX(0.001);
92 // get rid of error bar caps
93 atlasStyle->SetEndErrorSize(0.);
94
95 // do not display any of the standard histogram decorations
96 atlasStyle->SetOptTitle(0);
97 //atlasStyle->SetOptStat(1111);
98 atlasStyle->SetOptStat(0);
99 //atlasStyle->SetOptFit(1111);
100 atlasStyle->SetOptFit(0);
101
102 // put tick marks on top and RHS of plots
103 atlasStyle->SetPadTickX(1);
104 atlasStyle->SetPadTickY(1);
105
106 setpalette(atlasStyle);
107
108 return atlasStyle;
109
110}
111
112
113
114void setpalette(TStyle* style)
115{
116 const Int_t NCont = 98;
117
118
119#if 0
120 const Int_t NRGBs = 7;
121
122 Double_t stops[NRGBs] = { 0.00, 0.20, 0.50, 0.60, 0.70, 0.90, 1.00 };
123
124 Double_t red[NRGBs] = { 0.00, 0.00, 0.00, 0.60, 0.90, 1.00, 0.50 };
125 Double_t green[NRGBs] = { 0.00, 0.00, 0.40, 0.95, 1.00, 0.20, 0.00 };
126 Double_t blue[NRGBs] = { 0.00, 1.00, 1.00, 0.10, 0.00, 0.00, 0.00 };
127#endif
128
129
130 const Int_t NRGBs = 7;
131
132 Double_t stops[NRGBs] = { 0.00, 0.20, 0.30, 0.60, 0.70, 0.90, 1.00 };
133
134 Double_t red[NRGBs] = { 0.00, 0.00, 0.00, 0.60, 0.90, 1.00, 0.80 };
135 Double_t green[NRGBs] = { 0.00, 0.00, 0.40, 0.95, 1.00, 0.20, 0.00 };
136 Double_t blue[NRGBs] = { 0.00, 1.00, 1.00, 0.10, 0.00, 0.00, 0.00 };
137
138
139 TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
140 style->SetNumberContours(NCont);
141}
142
143
144
void setpalette(TStyle *style)
TStyle * AtlasStyle()
void SetAtlasStyle()
ATLAS Style, based on a style file from BaBar.