Logo ROOT   6.16/01
Reference Guide
THnBase.h
Go to the documentation of this file.
1// @(#)root/hist:$Id$
2// Author: Axel Naumann (2011-12-20)
3
4/*************************************************************************
5 * Copyright (C) 1995-2012, Rene Brun and Fons Rademakers. *
6 * All rights reserved. *
7 * *
8 * For the licensing terms see $ROOTSYS/LICENSE. *
9 * For the list of contributors see $ROOTSYS/README/CREDITS. *
10 *************************************************************************/
11
12#ifndef ROOT_THnBase
13#define ROOT_THnBase
14
15/*************************************************************************
16
17 THnBase: Common base class for n-dimensional histogramming.
18 Defines interfaces and algorithms.
19
20*************************************************************************/
21
22
23#include "TNamed.h"
24#include "TMath.h"
25#include "TFitResultPtr.h"
26#include "TObjArray.h"
27#include "TArrayD.h"
28
29class TAxis;
30class TH1;
31class TH1D;
32class TH2D;
33class TH3D;
34class TF1;
35class THnIter;
36
37namespace ROOT {
38namespace Internal {
39 class THnBaseBinIter;
40}
41}
42
43class THnBase: public TNamed {
44protected:
45 Int_t fNdimensions; // number of dimensions
46 TObjArray fAxes; // axes of the histogram
47 TObjArray fBrowsables; //! browser-helpers for each axis
48 Double_t fEntries; // number of entries, spread over chunks
49 Double_t fTsumw; // total sum of weights
50 Double_t fTsumw2; // total sum of weights squared; -1 if no errors are calculated
51 TArrayD fTsumwx; // total sum of weight*X for each dimension
52 TArrayD fTsumwx2; // total sum of weight*X*X for each dimension
53 Double_t *fIntegral; //! array with bin weight sums
54 enum {
58 } fIntegralStatus; //! status of integral
59
60private:
61 THnBase(const THnBase&); // Not implemented
62 THnBase& operator=(const THnBase&); // Not implemented
63
64 protected:
68 {}
69
70 THnBase(const char* name, const char* title, Int_t dim,
71 const Int_t* nbins, const Double_t* xmin, const Double_t* xmax);
72
73 void UpdateXStat(const Double_t *x, Double_t w = 1.) {
74 if (GetCalculateErrors()) {
75 for (Int_t d = 0; d < fNdimensions; ++d) {
76 const Double_t xd = x[d];
77 fTsumwx[d] += w * xd;
78 fTsumwx2[d] += w * xd * xd;
79 }
80 }
81 }
82
83 /// Increment the statistics due to filled weight "w",
85 fEntries += 1;
86 if (GetCalculateErrors()) {
87 fTsumw += w;
88 fTsumw2 += w*w;
89 }
91 }
92
93 virtual void InitStorage(Int_t* nbins, Int_t chunkSize) = 0;
94 void Init(const char* name, const char* title,
95 const TObjArray* axes, Bool_t keepTargetAxis,
96 Int_t chunkSize = 1024 * 16);
97 THnBase* CloneEmpty(const char* name, const char* title,
98 const TObjArray* axes, Bool_t keepTargetAxis) const;
99 virtual void Reserve(Long64_t /*nbins*/) {}
100 virtual void SetFilledBins(Long64_t /*nbins*/) {};
101
102 Bool_t CheckConsistency(const THnBase *h, const char *tag) const;
103 TH1* CreateHist(const char* name, const char* title,
104 const TObjArray* axes, Bool_t keepTargetAxis) const;
105 TObject* ProjectionAny(Int_t ndim, const Int_t* dim,
106 Bool_t wantNDim, Option_t* option = "") const;
107 Bool_t PrintBin(Long64_t idx, Int_t* coord, Option_t* options) const;
108 void AddInternal(const THnBase* h, Double_t c, Bool_t rebinned);
110 THnBase* RebinBase(const Int_t* group) const;
111 void ResetBase(Option_t *option= "");
112
113 static THnBase* CreateHnAny(const char* name, const char* title,
114 const TH1* h1, Bool_t sparse,
115 Int_t chunkSize = 1024 * 16);
116 static THnBase* CreateHnAny(const char* name, const char* title,
117 const THnBase* hn, Bool_t sparse,
118 Int_t chunkSize = 1024 * 16);
119
120 public:
121 virtual ~THnBase();
122
124 const TObjArray* GetListOfAxes() const { return &fAxes; }
125 TAxis* GetAxis(Int_t dim) const { return (TAxis*)fAxes[dim]; }
126
127 TFitResultPtr Fit(TF1 *f1 ,Option_t *option = "", Option_t *goption = "");
128 TList* GetListOfFunctions() { return 0; }
129
130 virtual ROOT::Internal::THnBaseBinIter* CreateIter(Bool_t respectAxisRange) const = 0;
131
132 virtual Long64_t GetNbins() const = 0;
133 Double_t GetEntries() const { return fEntries; }
134 Double_t GetWeightSum() const { return fTsumw; }
136 Bool_t GetCalculateErrors() const { return fTsumw2 >= 0.; }
137
138 /// Calculate errors (or not if "calc" == kFALSE)
140 if (calc) Sumw2();
141 else fTsumw2 = -1.;
142 }
143
144 Long64_t Fill(const Double_t *x, Double_t w = 1.) {
145 UpdateXStat(x, w);
146 Long64_t bin = GetBin(x, kTRUE /*alloc*/);
147 FillBin(bin, w);
148 return bin;
149 }
150 Long64_t Fill(const char* name[], Double_t w = 1.) {
151 Long64_t bin = GetBin(name, kTRUE /*alloc*/);
152 FillBin(bin, w);
153 return bin;
154 }
155
156 virtual void FillBin(Long64_t bin, Double_t w) = 0;
157
158 void SetBinEdges(Int_t idim, const Double_t* bins);
159 Bool_t IsInRange(Int_t *coord) const;
160 Double_t GetBinError(const Int_t *idx) const { return GetBinError(GetBin(idx)); }
161 Double_t GetBinError(Long64_t linidx) const { return TMath::Sqrt(GetBinError2(linidx)); }
162 void SetBinError(const Int_t* idx, Double_t e) { SetBinError(GetBin(idx), e); }
164 void AddBinContent(const Int_t* x, Double_t v = 1.) { AddBinContent(GetBin(x), v); }
165 void SetEntries(Double_t entries) { fEntries = entries; }
166 void SetTitle(const char *title);
167
168 Double_t GetBinContent(const Int_t *idx) const { return GetBinContent(GetBin(idx)); } // intentionally non-virtual
169 virtual Double_t GetBinContent(Long64_t bin, Int_t* idx = 0) const = 0;
170 virtual Double_t GetBinError2(Long64_t linidx) const = 0;
171 virtual Long64_t GetBin(const Int_t* idx) const = 0;
172 virtual Long64_t GetBin(const Double_t* x) const = 0;
173 virtual Long64_t GetBin(const char* name[]) const = 0;
174 virtual Long64_t GetBin(const Int_t* idx, Bool_t /*allocate*/ = kTRUE) = 0;
175 virtual Long64_t GetBin(const Double_t* x, Bool_t /*allocate*/ = kTRUE) = 0;
176 virtual Long64_t GetBin(const char* name[], Bool_t /*allocate*/ = kTRUE) = 0;
177
178 void SetBinContent(const Int_t* idx, Double_t v) { SetBinContent(GetBin(idx), v); } // intentionally non-virtual
179 virtual void SetBinContent(Long64_t bin, Double_t v) = 0;
180 virtual void SetBinError2(Long64_t bin, Double_t e2) = 0;
181 virtual void AddBinError2(Long64_t bin, Double_t e2) = 0;
182 virtual void AddBinContent(Long64_t bin, Double_t v = 1.) = 0;
183
184 Double_t GetSumw() const { return fTsumw; }
185 Double_t GetSumw2() const { return fTsumw2; }
186 Double_t GetSumwx(Int_t dim) const { return fTsumwx[dim]; }
187 Double_t GetSumwx2(Int_t dim) const { return fTsumwx2[dim]; }
188
189 /// Project all bins into a 1-dimensional histogram,
190 /// keeping only axis "xDim".
191 /// If "option" contains:
192 /// - "E" errors will be calculated.
193 /// - "A" ranges of the taget axes will be ignored.
194 /// - "O" original axis range of the taget axes will be
195 /// kept, but only bins inside the selected range
196 /// will be filled.
197 TH1D* Projection(Int_t xDim, Option_t* option = "") const {
198 return (TH1D*) ProjectionAny(1, &xDim, false, option);
199 }
200
201 /// Project all bins into a 2-dimensional histogram,
202 /// keeping only axes "xDim" and "yDim".
203 ///
204 /// WARNING: just like TH3::Project3D("yx") and TTree::Draw("y:x"),
205 /// Projection(y,x) uses the first argument to define the y-axis and the
206 /// second for the x-axis!
207 ///
208 /// If "option" contains "E" errors will be calculated.
209 /// "A" ranges of the taget axes will be ignored.
210 TH2D* Projection(Int_t yDim, Int_t xDim, Option_t* option = "") const {
211 const Int_t dim[2] = {xDim, yDim};
212 return (TH2D*) ProjectionAny(2, dim, false, option);
213 }
214
215 /// Project all bins into a 3-dimensional histogram,
216 /// keeping only axes "xDim", "yDim", and "zDim".
217 /// If "option" contains:
218 /// - "E" errors will be calculated.
219 /// - "A" ranges of the taget axes will be ignored.
220 /// - "O" original axis range of the taget axes will be
221 /// kept, but only bins inside the selected range
222 /// will be filled.
223 TH3D* Projection(Int_t xDim, Int_t yDim, Int_t zDim, Option_t* option = "") const {
224 const Int_t dim[3] = {xDim, yDim, zDim};
225 return (TH3D*) ProjectionAny(3, dim, false, option);
226 }
227
228 THnBase* ProjectionND(Int_t ndim, const Int_t* dim,
229 Option_t* option = "") const {
230 return (THnBase*)ProjectionAny(ndim, dim, kTRUE /*wantNDim*/, option);
231 }
232
234
235 void Scale(Double_t c);
236 void Add(const THnBase* h, Double_t c=1.);
237 void Add(const TH1* hist, Double_t c=1.);
238 void Multiply(const THnBase* h);
239 void Multiply(TF1* f, Double_t c = 1.);
240 void Divide(const THnBase* h);
241 void Divide(const THnBase* h1, const THnBase* h2, Double_t c1 = 1., Double_t c2 = 1., Option_t* option="");
242 void RebinnedAdd(const THnBase* h, Double_t c=1.);
243
244 virtual void Reset(Option_t* option = "") = 0;
245 virtual void Sumw2() = 0;
246
248 void GetRandom(Double_t *rand, Bool_t subBinRandom = kTRUE);
249
250 void Print(Option_t* option = "") const;
251 void PrintEntries(Long64_t from = 0, Long64_t howmany = -1, Option_t* options = 0) const;
252 void PrintBin(Int_t* coord, Option_t* options) const {
253 PrintBin(-1, coord, options);
254 }
255 void PrintBin(Long64_t idx, Option_t* options) const;
256
257 void Browse(TBrowser *b);
258 Bool_t IsFolder() const { return kTRUE; }
259
260 //void Draw(Option_t* option = "");
261
262 ClassDef(THnBase, 1); // Common base for n-dimensional histogram
263
264 friend class THnIter;
265};
266
267namespace ROOT {
268namespace Internal {
269 // Helper class for browsing THnBase objects
270 class THnBaseBrowsable: public TNamed {
271 public:
272 THnBaseBrowsable(THnBase* hist, Int_t axis);
274 void Browse(TBrowser *b);
275 Bool_t IsFolder() const { return kFALSE; }
276
277 private:
278 THnBase* fHist; // Original histogram
279 Int_t fAxis; // Axis to visualize
280 TH1* fProj; // Projection result
281 ClassDef(THnBaseBrowsable, 0); // Browser-helper for THnBase
282 };
283
284 // Base class for iterating over THnBase bins
286 public:
287 THnBaseBinIter(Bool_t respectAxisRange):
288 fRespectAxisRange(respectAxisRange), fHaveSkippedBin(kFALSE) {}
289 virtual ~THnBaseBinIter();
292
293 virtual Int_t GetCoord(Int_t dim) const = 0;
294 virtual Long64_t Next(Int_t* coord = 0) = 0;
295
296 protected:
299 };
300}
301}
302
303class THnIter: public TObject {
304public:
305 THnIter(const THnBase* hist, Bool_t respectAxisRange = kFALSE):
306 fIter(hist->CreateIter(respectAxisRange)) {}
307 virtual ~THnIter();
308
309 /// Return the next bin's index.
310 /// If provided, set coord to that bin's coordinates (bin indexes).
311 /// I.e. coord must point to Int_t[hist->GetNdimensions()]
312 /// Returns -1 when all bins have been visited.
313 Long64_t Next(Int_t* coord = 0) {
314 return fIter->Next(coord);
315 }
316
317 Int_t GetCoord(Int_t dim) const { return fIter->GetCoord(dim); }
320
321private:
323 ClassDef(THnIter, 0); //Iterator over bins of a THnBase.
324};
325
326#endif // ROOT_THnBase
SVector< double, 2 > v
Definition: Dict.h:5
#define d(i)
Definition: RSha256.hxx:102
#define b(i)
Definition: RSha256.hxx:100
#define f(i)
Definition: RSha256.hxx:104
#define c(i)
Definition: RSha256.hxx:101
#define h(i)
Definition: RSha256.hxx:106
#define e(i)
Definition: RSha256.hxx:103
int Int_t
Definition: RtypesCore.h:41
const Bool_t kFALSE
Definition: RtypesCore.h:88
bool Bool_t
Definition: RtypesCore.h:59
double Double_t
Definition: RtypesCore.h:55
long long Long64_t
Definition: RtypesCore.h:69
const Bool_t kTRUE
Definition: RtypesCore.h:87
const char Option_t
Definition: RtypesCore.h:62
#define ClassDef(name, id)
Definition: Rtypes.h:324
float xmin
Definition: THbookFile.cxx:93
float xmax
Definition: THbookFile.cxx:93
Iterator over THnBase bins (internal implementation).
Definition: THnBase.h:285
Bool_t RespectsAxisRange() const
Definition: THnBase.h:291
Bool_t HaveSkippedBin() const
Definition: THnBase.h:290
virtual Int_t GetCoord(Int_t dim) const =0
THnBaseBinIter(Bool_t respectAxisRange)
Definition: THnBase.h:287
virtual ~THnBaseBinIter()
Destruct a bin iterator.
Definition: THnBase.cxx:1405
virtual Long64_t Next(Int_t *coord=0)=0
TBrowser helper for THnBase.
Definition: THnBase.h:270
Bool_t IsFolder() const
Returns kTRUE in case object contains browsable objects (like containers or lists of other objects).
Definition: THnBase.h:275
~THnBaseBrowsable()
Destruct a THnBaseBrowsable.
Definition: THnBase.cxx:1449
THnBaseBrowsable(THnBase *hist, Int_t axis)
Construct a THnBaseBrowsable.
Definition: THnBase.cxx:1433
void Browse(TBrowser *b)
Browse an axis of a THnBase, i.e. draw its projection.
Definition: THnBase.cxx:1457
Array of doubles (64 bits per element).
Definition: TArrayD.h:27
Class to manage histogram axis.
Definition: TAxis.h:30
Using a TBrowser one can browse all ROOT objects.
Definition: TBrowser.h:37
Collection abstract base class.
Definition: TCollection.h:63
1-Dim function class
Definition: TF1.h:211
Provides an indirection to the TFitResult class and with a semantics identical to a TFitResult pointe...
Definition: TFitResultPtr.h:31
1-D histogram with a double per channel (see TH1 documentation)}
Definition: TH1.h:614
The TH1 histogram class.
Definition: TH1.h:56
2-D histogram with a double per channel (see TH1 documentation)}
Definition: TH2.h:291
3-D histogram with a double per channel (see TH1 documentation)}
Definition: TH3.h:304
Multidimensional histogram base.
Definition: THnBase.h:43
virtual void Sumw2()=0
virtual ROOT::Internal::THnBaseBinIter * CreateIter(Bool_t respectAxisRange) const =0
void SetEntries(Double_t entries)
Definition: THnBase.h:165
virtual void SetFilledBins(Long64_t)
Definition: THnBase.h:100
const TObjArray * GetListOfAxes() const
Definition: THnBase.h:124
Long64_t Fill(const Double_t *x, Double_t w=1.)
Definition: THnBase.h:144
virtual void InitStorage(Int_t *nbins, Int_t chunkSize)=0
Double_t GetBinError(const Int_t *idx) const
Definition: THnBase.h:160
void SetBinError(const Int_t *idx, Double_t e)
Definition: THnBase.h:162
Double_t fEntries
browser-helpers for each axis
Definition: THnBase.h:48
virtual void AddBinContent(Long64_t bin, Double_t v=1.)=0
Double_t GetSumw2() const
Definition: THnBase.h:185
Bool_t IsInRange(Int_t *coord) const
Check whether bin coord is in range, as defined by TAxis::SetRange().
Definition: THnBase.cxx:429
TList * GetListOfFunctions()
Definition: THnBase.h:128
virtual Long64_t GetBin(const Int_t *idx, Bool_t=kTRUE)=0
TFitResultPtr Fit(TF1 *f1, Option_t *option="", Option_t *goption="")
Fit a THnSparse with function f.
Definition: THnBase.cxx:365
void AddBinContent(const Int_t *x, Double_t v=1.)
Definition: THnBase.h:164
void Scale(Double_t c)
Scale contents and errors of this histogram by c: this = this * c It does not modify the histogram's ...
Definition: THnBase.cxx:611
virtual void SetBinError2(Long64_t bin, Double_t e2)=0
TObjArray * GetListOfAxes()
Definition: THnBase.h:123
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.
Definition: THnBase.cxx:144
Bool_t PrintBin(Long64_t idx, Int_t *coord, Option_t *options) const
Print one bin.
Definition: THnBase.cxx:1241
TH1D * Projection(Int_t xDim, Option_t *option="") const
Project all bins into a 1-dimensional histogram, keeping only axis "xDim".
Definition: THnBase.h:197
Double_t GetSumwx(Int_t dim) const
Definition: THnBase.h:186
Bool_t CheckConsistency(const THnBase *h, const char *tag) const
Consistency check on (some of) the parameters of two histograms (for operations).
Definition: THnBase.cxx:987
Int_t GetNdimensions() const
Definition: THnBase.h:135
TH3D * Projection(Int_t xDim, Int_t yDim, Int_t zDim, Option_t *option="") const
Project all bins into a 3-dimensional histogram, keeping only axes "xDim", "yDim",...
Definition: THnBase.h:223
enum THnBase::@70 fIntegralStatus
array with bin weight sums
void PrintBin(Int_t *coord, Option_t *options) const
Definition: THnBase.h:252
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.
Definition: THnBase.cxx:197
virtual Long64_t GetBin(const char *name[], Bool_t=kTRUE)=0
TArrayD fTsumwx2
Definition: THnBase.h:52
void ResetBase(Option_t *option="")
Clear the histogram.
Definition: THnBase.cxx:1152
virtual Long64_t GetNbins() const =0
THnBase * RebinBase(Int_t group) const
Combine the content of "group" neighboring bins into a new bin and return the resulting THnBase.
Definition: THnBase.cxx:1057
THnBase * ProjectionND(Int_t ndim, const Int_t *dim, Option_t *option="") const
Definition: THnBase.h:228
virtual Double_t GetBinContent(Long64_t bin, Int_t *idx=0) const =0
TObjArray fAxes
Definition: THnBase.h:46
void Browse(TBrowser *b)
Browse a THnSparse: create an entry (ROOT::THnSparseBrowsable) for each dimension.
Definition: THnBase.cxx:1382
void SetBinEdges(Int_t idim, const Double_t *bins)
Set the axis # of bins and bin limits on dimension idim.
Definition: THnBase.cxx:1005
Bool_t GetCalculateErrors() const
Definition: THnBase.h:136
void AddInternal(const THnBase *h, Double_t c, Bool_t rebinned)
Add() implementation for both rebinned histograms and those with identical binning.
Definition: THnBase.cxx:635
virtual void SetBinContent(Long64_t bin, Double_t v)=0
Double_t GetBinError(Long64_t linidx) const
Definition: THnBase.h:161
Double_t GetBinContent(const Int_t *idx) const
Definition: THnBase.h:168
virtual Long64_t GetBin(const Double_t *x, Bool_t=kTRUE)=0
void PrintEntries(Long64_t from=0, Long64_t howmany=-1, Option_t *options=0) const
Print "howmany" entries starting at "from".
Definition: THnBase.cxx:1285
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,...
Definition: THnBase.cxx:696
Double_t fTsumw2
Definition: THnBase.h:50
virtual void Reserve(Long64_t)
Definition: THnBase.h:99
virtual ~THnBase()
Destruct a THnBase.
Definition: THnBase.cxx:69
THnBase()
Definition: THnBase.h:65
Double_t GetEntries() const
Definition: THnBase.h:133
virtual Long64_t GetBin(const char *name[]) const =0
virtual Double_t GetBinError2(Long64_t linidx) const =0
virtual void Reset(Option_t *option="")=0
Bool_t IsFolder() const
Returns kTRUE in case object contains browsable objects (like containers or lists of other objects).
Definition: THnBase.h:258
void SetBinContent(const Int_t *idx, Double_t v)
Definition: THnBase.h:178
virtual void FillBin(Long64_t bin, Double_t w)=0
virtual Long64_t GetBin(const Double_t *x) const =0
void UpdateXStat(const Double_t *x, Double_t w=1.)
Definition: THnBase.h:73
void Multiply(const THnBase *h)
Multiply this histogram by histogram h this = this * h Note that if h has Sumw2 set,...
Definition: THnBase.cxx:757
void Divide(const THnBase *h)
Divide this histogram by h this = this/(h) Note that if h has Sumw2 set, Sumw2 is automatically calle...
Definition: THnBase.cxx:848
Long64_t Fill(const char *name[], Double_t w=1.)
Definition: THnBase.h:150
Double_t GetSumwx2(Int_t dim) const
Definition: THnBase.h:187
Double_t GetWeightSum() const
Definition: THnBase.h:134
TObjArray fBrowsables
Definition: THnBase.h:47
void Print(Option_t *option="") const
Print a THnBase.
Definition: THnBase.cxx:1335
Double_t GetSumw() const
Definition: THnBase.h:184
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 !...
Definition: THnBase.cxx:455
void GetRandom(Double_t *rand, Bool_t subBinRandom=kTRUE)
Generate an n-dimensional random tuple based on the histogrammed distribution.
Definition: THnBase.cxx:394
TAxis * GetAxis(Int_t dim) const
Definition: THnBase.h:125
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 ...
Definition: THnBase.cxx:80
Long64_t Merge(TCollection *list)
Merge this with a list of THnBase's.
Definition: THnBase.cxx:722
Double_t fTsumw
Definition: THnBase.h:49
THnBase & operator=(const THnBase &)
@ kInvalidInt
Definition: THnBase.h:57
@ kNoInt
Definition: THnBase.h:55
@ kValidInt
Definition: THnBase.h:56
virtual Long64_t GetBin(const Int_t *idx) const =0
Double_t ComputeIntegral()
Calculate the integral of the histogram.
Definition: THnBase.cxx:1166
Double_t * fIntegral
Definition: THnBase.h:53
virtual void AddBinError2(Long64_t bin, Double_t e2)=0
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,...
Definition: THnBase.cxx:712
void SetTitle(const char *title)
Change (i.e.
Definition: THnBase.cxx:1021
void SetBinError(Long64_t bin, Double_t e)
Definition: THnBase.h:163
void CalculateErrors(Bool_t calc=kTRUE)
Calculate errors (or not if "calc" == kFALSE)
Definition: THnBase.h:139
Int_t fNdimensions
Definition: THnBase.h:45
TH2D * Projection(Int_t yDim, Int_t xDim, Option_t *option="") const
Project all bins into a 2-dimensional histogram, keeping only axes "xDim" and "yDim".
Definition: THnBase.h:210
void Init(const char *name, const char *title, const TObjArray *axes, Bool_t keepTargetAxis, Int_t chunkSize=1024 *16)
Initialize axes and name.
Definition: THnBase.cxx:96
void FillBinBase(Double_t w)
Increment the statistics due to filled weight "w",.
Definition: THnBase.h:84
TArrayD fTsumwx
Definition: THnBase.h:51
THnBase(const THnBase &)
status of integral
Iterator over THnBase bins.
Definition: THnBase.h:303
Long64_t Next(Int_t *coord=0)
Return the next bin's index.
Definition: THnBase.h:313
Bool_t HaveSkippedBin() const
Definition: THnBase.h:318
THnIter(const THnBase *hist, Bool_t respectAxisRange=kFALSE)
Definition: THnBase.h:305
Int_t GetCoord(Int_t dim) const
Definition: THnBase.h:317
virtual ~THnIter()
Definition: THnBase.cxx:1417
ROOT::Internal::THnBaseBinIter * fIter
Definition: THnBase.h:322
Bool_t RespectsAxisRange() const
Definition: THnBase.h:319
A doubly linked list.
Definition: TList.h:44
The TNamed class is the base class for all named ROOT classes.
Definition: TNamed.h:29
An array of TObjects.
Definition: TObjArray.h:37
Mother of all ROOT objects.
Definition: TObject.h:37
return c1
Definition: legend1.C:41
Double_t x[n]
Definition: legend1.C:17
TH1F * h1
Definition: legend1.C:5
TF1 * f1
Definition: legend1.C:11
return c2
Definition: legend2.C:14
Namespace for new ROOT classes and functions.
Definition: StringConv.hxx:21
Double_t Sqrt(Double_t x)
Definition: TMath.h:679