11 const Style_t font = 63;
13 const double LEGEND_SIZE = 25;
15 const Int_t COLOR_NA61 = kAzure;
16 const Int_t COLOR_NA61_SYSTEMATIC = 10006;
17 const Int_t MARKER_NA61 = kFullCircle;
18 const Int_t COLOR_NA49 = kRed;
19 const Int_t COLOR_NA49_SYSTEMATIC = 10007;
20 const Int_t MARKER_NA49 = kFullSquare;
22 const Int_t COLOR_AU = kRed-7;
24 const double MARKER_SIZE = 0.8;
25 const double MARKER_BIGGER = 1.5*MARKER_SIZE;
28 const Int_t REACTION_MARKER[5] = {kFullTriangleDown, 34, kFullCircle, kFullTriangleUp, kFullSquare};
29 const Int_t REACTION_MARKER_OPEN[5] = {kOpenTriangleDown, 28, kOpenCircle, kOpenTriangleUp, kOpenSquare};
30 const Int_t REACTION_COLOR[7] = {kAzure-2, kCyan+2, kSpring-6, kOrange+7, kRed+2, COLOR_NA61, COLOR_NA49};
31 const Int_t REACTION_SYSTEMATIC_COLOR[5] = {10001, 10002, 10003, 10004, 10005};
34 const Double_t MINIMUM_ACCEPTANCE = 0.9;
36 void set_style(
int iPalette = 1) {
39 gStyle->SetCanvasDefH(550);
40 gStyle->SetCanvasDefW(650);
42 gStyle->SetTitleFont(font,
"xyz");
43 gStyle->SetTitleSize(LEGEND_SIZE,
"xyz");
44 gStyle->SetTitleOffset(0.7,
"z");
45 gStyle->SetLabelFont(font,
"xyz");
46 gStyle->SetLabelSize(LEGEND_SIZE,
"xyz");
50 gStyle->SetTextSize(LEGEND_SIZE);
51 gStyle->SetLegendFont(font);
55 gStyle->SetPadTopMargin(0.1);
56 gStyle->SetPadBottomMargin(0.15);
57 gStyle->SetPadLeftMargin(0.2);
58 gStyle->SetPadRightMargin(0.2);
61 gStyle->SetFrameBorderMode(0);
62 gStyle->SetFrameFillColor(0);
63 gStyle->SetFrameFillStyle(0);
64 gStyle->SetPadColor(0);
65 gStyle->SetCanvasColor(0);
66 gStyle->SetStatColor(0);
67 gStyle->SetTitleFillColor(0);
70 gStyle->SetOptStat(0);
72 gStyle->SetStatX(0.90);
73 gStyle->SetStatY(0.90);
74 gStyle->SetStatW(0.12);
75 gStyle->SetStatH(0.12);
78 gStyle->SetPaintTextFormat(
".2f");
81 gStyle->SetTitleBorderSize(0);
82 gStyle->SetTitleX(0.2);
83 gStyle->SetTitleY(0.975f);
84 gStyle->SetTitleH(0.05f);
87 gStyle->SetLegendBorderSize(1);
88 gStyle->SetLegendFillColor(0);
89 gStyle->SetFillStyle(0);
91 gStyle->SetNdivisions(505);
117 static const Int_t nPalettes = 3;
118 if(iPalette >= nPalettes) {
119 cerr<<
"Invalid palette number "<<iPalette<<endl;
122 static Int_t NCont[nPalettes];
123 static Int_t NRGBs[nPalettes];
124 static Int_t pal[nPalettes][1000];
127 static Bool_t ArePalettesDefined =
false;
129 if(!ArePalettesDefined) {
153 Double_t stops0[] = { 0.00, 0.20, 0.40, 0.50, 0.60, 0.80, 1.00 };
154 Double_t red0[] = { 0.80, 0.15, 0.70, 0.95, 0.80, 0.35, 0.10 };
155 Double_t green0[] = { 0.20, 0.60, 0.70, 0.95, 0.90, 0.85, 0.20 };
156 Double_t blue0[] = { 0.80, 1.00, 0.90, 0.95, 0.80, 0.45, 0.00 };
165 ind = TColor::CreateGradientColorTable(NRGBs[0], stops0, red0, green0, blue0, NCont[0]);
166 for (
int i = 0; i < NCont[0]; i++)
173 Double_t stops1[] = { 0.00, 0.02, 0.15, 0.30, 0.44, 0.58, 0.72, 0.86, 0.98, 1.00 };
174 Double_t red1[] = { 0.90, 0.80, 0.40, 0.00, 0.25, 0.87, 0.90, 1.00, 0.60, 0.31 };
175 Double_t green1[] = { 0.90, 0.80, 0.50, 0.85, 1.00, 1.00, 0.50, 0.20, 0.00, 0.00 };
176 Double_t blue1[] = { 1.00, 1.00, 1.00, 0.85, 0.25, 0.12, 0.05, 0.00, 0.00, 0.00 };
178 ind = TColor::CreateGradientColorTable(NRGBs[1], stops1, red1, green1, blue1, NCont[1]);
179 for (
int i = 0; i < NCont[1]; i++)
185 Double_t stops2[] = { 0.00, 0.02, 0.20, 0.40, 0.60, 0.80, 0.99999*MINIMUM_ACCEPTANCE, MINIMUM_ACCEPTANCE, 0.98, 1.00 };
186 Double_t red2[] = { 0.90, 0.80, 0.40, 0.00, 0.25, 0.85, 0.95, 1.00, 0.60, 0.31 };
187 Double_t green2[] = { 0.90, 0.80, 0.50, 0.85, 1.00, 0.95, 0.95, 0.20, 0.00, 0.00 };
188 Double_t blue2[] = { 1.00, 1.00, 1.00, 0.85, 0.25, 0.12, 0.05, 0.00, 0.00, 0.00 };
190 ind = TColor::CreateGradientColorTable(NRGBs[2], stops2, red2, green2, blue2, NCont[2]);
191 for (
int i = 0; i < NCont[2]; i++)
194 ArePalettesDefined =
true;
198 for(Int_t i = 0; i < 7; i++) {
199 TColor * ctmp = gROOT->GetColor(REACTION_COLOR[i]);
201 ctmp->GetRGB(r, g, b);
203 const Double_t intensity = 0.8;
204 const Double_t brightness = 0.9;
205 const Double_t mean = (r + g + b)/3;
209 r = ((1-intensity) * mean + intensity * r) * (1-brightness) + brightness;
210 g = ((1-intensity) * mean + intensity * g) * (1-brightness) + brightness;
211 b = ((1-intensity) * mean + intensity * b) * (1-brightness) + brightness;
214 new TColor(10001+i, r, g, b, TString::Format(
"my_color_%d", i));
220 gStyle->SetNumberContours(NCont[iPalette]);
221 gStyle->SetPalette(NCont[iPalette], pal[iPalette]);
225 gStyle->SetTitleOffset(1.1,
"xz");
226 gStyle->SetTitleOffset(1.8,
"y");
229 gStyle->SetPadTopMargin(0.05);
230 gStyle->SetPadBottomMargin(0.1);
231 gStyle->SetPadRightMargin(0.05);
235 gStyle->SetTitleOffset(1.1,
"x");
236 gStyle->SetTitleOffset(1.4,
"y");
237 gStyle->SetTitleOffset(1.2,
"z");
240 gStyle->SetPadTopMargin(0.05);
241 gStyle->SetPadBottomMargin(0.15);
242 gStyle->SetPadLeftMargin(0.14);
243 gStyle->SetPadRightMargin(0.2);
246 void LocaldrawTH2Hacked(TH2 * h1, Double_t min = -0.10, Double_t max = 0.10,
float text =
false, Bool_t draw_palette =
true) {
259 gStyle->SetPaintTextFormat(TString::Format(
".%df", (
int)(text)));
263 TH2D * h = (TH2D*)(h1->Clone(
"drawTH2HackedTempH"));
264 TH2D * h2 = (TH2D*)(h1->Clone(
"drawTH2HackedTempH2"));
267 const Int_t nLevels = 999;
268 Double_t levels[nLevels];
269 for(
int i = 1; i < nLevels; i++) {
270 levels[i] = min + (max - min) / (nLevels - 1) * (i);
274 for(
int i = 1; i <= h->GetNbinsX(); ++i) {
275 for(
int j = 1; j <= h->GetNbinsY(); ++j) {
276 if(h->GetBinContent(i, j) == 0
277 && h->GetBinError(i, j) == 0
279 h->SetBinContent(i, j, levels[0]-1);
281 h2->SetBinContent(i, j, levels[0]-1);
285 h->SetContour((
sizeof(levels)/
sizeof(Double_t)), levels);
291 h2->SetContour((
sizeof(levels)/
sizeof(Double_t)), levels);
292 h2->GetZaxis()->SetRangeUser(min, max);
295 h->SetMarkerColor(kWhite);
296 h->GetZaxis()->SetRangeUser(levels[0]+1, -levels[0]-1);
298 h->DrawClone(
"col same");
301 h->SetMarkerSize(LEGEND_SIZE*15);
302 h->DrawCopy(
"text same");
void set_style1D()
Definition: style.h:474
void set_style2D()
Definition: style.h:461