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) {
104 static_cast<TH1*
>(h_merged)->
Add(
static_cast<TH1*
>(
h));
129 f->GetObject(
fName.c_str(), hs);
138 for (
Int_t i = 0; i < naxes; ++i) {
151 const Int_t naxes =
h.GetNdimensions();
152 const Int_t naxes2 = axes.size();
154 if (naxes != naxes2) {
158 for (
Int_t i = 0; i < naxes; ++i) {
159 const TAxis* ax1 =
h.GetAxis(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};
Array of doubles (64 bits per element).
Double_t GetAt(Int_t i) const
Class to manage histogram axis.
const TArrayD * GetXbins() const
virtual void Copy(TObject &axis) const
Copy axis structure to another axis.
TDirectory::TContext keeps track and restore the current directory.
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format.
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault, Int_t netopt=0)
Create / open a file.
TH1 is the base class of all histogram classes in ROOT.
Service class for 2-D histogram classes.
The 3-D histogram classes derived from the 1-D histogram classes.
Multidimensional histogram base.
TH1D * Projection(Int_t xDim, Option_t *option="") const
Project all bins into a 1-dimensional histogram, keeping only axis "xDim".
Int_t GetNdimensions() const
THnBase * ProjectionND(Int_t ndim, const Int_t *dim, Option_t *option="") const
TAxis * GetAxis(Int_t dim) const
TAxis * GetAxis(Int_t i) const
Get an axis from the histogram.
std::vector< TAxis * > fAxes
the list of histogram axes
THnBase * ReadHistogram(const char *fileName) const
Retrieve a histogram from a file.
void SetupAxes(THnBase &hs) const
Copy the properties of all axes to a histogram.
THnBase * ProjectionND(Int_t ndim, const Int_t *dim, Option_t *option="") const
See THnBase::Projection for the intended behavior.
TObject * ProjectionAny(Int_t ndim, const Int_t *dim, Option_t *option="") const
Projects all histograms in the chain.
static bool CheckConsistency(const THnBase &h, const std::vector< TAxis * > &axes)
Ensure a histogram has axes similar to the ones we expect.
void AddFile(const char *fileName)
Add a new file to this chain.
TH1 * Projection(Int_t xDim, Option_t *option="") const
See THnBase::Projection for the intended behavior.
std::string fName
name of the histogram
std::vector< std::string > fFiles
a list of files to extract the histogram from
Mother of all ROOT objects.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
Bool_t AreEqualRel(Double_t af, Double_t bf, Double_t relPrec)
TMatrixT< Element > & Add(TMatrixT< Element > &target, Element scalar, const TMatrixT< Element > &source)
Modify addition: target += scalar * source.