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