29 #ifndef ROOT_TFitResultPtr
32 #ifndef ROOT_TObjArray
76 fNdimensions(0), fEntries(0),
88 fTsumwx2[d] += w * xd * xd;
105 void Init(
const char*
name,
const char* title,
107 Int_t chunkSize = 1024 * 16);
126 Int_t chunkSize = 1024 * 16);
129 Int_t chunkSize = 1024 * 16);
219 const Int_t dim[2] = {xDim, yDim};
233 const Int_t dim[3] = {xDim, yDim, zDim};
254 virtual void Sumw2() = 0;
315 fIter(hist->CreateIter(respectAxisRange)) {}
335 #endif // ROOT_THnBase
Double_t ComputeIntegral()
Calculate the integral of the histogram.
Double_t GetBinContent(const Int_t *idx) const
Bool_t GetCalculateErrors() const
Bool_t RespectsAxisRange() const
virtual void Reset(Option_t *option="")=0
void Divide(const THnBase *h)
Divide this histogram by h this = this/(h) Note that if h has Sumw2 set, Sumw2 is automatically calle...
void SetEntries(Double_t entries)
void CalculateErrors(Bool_t calc=kTRUE)
Namespace for new ROOT classes and functions.
TFitResultPtr Fit(TF1 *f1, Option_t *option="", Option_t *goption="")
Fit a THnSparse with function f.
virtual void FillBin(Long64_t bin, Double_t w)=0
virtual Long64_t GetNbins() const =0
Long64_t Fill(const Double_t *x, Double_t w=1.)
void Multiply(const THnBase *h)
Multiply this histogram by histogram h this = this * h Note that if h has Sumw2 set, Sumw2 is automatically called for this if not already set.
void Scale(Double_t c)
Scale contents and errors of this histogram by c: this = this * c It does not modify the histogram's ...
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 GetRandom(Double_t *rand, Bool_t subBinRandom=kTRUE)
Generate an n-dimensional random tuple based on the histogrammed distribution.
Double_t GetSumwx2(Int_t dim) const
const TObjArray * GetListOfAxes() const
TH1 * CreateHist(const char *name, const char *title, const TObjArray *axes, Bool_t keepTargetAxis) const
Create an empty histogram with name and title with a given set of axes.
void FillBinBase(Double_t w)
const TKDTreeBinning * bins
THnBaseBinIter(Bool_t respectAxisRange)
void AddBinContent(const Int_t *x, Double_t v=1.)
Bool_t IsFolder() const
Returns kTRUE in case object contains browsable objects (like containers or lists of other objects)...
void Print(Option_t *option="") const
Print a THnBase.
Bool_t HaveSkippedBin() const
THnIter(const THnBase *hist, Bool_t respectAxisRange=kFALSE)
Double_t fEntries
browser-helpers for each axis
THnBaseBrowsable(THnBase *hist, Int_t axis)
Construct a THnBaseBrowsable.
Double_t GetBinError(Long64_t linidx) const
TBrowser helper for THnBase.
Int_t GetNdimensions() const
TList * GetListOfFunctions()
THnBase & operator=(const THnBase &)
The TNamed class is the base class for all named ROOT classes.
Long64_t Fill(const char *name[], Double_t w=1.)
virtual void Reserve(Long64_t)
enum THnBase::@95 fIntegralStatus
array with bin weight sums
void SetBinContent(const Int_t *idx, Double_t v)
Bool_t IsInRange(Int_t *coord) const
Check whether bin coord is in range, as defined by TAxis::SetRange().
virtual ~THnBaseBinIter()
Destruct a bin iterator.
THnBase * CloneEmpty(const char *name, const char *title, const TObjArray *axes, Bool_t keepTargetAxis) const
Create a new THnBase object that is of the same type as *this, but with dimensions and bins given by ...
TObject * ProjectionAny(Int_t ndim, const Int_t *dim, Bool_t wantNDim, Option_t *option="") const
Project all bins into a ndim-dimensional THn / THnSparse (whatever *this is) or if (ndim < 4 and !wan...
TH1D * Projection(Int_t xDim, Option_t *option="") const
void Browse(TBrowser *b)
Browse an axis of a THnBase, i.e. draw its projection.
virtual Double_t GetBinError2(Long64_t linidx) const =0
virtual Int_t GetCoord(Int_t dim) const =0
THnBase * RebinBase(Int_t group) const
Combine the content of "group" neighboring bins into a new bin and return the resulting THnBase...
Using a TBrowser one can browse all ROOT objects.
void AddInternal(const THnBase *h, Double_t c, Bool_t rebinned)
Add() implementation for both rebinned histograms and those with identical binning.
virtual void InitStorage(Int_t *nbins, Int_t chunkSize)=0
ClassDef(THnBaseBrowsable, 0)
Double_t GetEntries() const
virtual void SetFilledBins(Long64_t)
Double_t GetBinError(const Int_t *idx) const
Class to manage histogram axis.
3-D histogram with a double per channel (see TH1 documentation)}
Long64_t Next(Int_t *coord=0)
TH2D * Projection(Int_t yDim, Int_t xDim, Option_t *option="") const
TH3D * Projection(Int_t xDim, Int_t yDim, Int_t zDim, Option_t *option="") const
Iterator over THnBase bins (internal implementation).
Bool_t RespectsAxisRange() const
virtual Long64_t GetBin(const Int_t *idx) const =0
void Init(const char *name, const char *title, const TObjArray *axes, Bool_t keepTargetAxis, Int_t chunkSize=1024 *16)
Initialize axes and name.
Provides an indirection to the TFitResult class and with a semantics identical to a TFitResult pointe...
Collection abstract base class.
virtual ~THnBase()
Destruct a THnBase.
Double_t GetSumwx(Int_t dim) const
TAxis * GetAxis(Int_t dim) const
void SetBinEdges(Int_t idim, const Double_t *bins)
Set the axis # of bins and bin limits on dimension idim.
1-D histogram with a double per channel (see TH1 documentation)}
virtual ROOT::Internal::THnBaseBinIter * CreateIter(Bool_t respectAxisRange) const =0
void UpdateXStat(const Double_t *x, Double_t w=1.)
Double_t GetSumw2() const
void SetBinError(const Int_t *idx, Double_t e)
virtual void SetBinError2(Long64_t bin, Double_t e2)=0
Bool_t CheckConsistency(const THnBase *h, const char *tag) const
Consistency check on (some of) the parameters of two histograms (for operations). ...
ROOT::Internal::THnBaseBinIter * fIter
void Add(const THnBase *h, Double_t c=1.)
Add contents of h scaled by c to this histogram: this = this + c * h Note that if h has Sumw2 set...
Long64_t Merge(TCollection *list)
Merge this with a list of THnBase's.
~THnBaseBrowsable()
Destruct a THnBaseBrowsable.
virtual void AddBinError2(Long64_t bin, Double_t e2)=0
Array of doubles (64 bits per element).
void Browse(TBrowser *b)
Browse a THnSparse: create an entry (ROOT::THnSparseBrowsable) for each dimension.
Mother of all ROOT objects.
void PrintBin(Int_t *coord, Option_t *options) const
Double_t GetWeightSum() const
Iterator over THnBase bins.
Bool_t IsFolder() const
Returns kTRUE in case object contains browsable objects (like containers or lists of other objects)...
TObjArray * GetListOfAxes()
Multidimensional histogram base.
Bool_t PrintBin(Long64_t idx, Int_t *coord, Option_t *options) const
Print one bin.
Double_t Sqrt(Double_t x)
THnBase * ProjectionND(Int_t ndim, const Int_t *dim, Option_t *option="") const
void RebinnedAdd(const THnBase *h, Double_t c=1.)
Add contents of h scaled by c to this histogram: this = this + c * h Note that if h has Sumw2 set...
void SetBinError(Long64_t bin, Double_t e)
virtual Long64_t Next(Int_t *coord=0)=0
void ResetBase(Option_t *option="")
Clear the histogram.
void SetTitle(const char *title)
Change (i.e.
void PrintEntries(Long64_t from=0, Long64_t howmany=-1, Option_t *options=0) const
Print "howmany" entries starting at "from".
Int_t GetCoord(Int_t dim) const
2-D histogram with a double per channel (see TH1 documentation)}
Bool_t HaveSkippedBin() const