29 fFiles.emplace_back(fileName);
38 fAxes.push_back(
hs->GetAxis(i));
42 "Could not find histogram %s in file %s",
78 for (
const auto& file :
fFiles) {
83 "Could not find histogram %s in file %s",
92 "Histogram %s from file %s is inconsistent with the histogram from file %s",
107 }
else if (ndim == 2) {
108 h =
hs->Projection(dim[0], dim[1],
option);
109 }
else if (ndim == 3) {
110 h =
hs->Projection(dim[0], dim[1], dim[2],
option);
188 if (
ax1->GetNbins() !=
ax2->GetNbins()) {
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Array of doubles (64 bits per element).
Class to manage histogram axis.
TDirectory::TContext keeps track and restore the current directory.
A ROOT file is an on-disk file, usually with extension .root, that stores objects in a file-system-li...
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.
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)
Comparing floating points.
TMatrixT< Element > & Add(TMatrixT< Element > &target, Element scalar, const TMatrixT< Element > &source)
Modify addition: target += scalar * source.