27 #ifndef ROOT_TObjArray
103 return const_cast<const THn*
>(
this)->
GetBin(idx);
106 return const_cast<const THn*
>(
this)->
GetBin(x);
109 return const_cast<const THn*
>(
this)->
GetBin(name);
147 idx[i] = (bin % prevCellSize) / cellSize;
148 prevCellSize = cellSize;
239 template <
typename T>
247 THn(name, title, dim, nbins, xmin, xmax),
248 fArray(dim, nbins, true) {}
Long64_t GetBin(const Int_t *idx) const
Long64_t GetCellSize(Int_t dim) const
ROOT::Internal::THnBaseBinIter * CreateIter(Bool_t respectAxisRange) const
Create an iterator over all bins. Public interface is THnIter.
Double_t GetBinContent(const Int_t *idx) const
Bool_t GetCalculateErrors() const
void SetBinContent(Long64_t bin, Double_t v)
static THn * CreateHn(const char *name, const char *title, const TH1 *h1)
Double_t GetBinContent(Long64_t bin, Int_t *idx=0) const
void AllocCoordBuf() const
Create the coordinate buffer.
Long64_t GetBin(const char *name[]) const
void SetBinError2(Long64_t bin, Double_t e2)
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.
TH1D * Projection(Int_t xDim, Option_t *option="") const
THn * Projection(Int_t ndim, const Int_t *dim, Option_t *option="") const
void FillBinBase(Double_t w)
virtual void SetAsDouble(ULong64_t linidx, Double_t value)=0
THn & operator=(const THn &)
void AddBinContent(const Int_t *x, Double_t v=1.)
ClassDef(THn, 1)
Temporary buffer.
Long64_t GetBin(const Int_t *idx) const
static THn * CreateHn(const char *name, const char *title, const THnBase *hn)
Int_t GetNdimensions() const
Efficient multidimensional histogram.
Long64_t GetBin(const char *name[], Bool_t=kTRUE)
Templated implementation of the abstract base THn.
void Sumw2()
Enable calculation of errors.
Long64_t GetBin(const Double_t *x) const
Double_t GetBinContent(const Int_t *idx) const
void SetBinContent(const Int_t *idx, Double_t v)
Long64_t GetBin(const Int_t *idx, Bool_t=kTRUE)
TNDArrayT< Double_t > fSumw2
TH1D * Projection(Int_t xDim, 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 InitStorage(Int_t *nbins, Int_t chunkSize)
Initialize the storage of a histogram created via Init()
3-D histogram with a double per channel (see TH1 documentation)}
TPaveLabel title(3, 27.1, 15, 28.7,"ROOT Environment and Tools")
void SetBinContent(const Int_t *idx, Double_t v)
void AddBinContent(const Int_t *idx, Double_t v=1.)
Iterator over THnBase bins (internal implementation).
void AddBinError2(Long64_t bin, Double_t e2)
Long64_t GetNbins() const
void AddAt(ULong64_t linidx, Double_t value)
Multidimensional histogram.
T At(const Int_t *idx) const
void AddBinContent(Long64_t bin, Double_t v=1.)
THn * Rebin(Int_t group) const
TAxis * GetAxis(Int_t dim) const
Long64_t GetNbins() const
1-D histogram with a double per channel (see TH1 documentation)}
THn * Rebin(const Int_t *group) const
virtual Int_t FindBin(Double_t x)
Find bin number corresponding to abscissa x.
Long64_t GetBin(const Double_t *x, Bool_t=kTRUE)
const TNDArray & GetArray() const
virtual ~THn()
Destruct a THn.
void FillBin(Long64_t bin, Double_t w)
virtual Int_t FindFixBin(Double_t x) const
Find bin number corresponding to abscissa x.
Double_t GetBinError2(Long64_t linidx) const
Multidimensional histogram base.
TH2D * Projection(Int_t yDim, Int_t xDim, Option_t *option="") const
THnBase * ProjectionND(Int_t ndim, const Int_t *dim, Option_t *option="") const
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
2-D histogram with a double per channel (see TH1 documentation)}
TH3D * Projection(Int_t xDim, Int_t yDim, Int_t zDim, Option_t *option="") const
virtual const TNDArray & GetArray() const =0