6 str =
"Status not set yet!";
10 str =
"simulation (internal)";
16 str =
"simulation (public)";
20 str =
"custom title set";
28 str =
"0T cosmic ray data 2015";
30 str =
"3.8T cosmic ray data 2015";
32 str =
"0T collision data 2015";
50 std::for_each(
status.begin(),
status.end(), [](
char&
c) {
c = ::toupper(
c); });
53 else if (
status ==
"INTERNAL")
55 else if (
status ==
"SIMULATION (INTERNAL)")
57 else if (
status ==
"PRELIMINARY")
59 else if (
status ==
"PUBLIC")
61 else if (
status ==
"SIMULATION")
63 else if (
status ==
"UNPUBLISHED")
73 x0 = gStyle->GetPadLeftMargin() +
margin_;
74 x1 = x0 + relWidth * (1. - gStyle->GetPadLeftMargin() - gStyle->GetPadRightMargin() - 2. *
margin_);
79 x0 = 1. - gStyle->GetPadRightMargin() -
margin_ -
80 relWidth * (1. - gStyle->GetPadLeftMargin() - gStyle->GetPadRightMargin() - 2. *
margin_);
81 x1 = 1. - gStyle->GetPadRightMargin() -
margin_;
86 y1 = 1. - gStyle->GetPadTopMargin() -
margin_;
92 y1 = gStyle->GetPadBottomMargin() +
margin_;
97 TLegend*
TkAlStyle::legend(
const int nEntries,
const double relWidth,
const bool left,
const bool top) {
112 TLegend* leg =
new TLegend(x0, y0,
x1,
y1);
113 leg->SetBorderSize(0);
114 leg->SetFillColor(0);
115 leg->SetFillStyle(0);
116 leg->SetTextFont(42);
125 TPaveText*
TkAlStyle::label(
const int nEntries,
const double relWidth,
const bool left,
const bool top) {
139 TPaveText*
label =
new TPaveText(x0, y0,
x1,
y1,
"NDC");
140 label->SetBorderSize(0);
141 label->SetFillColor(0);
142 label->SetFillStyle(0);
143 label->SetTextFont(42);
144 label->SetTextAlign(12);
146 label->SetMargin(0.);
157 TString newtxt = txt;
158 newtxt.ReplaceAll(
"#CMS{",
"#scale[1.4]{#font[61]{CMS}} #font[52]{");
159 newtxt.ReplaceAll(
"#noCMS{",
"#font[52]{");
160 newtxt.ReplaceAll(
"#CMS",
"#scale[1.4]{#font[61]{CMS}}");
166 double x0 = gStyle->GetPadLeftMargin();
167 double x1 = 1. - gStyle->GetPadRightMargin();
168 double y0 = 1. - gStyle->GetPadTopMargin();
170 if (txt.Contains(
"#CMS"))
172 TPaveText* theTitle =
new TPaveText(x0, y0,
x1,
y1,
"NDC");
173 theTitle->SetBorderSize(0);
174 theTitle->SetFillColor(10);
175 theTitle->SetFillStyle(0);
176 theTitle->SetTextFont(42);
177 theTitle->SetTextAlign(13);
178 theTitle->SetTextSize(0.038);
179 theTitle->SetMargin(0.);
188 double x0 = gStyle->GetPadLeftMargin();
189 double x1 = 1. - gStyle->GetPadRightMargin();
190 double y0 = 1. - gStyle->GetPadTopMargin();
192 TPaveText* theTitle =
new TPaveText(x0, y0,
x1,
y1,
"NDC");
193 theTitle->SetBorderSize(0);
194 theTitle->SetFillColor(10);
195 theTitle->SetFillStyle(0);
196 theTitle->SetTextFont(42);
197 theTitle->SetTextAlign(33);
198 theTitle->SetTextSize(0.038);
199 theTitle->SetMargin(0.);
200 theTitle->AddText(newtxt);
209 std::cout <<
"Status not set yet! Can't draw the title!" << std::endl;
211 txt =
"#noCMS{Simulation}";
213 txt =
"#CMS{Internal}";
215 txt =
"#CMS{Preliminary}";
219 txt =
"#CMS{Simulation}";
221 txt =
"#CMS{(unpublished)}";
242 const TString customTitle,
243 const TString customRightTitle) {
250 std::cout <<
"Error: you are trying to use a custom title, but you don't provide it" << std::endl;
253 <<
"Error: you provide a custom title, but you don't indicate CUSTOM status. Your title will not be used." 260 gStyle->SetErrorX(0);
263 gStyle->SetCanvasBorderMode(0);
264 gStyle->SetCanvasColor(kWhite);
265 gStyle->SetCanvasDefH(800);
266 gStyle->SetCanvasDefW(800);
267 gStyle->SetCanvasDefX(0);
268 gStyle->SetCanvasDefY(0);
271 gStyle->SetFrameBorderMode(0);
272 gStyle->SetFrameBorderSize(10);
273 gStyle->SetFrameFillColor(kBlack);
274 gStyle->SetFrameFillStyle(0);
275 gStyle->SetFrameLineColor(kBlack);
276 gStyle->SetFrameLineStyle(0);
277 gStyle->SetFrameLineWidth(2);
278 gStyle->SetLineWidth(3);
281 gStyle->SetPadBorderMode(0);
282 gStyle->SetPadColor(kWhite);
283 gStyle->SetPadGridX(
false);
284 gStyle->SetPadGridY(
false);
285 gStyle->SetGridColor(0);
286 gStyle->SetGridStyle(3);
287 gStyle->SetGridWidth(1);
290 gStyle->SetPadTopMargin(0.08);
291 gStyle->SetPadBottomMargin(0.13);
292 gStyle->SetPadLeftMargin(0.16);
293 gStyle->SetPadRightMargin(0.05);
296 gStyle->SetHistLineColor(kBlack);
297 gStyle->SetHistLineStyle(0);
298 gStyle->SetHistLineWidth(3);
299 gStyle->SetMarkerSize(0.8);
300 gStyle->SetEndErrorSize(4);
301 gStyle->SetHatchesLineWidth(1);
304 gStyle->SetOptStat(0);
307 gStyle->SetAxisColor(1,
"XYZ");
308 gStyle->SetTickLength(0.03,
"XYZ");
309 gStyle->SetNdivisions(510,
"XYZ");
310 gStyle->SetPadTickX(1);
311 gStyle->SetPadTickY(1);
312 gStyle->SetStripDecimals(kFALSE);
315 gStyle->SetTitleColor(1,
"XYZ");
316 gStyle->SetLabelColor(1,
"XYZ");
317 gStyle->SetLabelFont(42,
"XYZ");
318 gStyle->SetLabelOffset(0.007,
"XYZ");
319 gStyle->SetLabelSize(0.04,
"XYZ");
320 gStyle->SetTitleFont(42,
"XYZ");
321 gStyle->SetTitleSize(0.047,
"XYZ");
322 gStyle->SetTitleXOffset(1.2);
323 gStyle->SetTitleYOffset(1.5);
326 gStyle->SetLegendBorderSize(0);
static TString customTitle_
static void setYCoordinatesB(const int nEntries, double &y0, double &y1)
static TString applyCMS(const TString &txt)
static TPaveText * customTitle(const TString &txt)
static PublicationStatus status()
static TString customRightTitle_
static double lineHeight_
static void set(const PublicationStatus status, const Era era=NONE, const TString customTitle="", const TString customRightTitle="")
static TPaveText * title(const TString &txt)
static void setYCoordinatesT(const int nEntries, double &y0, double &y1)
static PublicationStatus publicationStatus_
TString toTString(const PublicationStatus status)
static TString legendheader
static TPaveText * customRightTitle(const TString &txt)
static void setXCoordinatesL(const double relWidth, double &x0, double &x1)
static TPaveText * righttitle(const TString &txt)
static TString legendoptions
static TString rightheader(const Era era)
static TPaveText * label(const int nEntries, const double relWidth=0.5)
static void setXCoordinatesR(const double relWidth, double &x0, double &x1)
static PublicationStatus toStatus(std::string _status)
static TLegend * legend(const int nEntries, const double relWidth=0.5)
static TString header(const PublicationStatus status)