22 struct CounterRange_t {
39 ~THnBinIter() {
delete [] fCounter; }
44 THnBinIter(
const THnBinIter&);
51 CounterRange_t* fCounter;
60 ROOT::Internal::THnBaseBinIter(respectAxisRange),
61 fNdimensions(dim), fIndex(-1), fArray(arr) {
62 fCounter =
new CounterRange_t[dim]();
63 for (
Int_t i = 0; i < dim; ++i) {
65 fCounter[i].len = axis->
GetNbins() + 2;
68 fCounter[i].first = 0;
69 fCounter[i].last = fCounter[i].len - 1;
73 fHaveSkippedBin =
kTRUE;
76 if (min == 0 && max == 0) {
83 fCounter[i].first =
min;
84 fCounter[i].last =
max;
86 fIndex += fCounter[i].first * fCounter[i].cellSize;
89 --fCounter[dim - 1].i;
97 if (fNdimensions < 0)
return -1;
98 ++fCounter[fNdimensions - 1].i;
101 for (
Int_t d = fNdimensions - 1;
d > 0 && fCounter[
d].i > fCounter[
d].last; --
d) {
103 Int_t skippedCells = fCounter[
d].len - (fCounter[
d].last + 1);
104 skippedCells += fCounter[
d].first;
105 fIndex += skippedCells * fCounter[
d].cellSize;
106 fCounter[
d].i = fCounter[
d].first;
109 if (fCounter[0].i > fCounter[0].last) {
114 for (
Int_t d = 0;
d < fNdimensions; ++
d) {
115 coord[
d] = fCounter[
d].i;
187 THnBase(name, title, dim, nbins, xmin, xmax),
188 fSumw2(dim, nbins,
kTRUE ),
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.
Int_t GetFirst() const
Return first bin on the axis i.e.
Bool_t GetCalculateErrors() const
static Vc_ALWAYS_INLINE int_v min(const int_v &x, const int_v &y)
void AllocCoordBuf() const
Create the coordinate buffer.
virtual Double_t AtAsDouble(ULong64_t linidx) const =0
void Init(Int_t ndim, const Int_t *nbins, bool addOverflow=false)
Int_t GetNdimensions() const
virtual void Reset(Option_t *option="")=0
void Sumw2()
Enable calculation of errors.
TNDArrayT< Double_t > fSumw2
virtual Int_t GetCoord(Int_t dim) const =0
void InitStorage(Int_t *nbins, Int_t chunkSize)
Initialize the storage of a histogram created via Init()
Class to manage histogram axis.
TPaveLabel title(3, 27.1, 15, 28.7,"ROOT Environment and Tools")
void Reset(Option_t *="")
Iterator over THnBase bins (internal implementation).
Bool_t TestBit(UInt_t f) const
Multidimensional histogram.
T At(const Int_t *idx) const
Long64_t GetNbins() const
virtual void Init(Int_t ndim, const Int_t *nbins, bool addOverflow=false)
static Vc_ALWAYS_INLINE int_v max(const int_v &x, const int_v &y)
Int_t GetLast() const
Return last bin on the axis i.e.
Binding & operator=(OUT(*fun)(void))
virtual ~THn()
Destruct a THn.
TObjArray * GetListOfAxes()
Multidimensional histogram base.
TObject * At(Int_t idx) const
void Reset(Option_t *option="")
Reset the contents of a THn.
virtual Long64_t Next(Int_t *coord=0)=0
virtual const TNDArray & GetArray() const =0