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";
40 str =
"MC (no mis-alignment)";
42 str =
"No Run-2 alignment (Run-1 geometry)";
44 str =
"Aligned (0T cosmic rays)";
46 str =
"Aligned (cosmic rays)";
48 str =
"Aligned (0T collisions + cosmic rays)";
85 std::for_each(
status.begin(),
status.end(), [](
char&
c) {
c = ::toupper(
c); });
88 else if (
status ==
"INTERNAL")
90 else if (
status ==
"SIMULATION (INTERNAL)")
92 else if (
status ==
"PRELIMINARY")
94 else if (
status ==
"PUBLIC")
96 else if (
status ==
"SIMULATION")
98 else if (
status ==
"UNPUBLISHED")
108 x0 = gStyle->GetPadLeftMargin() +
margin_;
109 x1 = x0 + relWidth * (1. - gStyle->GetPadLeftMargin() - gStyle->GetPadRightMargin() - 2. *
margin_);
114 x0 = 1. - gStyle->GetPadRightMargin() -
margin_ -
115 relWidth * (1. - gStyle->GetPadLeftMargin() - gStyle->GetPadRightMargin() - 2. *
margin_);
116 x1 = 1. - gStyle->GetPadRightMargin() -
margin_;
121 y1 = 1. - gStyle->GetPadTopMargin() -
margin_;
127 y1 = gStyle->GetPadBottomMargin() +
margin_;
132 TLegend*
TkAlStyle::legend(
const int nEntries,
const double relWidth,
const bool left,
const bool top) {
147 TLegend* leg =
new TLegend(x0, y0,
x1,
y1);
148 leg->SetBorderSize(0);
149 leg->SetFillColor(0);
150 leg->SetFillStyle(0);
151 leg->SetTextFont(42);
160 TPaveText*
TkAlStyle::label(
const int nEntries,
const double relWidth,
const bool left,
const bool top) {
174 TPaveText*
label =
new TPaveText(x0, y0,
x1,
y1,
"NDC");
175 label->SetBorderSize(0);
176 label->SetFillColor(0);
177 label->SetFillStyle(0);
178 label->SetTextFont(42);
179 label->SetTextAlign(12);
181 label->SetMargin(0.);
192 TString newtxt = txt;
193 newtxt.ReplaceAll(
"#CMS{",
"#scale[1.4]{#font[61]{CMS}} #font[52]{");
194 newtxt.ReplaceAll(
"#noCMS{",
"#font[52]{");
195 newtxt.ReplaceAll(
"#CMS",
"#scale[1.4]{#font[61]{CMS}}");
201 double x0 = gStyle->GetPadLeftMargin();
202 double x1 = 1. - gStyle->GetPadRightMargin();
203 double y0 = 1. - gStyle->GetPadTopMargin();
205 if (txt.Contains(
"#CMS"))
207 TPaveText* theTitle =
new TPaveText(x0, y0,
x1,
y1,
"NDC");
208 theTitle->SetBorderSize(0);
209 theTitle->SetFillColor(10);
210 theTitle->SetFillStyle(0);
211 theTitle->SetTextFont(42);
212 theTitle->SetTextAlign(13);
213 theTitle->SetTextSize(0.038);
214 theTitle->SetMargin(0.);
223 double x0 = gStyle->GetPadLeftMargin();
224 double x1 = 1. - gStyle->GetPadRightMargin();
225 double y0 = 1. - gStyle->GetPadTopMargin();
227 TPaveText* theTitle =
new TPaveText(x0, y0,
x1,
y1,
"NDC");
228 theTitle->SetBorderSize(0);
229 theTitle->SetFillColor(10);
230 theTitle->SetFillStyle(0);
231 theTitle->SetTextFont(42);
232 theTitle->SetTextAlign(33);
233 theTitle->SetTextSize(0.038);
234 theTitle->SetMargin(0.);
235 theTitle->AddText(newtxt);
244 std::cout <<
"Status not set yet! Can't draw the title!" << std::endl;
246 txt =
"#noCMS{Simulation}";
248 txt =
"#CMS{Internal}";
250 txt =
"#CMS{Preliminary}";
254 txt =
"#CMS{Simulation}";
256 txt =
"#CMS{(unpublished)}";
277 const TString customTitle,
278 const TString customRightTitle) {
285 std::cout <<
"Error: you are trying to use a custom title, but you don't provide it" << std::endl;
288 <<
"Error: you provide a custom title, but you don't indicate CUSTOM status. Your title will not be used." 295 gStyle->SetErrorX(0);
298 gStyle->SetCanvasBorderMode(0);
299 gStyle->SetCanvasColor(kWhite);
300 gStyle->SetCanvasDefH(800);
301 gStyle->SetCanvasDefW(800);
302 gStyle->SetCanvasDefX(0);
303 gStyle->SetCanvasDefY(0);
306 gStyle->SetFrameBorderMode(0);
307 gStyle->SetFrameBorderSize(10);
308 gStyle->SetFrameFillColor(kBlack);
309 gStyle->SetFrameFillStyle(0);
310 gStyle->SetFrameLineColor(kBlack);
311 gStyle->SetFrameLineStyle(0);
312 gStyle->SetFrameLineWidth(2);
313 gStyle->SetLineWidth(3);
316 gStyle->SetPadBorderMode(0);
317 gStyle->SetPadColor(kWhite);
318 gStyle->SetPadGridX(
false);
319 gStyle->SetPadGridY(
false);
320 gStyle->SetGridColor(0);
321 gStyle->SetGridStyle(3);
322 gStyle->SetGridWidth(1);
325 gStyle->SetPadTopMargin(0.08);
326 gStyle->SetPadBottomMargin(0.13);
327 gStyle->SetPadLeftMargin(0.16);
328 gStyle->SetPadRightMargin(0.05);
331 gStyle->SetHistLineColor(kBlack);
332 gStyle->SetHistLineStyle(0);
333 gStyle->SetHistLineWidth(3);
334 gStyle->SetMarkerSize(0.8);
335 gStyle->SetEndErrorSize(4);
336 gStyle->SetHatchesLineWidth(1);
339 gStyle->SetOptStat(0);
342 gStyle->SetAxisColor(1,
"XYZ");
343 gStyle->SetTickLength(0.03,
"XYZ");
344 gStyle->SetNdivisions(510,
"XYZ");
345 gStyle->SetPadTickX(1);
346 gStyle->SetPadTickY(1);
347 gStyle->SetStripDecimals(kFALSE);
350 gStyle->SetTitleColor(1,
"XYZ");
351 gStyle->SetLabelColor(1,
"XYZ");
352 gStyle->SetLabelFont(42,
"XYZ");
353 gStyle->SetLabelOffset(0.007,
"XYZ");
354 gStyle->SetLabelSize(0.04,
"XYZ");
355 gStyle->SetTitleFont(42,
"XYZ");
356 gStyle->SetTitleSize(0.047,
"XYZ");
357 gStyle->SetTitleXOffset(1.2);
358 gStyle->SetTitleYOffset(1.5);
361 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_
static int style(const AlignObj obj)
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 TString toTString(const PublicationStatus status)
static TPaveText * label(const int nEntries, const double relWidth=0.5)
static int color(const AlignObj obj)
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)