TQTHnBaseUtils: TQTHnBaseUtils is a namespace providing a set of static utility methods for multidimensional histograms with its base class THnBase. It is highly derived from the TQHistogramUtils class, where more information can be found.
bool | addHistogram(THnBase* histo1, THnBase* histo2, TQCounter* scale, double corr12 = 0., bool includeScaleUncertainty = false) |
bool | addHistogram(THnBase* histo1, THnBase* histo2, double scale = 1., double scaleUncertainty = 0., double corr12 = 0., bool includeScaleUncertainty = true) |
bool | checkConsistency(THnBase* histo1, THnBase* histo2, bool verbose = false) |
bool | copyAxisNames(THnBase* histo, THnBase* copy) |
THnBase* | copyHistogram(THnBase* histo, const TString& newName = "") |
THnBase* | createHistogram(TString definition, bool printErrMsg = false) |
THnBase* | createHistogram(TString definition, TString& errMsg) |
bool | extractBinning(TQTaggable* p, int& dimension, vector<int>& nBins, vector<double>& min, vector<double>& max, TString& errMsg) |
TAxis* | getAxis(THnBase* h, const TString& axis_name) |
bool | getAxisIndex(THnBase* h, const TString& axis_name, int& index) |
int | getDimension(THnBase* histo) |
TString | getHistogramDefinition(THnBase* histo) |
THnBase* | projectionND(THnBase* hist, vector<TString> axesNamesToUse, const TString& option = "E") |
bool | scaleHistogram(THnBase* histo1, TQCounter* scale, bool includeScaleUncertainty = false) |
bool | scaleHistogram(THnBase* histo1, double scale = 1., double scaleUncertainty = 0., bool includeScaleUncertainty = true) |
Returns a string representing the definition of the histogram following a syntax compatible with TQTHnBaseUtils::createHistogram(...) and being similar to the constructor of the corresponding histogram class. e.g. for a 3-dim histogram: "THnSparseF('histo', 'title', 3, {34, 28, 24}, {0., 10., 0.}, {170., 290., 3.14})" An empty string is returned in case an invalid histogram is passed.
Creates a new instance of a THnBase histogram from a definition string that uses a similar syntax as the constructor of the corresponding histogram class. Currently only THnSparseF and THnSparseD is supported Examples: - a THnSparse with 3 dimensions: createTHnBase("THnSparseF('histo', 'title', 3, {34, 28, 24}, {0., 10., 0.}, {170., 290., 3.14})")
extract the binning definition of the THnBase object. This must exactly fit the syntax of the histogram definition file.
Creates an independent copy of the input histogram <histo> which is a THnBase and returns a pointer to the copy or a NULL pointer in case of failure.
use built in Root function for scaling Remark: This means there is no support for scale uncertainties!
use built in Root function for scaling Remark: This means there is no support for scale uncertainties!
Check if two histograms have consistent binning Remark: This is code from built-in Root function THnBase::CheckConsistency()
return multidimensional histogram with only the dimensions specified with axes names in the axesNamesToUse vector. Note that the order of axes in the new histogram is taken from this vector!
returns axis index of dimension with name 'name'