81 return const_cast<const THn*
>(
this)->
GetBin(idx);
84 return const_cast<const THn*
>(
this)->
GetBin(x);
87 return const_cast<const THn*
>(
this)->
GetBin(name);
135 idx[i] = (bin % prevCellSize) / cellSize;
136 prevCellSize = cellSize;
227 template <
typename T>
235 THn(name, title, dim, nbins, xmin, xmax),
236 fArray(dim, nbins, true) {}
void SetBinContent(Long64_t bin, Double_t v)
static THn * CreateHn(const char *name, const char *title, const TH1 *h1)
THn * Projection(Int_t ndim, const Int_t *dim, Option_t *option="") const
ROOT::Internal::THnBaseBinIter * CreateIter(Bool_t respectAxisRange) const
Create an iterator over all bins. Public interface is THnIter.
Bool_t GetCalculateErrors() const
TH1D * Projection(Int_t xDim, Option_t *option="") const
Double_t GetBinContent(Long64_t bin, Int_t *idx=0) const
TH3D * Projection(Int_t xDim, Int_t yDim, Int_t zDim, Option_t *option="") const
THnBase * RebinBase(Int_t group) const
Combine the content of "group" neighboring bins into a new bin and return the resulting THnBase...
void SetBinError2(Long64_t bin, Double_t e2)
Long64_t GetBin(const Double_t *x) const
Double_t GetBinContent(const Int_t *idx) const
virtual Double_t AtAsDouble(ULong64_t linidx) const =0
static THnBase * CreateHnAny(const char *name, const char *title, const TH1 *h1, Bool_t sparse, Int_t chunkSize=1024 *16)
Create a THn / THnSparse object from a histogram deriving from TH1.
void FillBinBase(Double_t w)
virtual void SetAsDouble(ULong64_t linidx, Double_t value)=0
THn & operator=(const THn &)
THn * Rebin(const Int_t *group) const
void AddBinContent(const Int_t *x, Double_t v=1.)
Long64_t GetBin(const char *name[]) const
Long64_t GetNbins() const
Double_t GetBinContent(const Int_t *idx) const
static THn * CreateHn(const char *name, const char *title, const THnBase *hn)
#define ClassDef(name, id)
Efficient multidimensional histogram.
Long64_t GetBin(const char *name[], Bool_t=kTRUE)
Templated implementation of the abstract base THn.
TH1D * Projection(Int_t xDim, Option_t *option="") const
Long64_t GetNbins() const
void Sumw2()
Enable calculation of errors.
void SetBinContent(const Int_t *idx, Double_t v)
Long64_t GetBin(const Int_t *idx, Bool_t=kTRUE)
TNDArrayT< Double_t > fSumw2
const TNDArray & GetArray() const
void InitStorage(Int_t *nbins, Int_t chunkSize)
Initialize the storage of a histogram created via Init()
TAxis * GetAxis(Int_t dim) const
void AllocCoordBuf() const
Create the coordinate buffer.
tomato 3-D histogram with a double per channel (see TH1 documentation)}
T At(const Int_t *idx) const
void SetBinContent(const Int_t *idx, Double_t v)
Long64_t GetBin(const Int_t *idx) const
void AddBinContent(const Int_t *idx, Double_t v=1.)
Iterator over THnBase bins (internal implementation).
void AddBinError2(Long64_t bin, Double_t e2)
THn * Rebin(Int_t group) const
void AddAt(ULong64_t linidx, Double_t value)
Multidimensional histogram.
TH2D * Projection(Int_t yDim, Int_t xDim, Option_t *option="") const
void AddBinContent(Long64_t bin, Double_t v=1.)
tomato 1-D histogram with a double per channel (see TH1 documentation)}
virtual Int_t FindBin(Double_t x)
Find bin number corresponding to abscissa x.
THnBase * ProjectionND(Int_t ndim, const Int_t *dim, Option_t *option="") const
Long64_t GetBin(const Double_t *x, Bool_t=kTRUE)
Int_t GetNdimensions() const
Double_t GetBinError2(Long64_t linidx) const
virtual Int_t FindFixBin(Double_t x) const
Find bin number corresponding to abscissa x.
virtual ~THn()
Destruct a THn.
void FillBin(Long64_t bin, Double_t w)
Long64_t GetBin(const Int_t *idx) const
Long64_t GetCellSize(Int_t dim) const
Multidimensional histogram base.
THnT(const char *name, const char *title, Int_t dim, const Int_t *nbins, const Double_t *xmin, const Double_t *xmax)
void Reset(Option_t *option="")
Reset the contents of a THn.
virtual void AddAt(ULong64_t linidx, Double_t value)=0
tomato 2-D histogram with a double per channel (see TH1 documentation)}
virtual const TNDArray & GetArray() const =0