1 #ifndef ALIGNMENT_OFFLINEVALIDATION_JDRAWER_H 2 #define ALIGNMENT_OFFLINEVALIDATION_JDRAWER_H 95 xAxis->CenterTitle(
true);
96 yAxis->CenterTitle(
true);
98 zAxis->CenterTitle(
true);
123 xAxis->SetTitle(xtit);
124 yAxis->SetTitle(ytit);
144 SetAxisStyles(hid->GetXaxis(), hid->GetYaxis(), hid->GetZaxis(), xtit, ytit);
155 SetAxisStyles(hid->GetXaxis(), hid->GetYaxis(), hid->GetZaxis(), xtit, ytit);
166 SetAxisStyles(hid->GetXaxis(), hid->GetYaxis(),
nullptr, xtit, ytit);
198 if (gROOT->GetListOfCanvases()->FindObject(
name) ==
nullptr) {
246 TH1 *
histo,
const char *xTitle,
const char *yTitle,
const char *
title =
"",
const char *
drawOption =
"") {
248 if (strcmp(xTitle,
"") == 0)
249 xTitle =
histo->GetXaxis()
251 if (strcmp(yTitle,
"") == 0)
252 yTitle =
histo->GetYaxis()->GetTitle();
253 if (strcmp(
title,
"") == 0)
272 TH1 *
histo,
const char *xTitle,
const char *yTitle,
const char *
title =
"",
const char *
drawOption =
"") {
274 if (strcmp(xTitle,
"") == 0)
275 xTitle =
histo->GetXaxis()
277 if (strcmp(yTitle,
"") == 0)
278 yTitle =
histo->GetYaxis()->GetTitle();
279 if (strcmp(
title,
"") == 0)
308 const char *xTitle =
"",
309 const char *yTitle =
"",
310 const char *
title =
"",
313 if (strcmp(xTitle,
"") == 0)
314 xTitle =
histo->GetXaxis()
316 if (strcmp(yTitle,
"") == 0)
317 yTitle =
histo->GetYaxis()->GetTitle();
318 if (strcmp(
title,
"") == 0)
326 gStyle->SetOptStat(0);
327 gStyle->SetOptTitle(0);
345 const char *xTitle =
"",
346 const char *yTitle =
"",
347 const char *
title =
"",
368 const char *xTitle =
"",
369 const char *yTitle =
"",
370 const char *
title =
"",
399 const char *xTitle =
"",
400 const char *yTitle =
"",
401 const char *
title =
"",
426 const char *xTitle =
"",
427 const char *yTitle =
"",
428 const char *
title =
"",
431 if (strcmp(xTitle,
"") == 0)
432 xTitle = graph->GetXaxis()
434 if (strcmp(yTitle,
"") == 0)
435 yTitle = graph->GetYaxis()->GetTitle();
436 if (strcmp(
title,
"") == 0)
437 title = graph->GetTitle();
441 graph->SetTitle(
title);
442 graph->GetXaxis()->SetRangeUser(xlow, xhigh);
443 graph->GetYaxis()->SetRangeUser(ylow, yhigh);
458 TF1 *myFun,
const char *xTitle,
const char *yTitle,
const char *
title =
"",
const char *
drawOption =
"") {
460 if (strcmp(xTitle,
"") == 0)
461 xTitle = myFun->GetXaxis()
463 if (strcmp(yTitle,
"") == 0)
464 yTitle = myFun->GetYaxis()->GetTitle();
465 if (strcmp(
title,
"") == 0)
466 title = myFun->GetTitle();
470 myFun->SetTitle(
title);
550 gStyle->SetOptStat(0);
553 fSinglePad =
new TPad(
"pad",
"pad", 0.01, 0.01, 0.99, 0.99, 0, 0, 0);
578 const char *xTitle =
"",
579 const char *yTitle =
"",
580 const char *
title =
"") {
586 TH2F *dummyHisto =
new TH2F(dummyName.Data(),
title, 10, xlow, xhigh, 10, ylow, yhigh);
602 gStyle->SetOptStat(0);
603 gStyle->SetOptTitle(0);
604 fCanvas->SetMargin(0, 0, 0, 0);
640 gStyle->SetOptStat(0);
641 gStyle->SetOptTitle(0);
642 fCanvas->SetMargin(0, 0, 0, 0);
648 double smallMargin = 0.0006;
649 double evenSmallerMargin = 0.0002;
650 double relativePlotSizeLeftPad = 1 - (
fMarginLeft + evenSmallerMargin);
651 double relativePlotSizeMiddlePad = 1 - (2 * smallMargin);
652 double relativePlotSizeRightPad = 1 - (
fMarginRight + smallMargin);
653 double firstSeparator = 1 / (1 + relativePlotSizeLeftPad / relativePlotSizeMiddlePad +
654 relativePlotSizeLeftPad / relativePlotSizeRightPad);
655 double secondSeparator = firstSeparator + (relativePlotSizeLeftPad / relativePlotSizeMiddlePad) * firstSeparator;
659 fLeftRowPad =
new TPad(dummyName.Data(), dummyName.Data(), 0, 0, firstSeparator, 1, 0);
670 fMiddleRowPad =
new TPad(dummyName.Data(), dummyName.Data(), firstSeparator, 0, secondSeparator, 1, 0);
682 fRightRowPad =
new TPad(dummyName.Data(), dummyName.Data(), secondSeparator, 0, 1, 1, 0);
707 const char *xTitle =
"",
708 const char *yTitle =
"",
709 const char *
title =
"") {
716 TH2F *dummyHisto =
new TH2F(dummyName.Data(),
"", 10, xlow, xhigh, 10, ylow, yhigh);
723 dummyHisto =
new TH2F(dummyName.Data(),
title, 10, xlow, xhigh, 10, ylow, yhigh);
730 dummyHisto =
new TH2F(dummyName.Data(),
"", 10, xlow, xhigh, 10, ylow, yhigh);
768 void SetMargins(
double left,
double right,
double top,
double bottom) {
1041 SetHistogramAppearance(2.5, 2.3, 25, 25, 0.01, 0.001, 20, 20, 505, 505, 43);
1052 SetHistogramAppearance(0.9, 1.3, 0.06, 0.05, 0.01, 0.001, 0.05, 0.05, 505, 505, 42);
1062 SetHistogramAppearance(0.9, 1.3, 0.06, 0.05, 0.01, 0.001, 0.05, 0.05, 505, 505, 42);
1071 switch (padNumber) {
1096 switch (padNumber) {
1118 std::cout <<
"Pad " << padNumber <<
" not found" << std::endl;
1159 std::cout <<
"Error: No canvas defined! Cannot return name." << std::endl;
1174 void SetPadRange(
double xLow,
double yLow,
double xHigh,
double yHigh) {
void SetSplitRatio(double split)
void CreateSplitCanvas(int canvasIndex, int canvasesInRow)
void SetGridX(bool grid=true)
void DrawHistogramToLowerPad(TH1 *histo, const char *xTitle="", const char *yTitle="", const char *title="", const char *drawOption="")
void DrawFunction(TF1 *myFun, const char *xTitle, const char *yTitle, const char *title="", const char *drawOption="")
void SetCanvasSize(int width, int height)
void SetRelativeCanvasSize(double relativeSize, double aspectRatio)
void SetLabelOffsetX(double offset)
void DrawHistogramToUpperPad(TH1 *histo, const char *xTitle="", const char *yTitle="", const char *title="", const char *drawOption="")
void SetCanvasDisplacement(int x, int y)
void DrawGraph(TGraph *graph, double xlow, double xhigh, double ylow, double yhigh, const char *xTitle="", const char *yTitle="", const char *title="", const char *drawOption="")
void SetLeftMargin(double margin)
void SetNumberOfCanvasesInOneRow(int canvasesInRow)
int GetCanvasDisplacementX()
void SetCanvasDisplacementSettings(int displacementX, int displacementY, int canvasesInRow)
void SetDefaultAppearanceSplitCanvas()
void SetLabelSizeY(double size)
void SetTick(int tickX, int tickY)
void SelectPad(int padNumber)
void SetGraphStyle(TGraph *hid, TString xtit, TString ytit)
void SetAxisStyles(TAxis *xAxis, TAxis *yAxis, TAxis *zAxis, TString xtit, TString ytit)
void SetCanvasDisplacementX(int displacement)
TPad * GetPad(int padNumber)
void SetNDivisionsY(int div)
void SetPadRange(double xLow, double yLow, double xHigh, double yHigh)
void SetCanvasDisplacementY(int displacement)
void SetGrid(int gridX, int gridY)
void SetTickY(bool tick=true)
void SetLabelSizeX(double size)
void SetLogX(bool log=true)
int GetCanvasDisplacementY()
void ApplyStyleSettings(TH1 *histo, TString xTitle="", TString yTitle="")
void SetTitleOffsetY(double offset)
void SetTitleSizeX(double size)
void DrawGraphCustomAxes(TGraph *graph, double xlow, double xhigh, double ylow, double yhigh, const char *xTitle="", const char *yTitle="", const char *title="", const char *drawOption="")
void SetTopMargin(double margin)
void SetTitleSizeY(double size)
void SetBottomMargin(double margin)
void SetTickX(bool tick=true)
void SetHistogramAppearance(double titoffx, double titoffy, double titsizex, double titsizey, double labeloffx, double labeloffy, double labelsizex, double labelsizey, int divx, int divy, int fontIndex)
void CreateCanvasGraphRow()
void SetRightMargin(double margin)
void DrawHistogramToCurrentCanvas(TH1 *histo, const char *xTitle, const char *yTitle, const char *title="", const char *drawOption="")
void SetFunctionStyle(TF1 *hid, TString xtit, TString ytit)
def split(sequence, size)
void DrawHistogram(TH1 *histo, const char *drawOption="")
void SetHistogramStyle(TH1 *hid, TString xtit, TString ytit)
void CreateCanvas(double xlow, double xhigh, double ylow, double yhigh, const char *xTitle="", const char *yTitle="", const char *title="")
TString GenerateName(const char *objectName)
void SetDefaultAppearanceGraph()
void SetLogY(bool log=true)
void SetNDivisionsX(int div)
void SetMargins(double left, double right, double top, double bottom)
void SetCanvasDisplacement(int index)
void SetLabelOffsetY(double offset)
void DrawHistogramToPad(TH1 *histo, TPad *drawPad, const char *xTitle="", const char *yTitle="", const char *title="", const char *drawOption="")
void SetTitleOffsetX(double offset)
void SetDefaultAppearanceGraphRow()
TString GenerateNameForCanvas()
void DrawHistogram(TH1 *histo, const char *xTitle, const char *yTitle, const char *title="", const char *drawOption="")
void SetLogZ(bool log=true)
void CreateCanvasGraphRow(double xlow, double xhigh, double ylow, double yhigh, const char *xTitle="", const char *yTitle="", const char *title="")
void SetPadValues(TPad *pad)
void SetFont(int fontIndex)
void DrawFunction(TF1 *myFun, const char *drawOption="")
void SetGridY(bool grid=true)