The Gaudi Framework  master (594c33fa)
Gaudi::Accumulators::HistogramingCounterBaseInternal< ND, Atomicity, Arithmetic, Type, Accumulator, Seq > Class Template Reference

A base counter dealing with Histograms. More...

#include </builds/gaudi/Gaudi/GaudiKernel/include/Gaudi/Accumulators/Histogram.h>

Detailed Description

template<unsigned int ND, atomicity Atomicity, typename Arithmetic, const char * Type, template< atomicity, typename, typename > typename Accumulator, typename Seq>
class Gaudi::Accumulators::HistogramingCounterBaseInternal< ND, Atomicity, Arithmetic, Type, Accumulator, Seq >

A base counter dealing with Histograms.

Main features of that Counter :

  • can be any number of dimensions. The dimension is its first template parameter
  • for each dimension, a triplet of values have to be given at construction : nbins, minValue, maxValue. These triplets have to be embedded into braces, as the constructor takes an array of them
  • the operator+= takes either an array of values (one per dimension) or a tuple<array of values, weight>. The value inside the bin corresponding to the given values is then increased by 1 or weight
  • the prefered syntax is to avoid operator+= and use operator[] to get a buffer on the bin you're updating. Syntax becomes : ++counter[{x,y}] or wcounter[{x,y]] += w
  • the Counter is templated by the types of the values given to operator+ and also by the type stored into the bins
  • the counter can be atomic or not and supports buffering. Note that the atomicity is classical eventual consistency. So each bin is atomically updated but bins are not garanted to be coherent when reading all of them back
  • profile histograms are also supported, operator+= takes one more value in the array of values in that case

This base class is then aliases for the 4 standard cases of Histogram, WeightedHistogram, ProfileHistogram and WeightedProfileHistogram

Typical usage :

Histogram<2, double, atomicity::full>
counter{owner, "CounterName", "HistoTitle", {{nBins1, minVal1, maxVal1}, {nBins2, minVal2, maxVal2}}};
++counter[{val1, val2}]; // prefered syntax
counter += {val1, val2}; // original syntax inherited from counters
WeightedHistogram<2, double, atomicity::full>
wcounter{owner, "CounterName", "HistoTitle", {{nBins1, minVal1, maxVal1}, {nBins2, minVal2, maxVal2}}};
wcounter[{val1, val2}] += w; // prefered syntax
wcounter += {{val1, val2}, w}; // original syntax inherited from counters

When serialized to json, this counter uses new types histogram:Histogram:<prec>, histogram:ProfileHistogram:<prec>, histogram:WeightedHistogram:<prec> and histrogram:WeightedProfileHistogram:<prec> <prec> id described in Accumulators.h and decribes here the precision of the bin data. All these types have the same fields, namely : dimension(integer), title(string), empty(bool), nEntries(integer), axis(array), bins(array) where :

  • axis is an array of tuples, one per dimension, with content (nBins(integer), minValue(number), maxValue(number), title(string))
  • bins is an array of values
    • The length of the array is the product of (nBins+2) for all axis
    • the +2 is because the bin 0 is the one for values below minValue and bin nBins+1 is the one for values above maxValue bins are stored row first so we iterate first on highest dimension
    • the value is a number for non profile histograms
    • the value is of the form ( (nEntries(integer), sum(number) ), sum2(number) ) for profile histograms Note the pair with a pair as first entry

Definition at line 464 of file Histogram.h.


The documentation for this class was generated from the following file:
plotSpeedupsPyRoot.counter
counter
Definition: plotSpeedupsPyRoot.py:175