166 void Sumw2()
override;
#define ClassDefOverride(name, id)
THnSparseT< TArrayL > THnSparseL
THnSparseT< TArrayS > THnSparseS
THnSparseT< TArrayF > THnSparseF
THnSparseT< TArrayC > THnSparseC
THnSparseT< TArrayD > THnSparseD
THnSparseT< TArrayI > THnSparseI
Iterator over THnBase bins (internal implementation).
Abstract array base class.
This class stores a (key,value) pair using an external hash.
1-D histogram with a double per channel (see TH1 documentation)}
TH1 is the base class of all histogram classes in ROOT.
2-D histogram with a double per channel (see TH1 documentation)}
3-D histogram with a double per channel (see TH1 documentation)}
Multidimensional histogram base.
void AddBinContent(const Int_t *x, Double_t v=1.)
TH1D * Projection(Int_t xDim, Option_t *option="") const
Project all bins into a 1-dimensional histogram, keeping only axis "xDim".
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.
THnBase * RebinBase(Int_t group) const
Combine the content of "group" neighboring bins into a new bin and return the resulting THnBase.
THnBase * ProjectionND(Int_t ndim, const Int_t *dim, Option_t *option="") const
Double_t GetBinContent(const Int_t *idx) const
void SetBinContent(const Int_t *idx, Double_t v)
void FillBinBase(Double_t w)
Increment the statistics due to filled weight "w",.
THnSparseArrayChunk is used internally by THnSparse.
void AddBinContent(Int_t idx, Double_t v=1.)
THnSparseCompactBinCoord is a class used by THnSparse internally.
Templated implementation of the abstract base THnSparse.
TArray * GenerateArray() const override
THnSparseT(const char *name, const char *title, Int_t dim, const Int_t *nbins, const Double_t *xmin=nullptr, const Double_t *xmax=nullptr, Int_t chunksize=1024 *16)
Efficient multidimensional histogram.
TH1D * Projection(Int_t xDim, Option_t *option="") const
Forwards to THnBase::Projection().
Double_t GetSparseFractionBins() const
Return the amount of filled bins over all bins.
Double_t GetSparseFractionMem() const
Return the amount of used memory over memory that would be used by a non-sparse n-dimensional histogr...
THnSparse * Rebin(Int_t group) const
void Reset(Option_t *option="") override
Clear the histogram.
THnSparse & operator=(const THnSparse &)=delete
void AddBinError2(Long64_t bin, Double_t e2) override
Add "e" to error of bin with index "bin", enable errors if needed.
TH3D * Projection(Int_t xDim, Int_t yDim, Int_t zDim, Option_t *option="") const
Forwards to THnBase::Projection().
void SetBinContent(const Int_t *idx, Double_t v)
Forwards to THnBase::SetBinContent().
THnSparseArrayChunk * GetChunk(Int_t idx) const
THnSparseCompactBinCoord * fCompactCoord
! Compact coordinate
Int_t GetChunkSize() const
Double_t GetBinContent(const Int_t *idx) const
Forwards to THnBase::GetBinContent() overload.
Long64_t fFilledBins
Number of filled bins.
Long64_t GetBin(const Int_t *idx) const override
TObjArray fBinContent
Array of THnSparseArrayChunk.
Long64_t GetBin(const char *name[]) const override
THnSparseCompactBinCoord * GetCompactCoord() const
Return THnSparseCompactBinCoord object.
void InitStorage(Int_t *nbins, Int_t chunkSize) override
Initialize the storage of a histogram created via Init()
static THnSparse * CreateSparse(const char *name, const char *title, const TH1 *h1, Int_t chunkSize=1024 *16)
Double_t GetBinError2(Long64_t linidx) const override
Get square of the error of bin addressed by linidx as If errors are not enabled (via Sumw2() or Calc...
THnSparse(const THnSparse &)=delete
THnSparse()
Construct an empty THnSparse.
THnSparseArrayChunk * AddChunk()
Create a new chunk of bin content.
virtual TArray * GenerateArray() const =0
void SetBinError2(Long64_t bin, Double_t e2) override
Set error of bin with index "bin" to "e", enable errors if needed.
void FillExMap()
We have been streamed; set up fBins.
THnSparse * Rebin(const Int_t *group) const
TH2D * Projection(Int_t yDim, Int_t xDim, Option_t *option="") const
Forwards to THnBase::Projection().
~THnSparse() override
Destruct a THnSparse.
void FillBin(Long64_t bin, Double_t w) override
Increment the bin content of "bin" by "w", return the bin index.
TExMap fBins
! Filled bins
Long64_t GetBin(const Double_t *x) const override
static THnSparse * CreateSparse(const char *name, const char *title, const THnBase *hn, Int_t chunkSize=1024 *16)
THnSparse * Projection(Int_t ndim, const Int_t *dim, Option_t *option="") const
TExMap fBinsContinued
! Filled bins for non-unique hashes, containing pairs of (bin index 0, bin index 1)
void AddBinContent(const Int_t *idx, Double_t v=1.)
Forwards to THnBase::SetBinContent().
void Reserve(Long64_t nbins) override
Initialize storage for nbins.
Int_t fChunkSize
Number of entries for each chunk.
void Sumw2() override
Enable calculation of errors.
Long64_t GetNbins() const override
ROOT::Internal::THnBaseBinIter * CreateIter(Bool_t respectAxisRange) const override
Create an iterator over all filled bins of a THnSparse.
void SetFilledBins(Long64_t nbins) override
Long64_t GetBinIndexForCurrentBin(Bool_t allocate)
Return the index for fCurrentBinIndex.
Int_t GetEntriesFast() const