template<unsigned int ND,
atomicity Atomicity, typename Arithmetic, const char * Type, template<
atomicity, typename, typename, typename > typename Accumulator, typename AxisTupleType>
class Gaudi::Accumulators::HistogramingCounterBase< ND, Atomicity, Arithmetic, Type, Accumulator, AxisTupleType >
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, an Axis is associated. Axis can be of any type depending on the underlying accumulator
- the constructor expects one extra argument per axis, typically a tuple of values allowing to create the Axis objects in the back
- 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. For all predefined Histogram types, the axis type is a simple triplet of values nbins, minValue, maxValue plus a title.
Typical usage :
counter{owner, "CounterName", "HistoTitle", {{nBins1, minVal1, maxVal1}, {nBins2, minVal2, maxVal2,
"AxisTitle"}}};
wcounter{owner, "CounterName", "HistoTitle", {{nBins1, minVal1, maxVal1}, {nBins2, minVal2, maxVal2,
"AxisTitle"}}}; wcounter[{val1, val2}] += w;
syntax inherited from counters
HistogramWrapper< StaticHistogram< ND, Atomicity, Arithmetic, AxisTupleType > > Histogram
standard custom histogram. See HistogramWrapper and StaticHistogram for details
HistogramWrapper< StaticWeightedHistogram< ND, Atomicity, Arithmetic, AxisTupleType > > WeightedHistogram
custom histogram with weight. See HistogramWrapper and StaticWeightedHistogram for details
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)) for the default type of Axis
- 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 671 of file StaticHistogram.h.