26 fFiles.emplace_back(fileName);
34 for (
Int_t i = 0; i < naxes; ++i) {
39 "Could not find histogram %s in file %s",
48 if (i < 0 || i >= static_cast<Int_t>(
fAxes.size())) {
67 "Could not find histogram %s in file %s",
76 "Histogram %s from file %s is inconsistent with the histogram from file %s",
91 }
else if (ndim == 2) {
93 }
else if (ndim == 3) {
94 h = hs->
Projection(dim[0], dim[1], dim[2], option);
104 static_cast<TH1*
>(h_merged)->
Add(static_cast<TH1*>(h));
106 static_cast<THnBase*
>(h_merged)->
Add(static_cast<THnBase*>(h));
138 for (
Int_t i = 0; i < naxes; ++i) {
152 const Int_t naxes2 = axes.size();
154 if (naxes != naxes2) {
158 for (
Int_t i = 0; i < naxes; ++i) {
160 const TAxis* ax2 = axes[i];
177 if (h2Array->
fN != fN) {
180 for (
int ibin = 0; ibin < fN; ++ibin) {
198 Int_t dim[1] = {xDim};
205 Int_t dim[2] = {xDim, yDim};
212 Int_t dim[3] = {xDim, yDim, zDim};
static bool CheckConsistency(const THnBase &h, const std::vector< TAxis *> &axes)
Ensure a histogram has axes similar to the ones we expect.
TObject * ProjectionAny(Int_t ndim, const Int_t *dim, Option_t *option="") const
Projects all histograms in the chain.
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format...
std::string fName
name of the histogram
virtual void Copy(TObject &axis) const
Copy axis structure to another axis.
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=1, Int_t netopt=0)
Create / open a file.
TH1D * Projection(Int_t xDim, Option_t *option="") const
The 3-D histogram classes derived from the 1-D histogram classes.
void GetObject(const char *namecycle, T *&ptr)
TH1 * Projection(Int_t xDim, Option_t *option="") const
See THnBase::Projection for the intended behavior.
Bool_t AreEqualRel(Double_t af, Double_t bf, Double_t relPrec)
TAxis * GetAxis(Int_t i) const
Get an axis from the histogram.
void SetupAxes(THnBase &hs) const
Copy the properties of all axes to a histogram.
TAxis * GetAxis(Int_t dim) const
Service class for 2-Dim histogram classes.
Class to manage histogram axis.
std::vector< std::string > fFiles
a list of files to extract the histogram from
constexpr Double_t E()
Base of natural log: .
void Add(THist< DIMENSIONS, PRECISION_TO, STAT_TO... > &to, const THist< DIMENSIONS, PRECISION_FROM, STAT_FROM... > &from)
Add two histograms.
THnBase * ProjectionND(Int_t ndim, const Int_t *dim, Option_t *option="") const
Array of doubles (64 bits per element).
Int_t GetNdimensions() const
Mother of all ROOT objects.
std::vector< TAxis * > fAxes
the list of histogram axes
THnBase * ReadHistogram(const char *fileName) const
Retrieve a histogram from a file.
Double_t GetAt(Int_t i) const
THnBase * ProjectionND(Int_t ndim, const Int_t *dim, Option_t *option="") const
See THnBase::Projection for the intended behavior.
void AddFile(const char *fileName)
Add a new file to this chain.
Multidimensional histogram base.
const TArrayD * GetXbins() const
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.