Logo ROOT   6.14/05
Reference Guide
THistData.hxx
Go to the documentation of this file.
1 /// \file ROOT/THistData.h
2 /// \ingroup Hist ROOT7
3 /// \author Axel Naumann <axel@cern.ch>
4 /// \date 2015-06-14
5 /// \warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback
6 /// is welcome!
7 
8 /*************************************************************************
9  * Copyright (C) 1995-2015, Rene Brun and Fons Rademakers. *
10  * All rights reserved. *
11  * *
12  * For the licensing terms see $ROOTSYS/LICENSE. *
13  * For the list of contributors see $ROOTSYS/README/CREDITS. *
14  *************************************************************************/
15 
16 #ifndef ROOT7_THistData_h
17 #define ROOT7_THistData_h
18 
19 #include <cmath>
20 #include <vector>
21 #include "ROOT/RSpan.hxx"
22 #include "ROOT/THistUtils.hxx"
23 
24 namespace ROOT {
25 namespace Experimental {
26 
27 template <int DIMENSIONS, class PRECISION,
28  template <int D_, class P_, template <class P__> class STORAGE> class... STAT>
29 class THist;
30 
31 /**
32  \class THistStatContent
33  Basic histogram statistics, keeping track of the bin content and the total
34  number of calls to Fill().
35  */
36 template <int DIMENSIONS, class PRECISION, template <class PRECISION_> class STORAGE>
38 public:
39  /// The type of a (possibly multi-dimensional) coordinate.
41  /// The type of the weight and the bin content.
43  /// Type of the bin content array.
44  using Content_t = STORAGE<PRECISION>;
45 
46  /**
47  \class TConstBinStat
48  Const view on a THistStatContent for a given bin.
49  */
50  class TConstBinStat {
51  public:
52  TConstBinStat(const THistStatContent &stat, int index): fContent(stat.GetBinContent(index)) {}
53  PRECISION GetContent() const { return fContent; }
54 
55  private:
56  PRECISION fContent; ///< The content of this bin.
57  };
58 
59  /**
60  \class TBinStat
61  Modifying view on a THistStatContent for a given bin.
62  */
63  class TBinStat {
64  public:
65  TBinStat(THistStatContent &stat, int index): fContent(stat.GetBinContent(index)) {}
66  PRECISION &GetContent() const { return fContent; }
67 
68  private:
69  PRECISION &fContent; ///< The content of this bin.
70  };
71 
74 
75 private:
76  /// Number of calls to Fill().
77  int64_t fEntries = 0;
78 
79  /// Bin content.
81 
82 public:
83  THistStatContent() = default;
84  THistStatContent(size_t in_size): fBinContent(in_size) {}
85 
86  /// Add weight to the bin content at binidx.
87  void Fill(const CoordArray_t & /*x*/, int binidx, Weight_t weight = 1.)
88  {
89  fBinContent[binidx] += weight;
90  ++fEntries;
91  }
92 
93  /// Get the number of entries filled into the histogram - i.e. the number of
94  /// calls to Fill().
95  int64_t GetEntries() const { return fEntries; }
96 
97  /// Get the number of bins.
98  size_t size() const noexcept { return fBinContent.size(); }
99 
100  /// Get the bin content for the given bin.
101  Weight_t operator[](int idx) const { return fBinContent[idx]; }
102  /// Get the bin content for the given bin (non-const).
103  Weight_t &operator[](int idx) { return fBinContent[idx]; }
104 
105  /// Get the bin content for the given bin.
106  Weight_t GetBinContent(int idx) const { return fBinContent[idx]; }
107  /// Get the bin content for the given bin (non-const).
108  Weight_t &GetBinContent(int idx) { return fBinContent[idx]; }
109 
110  /// Retrieve the content array.
111  const Content_t &GetContentArray() const { return fBinContent; }
112  /// Retrieve the content array (non-const).
114 };
115 
116 /**
117  \class THistStatTotalSumOfWeights
118  Keeps track of the histogram's total sum of weights.
119  */
120 template <int DIMENSIONS, class PRECISION, template <class P_> class STORAGE>
122 public:
123  /// The type of a (possibly multi-dimensional) coordinate.
125  /// The type of the weight and the bin content.
127 
128  /**
129  \class TBinStat
130  No-op; this class does not provide per-bin statistics.
131  */
132  class TBinStat {
133  public:
135  };
136 
139 
140 private:
141  /// Sum of weights.
142  PRECISION fSumWeights = 0;
143 
144 public:
145  THistStatTotalSumOfWeights() = default;
147 
148  /// Add weight to the bin content at binidx.
149  void Fill(const CoordArray_t & /*x*/, int, Weight_t weight = 1.) { fSumWeights += weight; }
150 
151  /// Get the sum of weights.
152  Weight_t GetSumOfWeights() const { return fSumWeights; }
153 };
154 
155 /**
156  \class THistStatTotalSumOfSquaredWeights
157  Keeps track of the histogram's total sum of squared weights.
158  */
159 template <int DIMENSIONS, class PRECISION, template <class P_> class STORAGE>
161 public:
162  /// The type of a (possibly multi-dimensional) coordinate.
164  /// The type of the weight and the bin content.
166 
167  /**
168  \class TBinStat
169  No-op; this class does not provide per-bin statistics.
170  */
171  class TBinStat {
172  public:
174  };
175 
178 
179 private:
180  /// Sum of (weights^2).
181  PRECISION fSumWeights2 = 0;
182 
183 public:
186 
187  /// Add weight to the bin content at binidx.
188  void Fill(const CoordArray_t & /*x*/, int /*binidx*/, Weight_t weight = 1.) { fSumWeights2 += weight * weight; }
189 
190  /// Get the sum of weights.
191  Weight_t GetSumOfSquaredWeights() const { return fSumWeights2; }
192 };
193 
194 /**
195  \class THistStatUncertainty
196  Histogram statistics to keep track of the Poisson uncertainty per bin.
197  */
198 template <int DIMENSIONS, class PRECISION, template <class P_> class STORAGE>
200 
201 public:
202  /// The type of a (possibly multi-dimensional) coordinate.
204  /// The type of the weight and the bin content.
206  /// Type of the bin content array.
207  using Content_t = STORAGE<PRECISION>;
208 
209  /**
210  \class TConstBinStat
211  Const view on a THistStatUncertainty for a given bin.
212  */
214  public:
215  TConstBinStat(const THistStatUncertainty &stat, int index): fSumW2(stat.GetSumOfSquaredWeights(index)) {}
216  PRECISION GetSumW2() const { return fSumW2; }
217 
218  double GetUncertaintyImpl() const { return std::sqrt(std::abs(fSumW2)); }
219 
220  private:
221  PRECISION fSumW2; ///< The bin's sum of square of weights.
222  };
223 
224  /**
225  \class TBinStat
226  Modifying view on a THistStatUncertainty for a given bin.
227  */
228  class TBinStat {
229  public:
230  TBinStat(THistStatUncertainty &stat, int index): fSumW2(stat.GetSumOfSquaredWeights(index)) {}
231  PRECISION &GetSumW2() const { return fSumW2; }
232  // Can never modify this. Set GetSumW2() instead.
233  double GetUncertaintyImpl() const { return std::sqrt(std::abs(fSumW2)); }
234 
235  private:
236  PRECISION &fSumW2; ///< The bin's sum of square of weights.
237  };
238 
241 
242 private:
243  /// Uncertainty of the content for each bin.
244  Content_t fSumWeightsSquared; ///< Sum of squared weights
245 
246 public:
247  THistStatUncertainty() = default;
248  THistStatUncertainty(size_t size): fSumWeightsSquared(size) {}
249 
250  /// Add weight to the bin at binidx; the coordinate was x.
251  void Fill(const CoordArray_t & /*x*/, int binidx, Weight_t weight = 1.)
252  {
253  fSumWeightsSquared[binidx] += weight * weight;
254  }
255 
256  /// Calculate a bin's (Poisson) uncertainty of the bin content as the
257  /// square-root of the bin's sum of squared weights.
258  double GetBinUncertaintyImpl(int binidx) const { return std::sqrt(fSumWeightsSquared[binidx]); }
259 
260  /// Get a bin's sum of squared weights.
261  Weight_t GetSumOfSquaredWeights(int binidx) const { return fSumWeightsSquared[binidx]; }
262 
263  /// Get a bin's sum of squared weights.
264  Weight_t &GetSumOfSquaredWeights(int binidx) { return fSumWeightsSquared[binidx]; }
265 
266  /// Get the structure holding the sum of squares of weights.
267  const std::vector<double> &GetSumOfSquaredWeights() const { return fSumWeightsSquared; }
268  /// Get the structure holding the sum of squares of weights (non-const).
269  std::vector<double> &GetSumOfSquaredWeights() { return fSumWeightsSquared; }
270 };
271 
272 /** \class THistDataMomentUncert
273  For now do as TH1: calculate first (xw) and second (x^2w) moment.
274 */
275 template <int DIMENSIONS, class PRECISION, template <class P_> class STORAGE>
277 public:
278  /// The type of a (possibly multi-dimensional) coordinate.
280  /// The type of the weight and the bin content.
282  /// Type of the bin content array.
283  using Content_t = STORAGE<PRECISION>;
284 
285  /**
286  \class TBinStat
287  No-op; this class does not provide per-bin statistics.
288  */
289  class TBinStat {
290  public:
292  };
293 
296 
297 private:
298  std::array<Weight_t, DIMENSIONS> fMomentXW;
299  std::array<Weight_t, DIMENSIONS> fMomentX2W;
300 
301 public:
302  THistDataMomentUncert() = default;
304 
305  /// Add weight to the bin at binidx; the coordinate was x.
306  void Fill(const CoordArray_t &x, int /*binidx*/, Weight_t weight = 1.)
307  {
308  for (int idim = 0; idim < DIMENSIONS; ++idim) {
309  const PRECISION xw = x[idim] * weight;
310  fMomentXW[idim] += xw;
311  fMomentX2W[idim] += x[idim] * xw;
312  }
313  }
314 };
315 
316 /** \class THistStatRuntime
317  Interface implementing a pure virtual functions DoFill(), DoFillN().
318  */
319 template <int DIMENSIONS, class PRECISION, template <class P_> class STORAGE>
321 public:
322  /// The type of a (possibly multi-dimensional) coordinate.
324  /// The type of the weight and the bin content.
326  /// Type of the bin content array.
327  using Content_t = STORAGE<PRECISION>;
328 
329  /**
330  \class TBinStat
331  No-op; this class does not provide per-bin statistics.
332  */
333  class TBinStat {
334  public:
335  TBinStat(const THistStatRuntime &, int) {}
336  };
337 
340 
341  THistStatRuntime() = default;
342  THistStatRuntime(size_t) {}
343  virtual ~THistStatRuntime() = default;
344 
345  virtual void DoFill(const CoordArray_t &x, int binidx, Weight_t weightN) = 0;
346  void Fill(const CoordArray_t &x, int binidx, Weight_t weight = 1.) { DoFill(x, binidx, weight); }
347 };
348 
349 namespace Detail {
350 
351 /// std::vector has more template arguments; for the default storage we don't
352 /// care about them, so use-decl them away:
353 template <class PRECISION>
354 using THistDataDefaultStorage = std::vector<PRECISION>;
355 
356 /** \class THistBinStat
357  Const view on a bin's statistical data. Combines all STATs' BinStat_t views.
358  */
359 template <class DATA, class... BASES>
360 class THistBinStat: public BASES... {
361 private:
362  /// Check whether `double T::GetBinUncertaintyImpl(int)` can be called.
363  template <class T>
364  static auto HaveUncertainty(const T *This) -> decltype(This->GetUncertaintyImpl());
365  /// Fall-back case for check whether `double T::GetBinUncertaintyImpl(int)` can be called.
366  template <class T>
367  static char HaveUncertainty(...);
368 
369 public:
370  THistBinStat(DATA &data, int index): BASES(data, index)... {}
371 
372  /// Whether this provides storage for uncertainties, or whether uncertainties
373  /// are determined as poisson uncertainty of the content.
374  static constexpr bool HasBinUncertainty()
375  {
376  struct AllYourBaseAreBelongToUs: public BASES... {
377  };
378  return sizeof(HaveUncertainty<AllYourBaseAreBelongToUs>(nullptr)) == sizeof(double);
379  }
380  /// Calculate the bin content's uncertainty for the given bin, using base class information,
381  /// i.e. forwarding to a base's `GetUncertaintyImpl()`.
383  double GetUncertainty() const
384  {
385  return this->GetUncertaintyImpl();
386  }
387  /// Calculate the bin content's uncertainty for the given bin, using Poisson
388  /// statistics on the absolute bin content. Only available if no base provides
389  /// this functionality. Requires GetContent().
391  double GetUncertainty(...) const
392  {
393  auto content = this->GetContent();
394  return std::sqrt(std::fabs(content));
395  }
396 };
397 
398 /** \class THistData
399  A THistImplBase's data, provides accessors to all its statistics.
400  */
401 template <int DIMENSIONS, class PRECISION, template <class P_> class STORAGE,
402  template <int D_, class P_, template <class P__> class S_> class... STAT>
403 class THistData: public STAT<DIMENSIONS, PRECISION, STORAGE>... {
404 private:
405  /// Check whether `double T::GetBinUncertaintyImpl(int)` can be called.
406  template <class T>
407  static auto HaveUncertainty(const T *This) -> decltype(This->GetBinUncertaintyImpl(12));
408  /// Fall-back case for check whether `double T::GetBinUncertaintyImpl(int)` can be called.
409  template <class T>
410  static char HaveUncertainty(...);
411 
412 public:
413  /// Matching THist
414  using Hist_t = THist<DIMENSIONS, PRECISION, STAT...>;
415 
416  /// The type of the weight and the bin content.
418 
419  /// The type of a (possibly multi-dimensional) coordinate.
421 
422  /// The type of a non-modifying view on a bin.
423  using ConstHistBinStat_t =
425 
426  /// The type of a modifying view on a bin.
428 
429  /// Number of dimensions of the coordinates
430  static constexpr int GetNDim() noexcept { return DIMENSIONS; }
431 
432  THistData() = default;
433 
434  /// Constructor providing the number of bins (incl under, overflow) to the
435  /// base classes.
436  THistData(size_t size): STAT<DIMENSIONS, PRECISION, STORAGE>(size)... {}
437 
438  /// Fill weight at x to the bin content at binidx.
439  void Fill(const CoordArray_t &x, int binidx, Weight_t weight = 1.)
440  {
441  // Call Fill() on all base classes.
442  // This combines a couple of C++ spells:
443  // - "STAT": is a template parameter pack of template template arguments. It
444  // has multiple (or one or no) elements; each is a template name
445  // that needs to be instantiated before it can be used.
446  // - "...": template parameter pack expansion; the expression is evaluated
447  // for each STAT. The expression is
448  // (STAT<DIMENSIONS, PRECISION, STORAGE>::Fill(x, binidx, weight), 0)
449  // - "trigger_base_fill{}":
450  // initialization, provides a context in which template parameter
451  // pack expansion happens.
452  // - ", 0": because Fill() returns void it cannot be used as initializer
453  // expression. The trailing ", 0" gives it the type of the trailing
454  // comma-separated expression - int.
455  using trigger_base_fill = int[];
456  (void)trigger_base_fill{(STAT<DIMENSIONS, PRECISION, STORAGE>::Fill(x, binidx, weight), 0)...};
457  }
458 
459  /// Whether this provides storage for uncertainties, or whether uncertainties
460  /// are determined as poisson uncertainty of the content.
461  static constexpr bool HasBinUncertainty()
462  {
463  struct AllYourBaseAreBelongToUs: public STAT<DIMENSIONS, PRECISION, STORAGE>... {
464  };
465  return sizeof(HaveUncertainty<AllYourBaseAreBelongToUs>(nullptr)) == sizeof(double);
466  }
467 
468  /// Calculate the bin content's uncertainty for the given bin, using base class information,
469  /// i.e. forwarding to a base's `GetBinUncertaintyImpl(binidx)`.
471  double GetBinUncertainty(int binidx) const
472  {
473  return this->GetBinUncertaintyImpl(binidx);
474  }
475  /// Calculate the bin content's uncertainty for the given bin, using Poisson
476  /// statistics on the absolute bin content. Only available if no base provides
477  /// this functionality. Requires GetContent().
479  double GetBinUncertainty(int binidx, ...) const
480  {
481  auto content = this->GetBinContent(binidx);
482  return std::sqrt(std::fabs(content));
483  }
484 
485  /// Get a view on the statistics values of a bin.
486  ConstHistBinStat_t GetView(int idx) const { return ConstHistBinStat_t(*this, idx); }
487  /// Get a (non-const) view on the statistics values of a bin.
488  HistBinStat_t GetView(int idx) { return HistBinStat_t(*this, idx); }
489 };
490 } // namespace Detail
491 
492 } // namespace Experimental
493 } // namespace ROOT
494 #endif
No-op; this class does not provide per-bin statistics.
Definition: THistData.hxx:333
std::vector< PRECISION > THistDataDefaultStorage
std::vector has more template arguments; for the default storage we don&#39;t care about them...
Definition: THistData.hxx:354
No-op; this class does not provide per-bin statistics.
Definition: THistData.hxx:289
void Fill(const CoordArray_t &x, int, Weight_t weight=1.)
Add weight to the bin at binidx; the coordinate was x.
Definition: THistData.hxx:306
Namespace for new ROOT classes and functions.
Definition: StringConv.hxx:21
void Fill(const CoordArray_t &, int binidx, Weight_t weight=1.)
Add weight to the bin at binidx; the coordinate was x.
Definition: THistData.hxx:251
static constexpr bool HasBinUncertainty()
Whether this provides storage for uncertainties, or whether uncertainties are determined as poisson u...
Definition: THistData.hxx:461
double GetBinUncertainty(int binidx) const
Calculate the bin content&#39;s uncertainty for the given bin, using base class information, i.e.
Definition: THistData.hxx:471
std::array< Weight_t, DIMENSIONS > fMomentX2W
Definition: THistData.hxx:299
PRECISION Weight_t
The type of the weight and the bin content.
Definition: THistData.hxx:205
double T(double x)
Definition: ChebyshevPol.h:34
TBinStat(const THistDataMomentUncert &, int)
Definition: THistData.hxx:291
PRECISION fSumW2
The bin&#39;s sum of square of weights.
Definition: THistData.hxx:221
static constexpr bool HasBinUncertainty()
Whether this provides storage for uncertainties, or whether uncertainties are determined as poisson u...
Definition: THistData.hxx:374
TBinStat(THistStatContent &stat, int index)
Definition: THistData.hxx:65
Keeps track of the histogram&#39;s total sum of weights.
Definition: THistData.hxx:121
int64_t fEntries
Number of calls to Fill().
Definition: THistData.hxx:77
void Fill(const CoordArray_t &x, int binidx, Weight_t weight=1.)
Definition: THistData.hxx:346
STORAGE< PRECISION > Content_t
Type of the bin content array.
Definition: THistData.hxx:283
PRECISION Weight_t
The type of the weight and the bin content.
Definition: THistData.hxx:42
Weight_t & GetSumOfSquaredWeights(int binidx)
Get a bin&#39;s sum of squared weights.
Definition: THistData.hxx:264
TBinStat(THistStatUncertainty &stat, int index)
Definition: THistData.hxx:230
Modifying view on a THistStatUncertainty for a given bin.
Definition: THistData.hxx:228
static constexpr int GetNDim() noexcept
Number of dimensions of the coordinates.
Definition: THistData.hxx:430
const Content_t & GetContentArray() const
Retrieve the content array.
Definition: THistData.hxx:111
std::array< Weight_t, DIMENSIONS > fMomentXW
Definition: THistData.hxx:298
double sqrt(double)
PRECISION Weight_t
The type of the weight and the bin content.
Definition: THistData.hxx:417
STORAGE< PRECISION > Content_t
Type of the bin content array.
Definition: THistData.hxx:207
Double_t x[n]
Definition: legend1.C:17
#define PRECISION
Definition: MnPrint.cxx:26
PRECISION fContent
The content of this bin.
Definition: THistData.hxx:56
Interface implementing a pure virtual functions DoFill(), DoFillN().
Definition: THistData.hxx:320
HistBinStat_t GetView(int idx)
Get a (non-const) view on the statistics values of a bin.
Definition: THistData.hxx:488
Weight_t GetSumOfSquaredWeights() const
Get the sum of weights.
Definition: THistData.hxx:191
STORAGE< PRECISION > Content_t
Type of the bin content array.
Definition: THistData.hxx:327
size_t size() const noexcept
Get the number of bins.
Definition: THistData.hxx:98
Weight_t GetBinContent(int idx) const
Get the bin content for the given bin.
Definition: THistData.hxx:106
PRECISION Weight_t
The type of the weight and the bin content.
Definition: THistData.hxx:126
Weight_t operator[](int idx) const
Get the bin content for the given bin.
Definition: THistData.hxx:101
double GetUncertainty() const
Calculate the bin content&#39;s uncertainty for the given bin, using base class information, i.e.
Definition: THistData.hxx:383
double GetBinUncertainty(int binidx,...) const
Calculate the bin content&#39;s uncertainty for the given bin, using Poisson statistics on the absolute b...
Definition: THistData.hxx:479
VecExpr< UnaryOp< Fabs< T >, VecExpr< A, T, D >, T >, T, D > fabs(const VecExpr< A, T, D > &rhs)
void Fill(const CoordArray_t &, int, Weight_t weight=1.)
Add weight to the bin content at binidx.
Definition: THistData.hxx:149
TBinStat(const THistStatTotalSumOfWeights &, int)
Definition: THistData.hxx:134
PRECISION Weight_t
The type of the weight and the bin content.
Definition: THistData.hxx:325
Weight_t GetSumOfSquaredWeights(int binidx) const
Get a bin&#39;s sum of squared weights.
Definition: THistData.hxx:261
A THistImplBase&#39;s data, provides accessors to all its statistics.
Definition: THistData.hxx:403
Weight_t & GetBinContent(int idx)
Get the bin content for the given bin (non-const).
Definition: THistData.hxx:108
PRECISION & fContent
The content of this bin.
Definition: THistData.hxx:69
double GetBinUncertaintyImpl(int binidx) const
Calculate a bin&#39;s (Poisson) uncertainty of the bin content as the square-root of the bin&#39;s sum of squ...
Definition: THistData.hxx:258
TConstBinStat(const THistStatUncertainty &stat, int index)
Definition: THistData.hxx:215
void Fill(const CoordArray_t &, int binidx, Weight_t weight=1.)
Add weight to the bin content at binidx.
Definition: THistData.hxx:87
const std::vector< double > & GetSumOfSquaredWeights() const
Get the structure holding the sum of squares of weights.
Definition: THistData.hxx:267
int64_t GetEntries() const
Get the number of entries filled into the histogram - i.e.
Definition: THistData.hxx:95
Histogram class for histograms with DIMENSIONS dimensions, where each bin count is stored by a value ...
Definition: THist.hxx:33
PRECISION & fSumW2
The bin&#39;s sum of square of weights.
Definition: THistData.hxx:236
TBinStat(const THistStatTotalSumOfSquaredWeights &, int)
Definition: THistData.hxx:173
No-op; this class does not provide per-bin statistics.
Definition: THistData.hxx:171
Const view on a bin&#39;s statistical data.
Definition: THistData.hxx:360
Const view on a THistStatContent for a given bin.
Definition: THistData.hxx:50
TConstBinStat(const THistStatContent &stat, int index)
Definition: THistData.hxx:52
Weight_t & operator[](int idx)
Get the bin content for the given bin (non-const).
Definition: THistData.hxx:103
void Fill(const CoordArray_t &, int, Weight_t weight=1.)
Add weight to the bin content at binidx.
Definition: THistData.hxx:188
int type
Definition: TGX11.cxx:120
void Fill(const CoordArray_t &x, int binidx, Weight_t weight=1.)
Fill weight at x to the bin content at binidx.
Definition: THistData.hxx:439
std::vector< double > & GetSumOfSquaredWeights()
Get the structure holding the sum of squares of weights (non-const).
Definition: THistData.hxx:269
No-op; this class does not provide per-bin statistics.
Definition: THistData.hxx:132
typedef void((*Func_t)())
Histogram statistics to keep track of the Poisson uncertainty per bin.
Definition: THistData.hxx:199
Content_t fSumWeightsSquared
Uncertainty of the content for each bin.
Definition: THistData.hxx:244
Basic histogram statistics, keeping track of the bin content and the total number of calls to Fill()...
Definition: THistData.hxx:37
TBinStat(const THistStatRuntime &, int)
Definition: THistData.hxx:335
STORAGE< PRECISION > Content_t
Type of the bin content array.
Definition: THistData.hxx:44
Modifying view on a THistStatContent for a given bin.
Definition: THistData.hxx:63
PRECISION Weight_t
The type of the weight and the bin content.
Definition: THistData.hxx:165
Content_t fBinContent
Bin content.
Definition: THistData.hxx:80
For now do as TH1: calculate first (xw) and second (x^2w) moment.
Definition: THistData.hxx:276
double GetUncertainty(...) const
Calculate the bin content&#39;s uncertainty for the given bin, using Poisson statistics on the absolute b...
Definition: THistData.hxx:391
Content_t & GetContentArray()
Retrieve the content array (non-const).
Definition: THistData.hxx:113
PRECISION Weight_t
The type of the weight and the bin content.
Definition: THistData.hxx:281
Weight_t GetSumOfWeights() const
Get the sum of weights.
Definition: THistData.hxx:152
Const view on a THistStatUncertainty for a given bin.
Definition: THistData.hxx:213
THistData(size_t size)
Constructor providing the number of bins (incl under, overflow) to the base classes.
Definition: THistData.hxx:436
Keeps track of the histogram&#39;s total sum of squared weights.
Definition: THistData.hxx:160
ConstHistBinStat_t GetView(int idx) const
Get a view on the statistics values of a bin.
Definition: THistData.hxx:486