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) {
231 TH1 *
histo,
const char *xTitle,
const char *yTitle,
const char *
title =
"",
const char *
drawOption =
"") {
233 if (strcmp(xTitle,
"") == 0)
234 xTitle =
histo->GetXaxis()
236 if (strcmp(yTitle,
"") == 0)
237 yTitle =
histo->GetYaxis()->GetTitle();
238 if (strcmp(
title,
"") == 0)
257 TH1 *
histo,
const char *xTitle,
const char *yTitle,
const char *
title =
"",
const char *
drawOption =
"") {
259 if (strcmp(xTitle,
"") == 0)
260 xTitle =
histo->GetXaxis()
262 if (strcmp(yTitle,
"") == 0)
263 yTitle =
histo->GetYaxis()->GetTitle();
264 if (strcmp(
title,
"") == 0)
293 const char *xTitle =
"",
294 const char *yTitle =
"",
295 const char *
title =
"",
298 if (strcmp(xTitle,
"") == 0)
299 xTitle =
histo->GetXaxis()
301 if (strcmp(yTitle,
"") == 0)
302 yTitle =
histo->GetYaxis()->GetTitle();
303 if (strcmp(
title,
"") == 0)
311 gStyle->SetOptStat(0);
312 gStyle->SetOptTitle(0);
330 const char *xTitle =
"",
331 const char *yTitle =
"",
332 const char *
title =
"",
353 const char *xTitle =
"",
354 const char *yTitle =
"",
355 const char *
title =
"",
384 const char *xTitle =
"",
385 const char *yTitle =
"",
386 const char *
title =
"",
411 const char *xTitle =
"",
412 const char *yTitle =
"",
413 const char *
title =
"",
416 if (strcmp(xTitle,
"") == 0)
417 xTitle = graph->GetXaxis()
419 if (strcmp(yTitle,
"") == 0)
420 yTitle = graph->GetYaxis()->GetTitle();
421 if (strcmp(
title,
"") == 0)
422 title = graph->GetTitle();
426 graph->SetTitle(
title);
427 graph->GetXaxis()->SetRangeUser(xlow, xhigh);
428 graph->GetYaxis()->SetRangeUser(ylow, yhigh);
443 TF1 *myFun,
const char *xTitle,
const char *yTitle,
const char *
title =
"",
const char *
drawOption =
"") {
445 if (strcmp(xTitle,
"") == 0)
446 xTitle = myFun->GetXaxis()
448 if (strcmp(yTitle,
"") == 0)
449 yTitle = myFun->GetYaxis()->GetTitle();
450 if (strcmp(
title,
"") == 0)
451 title = myFun->GetTitle();
455 myFun->SetTitle(
title);
535 gStyle->SetOptStat(0);
538 fSinglePad =
new TPad(
"pad",
"pad", 0.01, 0.01, 0.99, 0.99, 0, 0, 0);
563 const char *xTitle =
"",
564 const char *yTitle =
"",
565 const char *
title =
"") {
571 TH2F *dummyHisto =
new TH2F(dummyName.Data(),
title, 10, xlow, xhigh, 10, ylow, yhigh);
587 gStyle->SetOptStat(0);
588 gStyle->SetOptTitle(0);
589 fCanvas->SetMargin(0, 0, 0, 0);
625 gStyle->SetOptStat(0);
626 gStyle->SetOptTitle(0);
627 fCanvas->SetMargin(0, 0, 0, 0);
633 double smallMargin = 0.0006;
634 double evenSmallerMargin = 0.0002;
635 double relativePlotSizeLeftPad = 1 - (
fMarginLeft + evenSmallerMargin);
636 double relativePlotSizeMiddlePad = 1 - (2 * smallMargin);
637 double relativePlotSizeRightPad = 1 - (
fMarginRight + smallMargin);
638 double firstSeparator = 1 / (1 + relativePlotSizeLeftPad / relativePlotSizeMiddlePad +
639 relativePlotSizeLeftPad / relativePlotSizeRightPad);
640 double secondSeparator = firstSeparator + (relativePlotSizeLeftPad / relativePlotSizeMiddlePad) * firstSeparator;
644 fLeftRowPad =
new TPad(dummyName.Data(), dummyName.Data(), 0, 0, firstSeparator, 1, 0);
655 fMiddleRowPad =
new TPad(dummyName.Data(), dummyName.Data(), firstSeparator, 0, secondSeparator, 1, 0);
667 fRightRowPad =
new TPad(dummyName.Data(), dummyName.Data(), secondSeparator, 0, 1, 1, 0);
692 const char *xTitle =
"",
693 const char *yTitle =
"",
694 const char *
title =
"") {
701 TH2F *dummyHisto =
new TH2F(dummyName.Data(),
"", 10, xlow, xhigh, 10, ylow, yhigh);
708 dummyHisto =
new TH2F(dummyName.Data(),
title, 10, xlow, xhigh, 10, ylow, yhigh);
715 dummyHisto =
new TH2F(dummyName.Data(),
"", 10, xlow, xhigh, 10, ylow, yhigh);
753 void SetMargins(
double left,
double right,
double top,
double bottom) {
1026 SetHistogramAppearance(2.5, 2.3, 25, 25, 0.01, 0.001, 20, 20, 505, 505, 43);
1037 SetHistogramAppearance(0.9, 1.3, 0.06, 0.05, 0.01, 0.001, 0.05, 0.05, 505, 505, 42);
1047 SetHistogramAppearance(0.9, 1.3, 0.06, 0.05, 0.01, 0.001, 0.05, 0.05, 505, 505, 42);
1056 switch (padNumber) {
1081 switch (padNumber) {
1103 std::cout <<
"Pad " << padNumber <<
" not found" << std::endl;
1144 std::cout <<
"Error: No canvas defined! Cannot return name." << std::endl;
1159 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)