10#ifndef TRKVALHISTUTILS_PLOTBASE_H
11#define TRKVALHISTUTILS_PLOTBASE_H
23#include "TProfile2D.h"
25#include "TEfficiency.h"
32typedef std::pair<TTree*, std::string>
TreeData;
55 TH1D*
Book1D(std::string_view name, std::string_view labels,
int nBins,
float start,
float end,
bool prependDir =
true);
57 TH1D*
Book1D(std::string_view name, TH1* refHist, std::string_view labels,
bool prependDir =
true);
60 TH2F*
Book2D(std::string_view name, std::string_view labels,
int nBinsX,
float startX,
float endX,
int nBinsY,
float startY,
float endY,
bool prependDir =
true);
62 TH2F*
Book2D(std::string_view name, TH2* refHist, std::string_view labels,
bool prependDir =
true);
64 TH2F*
Book2D(std::string_view name, std::string_view labels,
int nBinsX, Double_t* binsX,
int nBinsY, Double_t startY, Double_t endY,
bool prependDir =
true);
67 TH3F*
Book3D(std::string_view name, std::string_view labels,
int nBinsX,
float startX,
float endX,
int nBinsY,
float startY,
float endY,
int nBinsZ,
float startZ,
float endZ,
bool prependDir =
true);
69 TH3F*
Book3D(std::string_view name, TH3* refHist, std::string_view labels,
bool prependDir =
true);
72 TProfile*
BookTProfile(std::string_view name, std::string_view labels,
int nBinsX,
float startX,
float endX,
float startY=-1,
float endY=-1,
bool prependDir =
true,
bool useRMS=
false);
74 TProfile*
BookTProfile(std::string_view name, std::string_view labels,
int nBinsX,
float* binsX,
bool prependDir =
true);
76 TProfile*
BookTProfileRangeY(std::string_view name, std::string_view labels,
int nBinsX,
double* binsX,
double startY,
double endY,
bool prependDir =
true);
78 TProfile2D *
BookTProfile2D(std::string_view name, std::string_view labels,
const int nBinsX,
const double xlo,
const double xhi,
const int nBinsY,
const double ylo,
const double yhi,
bool prependDir=
true,
bool useRMS=
false);
80 TProfile2D *
BookTProfile2D(std::string_view name, std::string_view labels,
const int nBinsX,
double* binsX,
const int nBinsY,
double* binsY,
bool prependDir=
true,
bool useRMS=
false);
82 TEfficiency *
BookTEfficiency(std::string_view name, std::string_view labels,
const int nBinsX,
const float xlo,
const float xhi,
const bool prependDir =
true);
84 TEfficiency *
BookTEfficiency(std::string_view name, std::string_view labels,
const int nBinsX,
const float xlo,
const float xhi,
const int nBinsy,
const float ylo,
const float yhi,
const bool prependDir =
true);
87 TTree*
BookTree(std::string_view name,
bool prependDir =
true);
std::pair< TEfficiency *, std::string > EfficiencyData
std::pair< TH1 *, std::string > HistData
std::pair< TTree *, std::string > TreeData
std::vector< EfficiencyData > retrieveBookedEfficiencies()
Retrieve all booked efficiency objects.
std::vector< PlotBase * > m_vSubNodes
static std::string constructPrefix(std::string dir, bool prependDir)
std::vector< HistData > retrieveBookedHistograms()
Retrieve all booked histograms.
std::vector< EfficiencyData > m_vBookedEfficiencies
void setDetailLevel(int iDetailLevel)
const std::string & getDirectory()
TH1D * Book1D(std::string_view name, std::string_view labels, int nBins, float start, float end, bool prependDir=true)
Book a TH1D histogram.
TProfile * BookTProfile(std::string_view name, std::string_view labels, int nBinsX, float startX, float endX, float startY=-1, float endY=-1, bool prependDir=true, bool useRMS=false)
Book a TProfile histogram.
PlotBase(PlotBase *parent, std::string_view sDir)
TEfficiency * BookTEfficiency(std::string_view name, std::string_view labels, const int nBinsX, const float xlo, const float xhi, const bool prependDir=true)
Book a (1-D) TEfficiency histogram.
TH2F * Book2D(std::string_view name, std::string_view labels, int nBinsX, float startX, float endX, int nBinsY, float startY, float endY, bool prependDir=true)
Book a TH2F histogram.
virtual void initializePlots()
TH3F * Book3D(std::string_view name, std::string_view labels, int nBinsX, float startX, float endX, int nBinsY, float startY, float endY, int nBinsZ, float startZ, float endZ, bool prependDir=true)
Book a TH3F histogram.
std::vector< HistData > m_vBookedHistograms
virtual void finalizePlots()
std::vector< TreeData > retrieveBookedTrees()
Retrieve all booked trees.
void RegisterSubPlot(PlotBase *pPlotBase)
TTree * BookTree(std::string_view name, bool prependDir=true)
Book a TTree.
TProfile * BookTProfileRangeY(std::string_view name, std::string_view labels, int nBinsX, double *binsX, double startY, double endY, bool prependDir=true)
Book a TProfile histogram with variable binning in x-axis and limits in y-values.
std::vector< TreeData > m_vBookedTrees
TProfile2D * BookTProfile2D(std::string_view name, std::string_view labels, const int nBinsX, const double xlo, const double xhi, const int nBinsY, const double ylo, const double yhi, bool prependDir=true, bool useRMS=false)
Book a TProfile 2D histogram with variable binning in x-axis and limits in y-values.