The Gaudi Framework  v36r5 (befafb8a)
Histogram.h
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2021 CERN for the benefit of the LHCb and ATLAS collaborations *
3 * *
4 * This software is distributed under the terms of the Apache version 2 licence, *
5 * copied verbatim in the file "LICENSE". *
6 * *
7 * In applying this licence, CERN does not waive the privileges and immunities *
8 * granted to it by virtue of its status as an Intergovernmental Organization *
9 * or submit itself to any jurisdiction. *
10 \***********************************************************************************/
11 #pragma once
12 
13 #include <Gaudi/Accumulators.h>
14 #include <Gaudi/MonitoringHub.h>
15 #include <ROOT/RHist.hxx>
16 
17 #include <boost/format.hpp>
18 #include <boost/histogram/algorithm/sum.hpp>
19 #include <boost/histogram/fwd.hpp>
20 #include <gsl/span>
21 
22 #include <nlohmann/json.hpp>
23 
24 #include <array>
25 #include <cmath>
26 #include <string>
27 #include <type_traits>
28 #include <utility>
29 #include <vector>
30 
31 namespace {
32  template <std::size_t, typename T>
33  using alwaysT = T;
34  // get a tuple of n types the given Type, or directly the type for n = 1
35  template <typename Type, unsigned int ND>
36  struct GetTuple;
37  template <typename Type, unsigned int ND>
38  using GetTuple_t = typename GetTuple<Type, ND>::type;
39  template <typename Type, unsigned int ND>
40  struct GetTuple {
41  using type =
42  decltype( std::tuple_cat( std::declval<std::tuple<Type>>(), std::declval<GetTuple_t<Type, ND - 1>>() ) );
43  };
44  template <typename Type>
45  struct GetTuple<Type, 1> {
46  using type = std::tuple<Type>;
47  };
48 } // namespace
49 
50 namespace Gaudi::Accumulators {
51 
55  struct ExtractWeight {
56  template <typename Arithmetic>
57  constexpr decltype( auto ) operator()( const std::pair<Arithmetic, Arithmetic>& v ) const noexcept {
58  return v.second;
59  }
60  };
61 
65  struct WeightedProduct {
66  template <typename Arithmetic>
67  constexpr decltype( auto ) operator()( const std::pair<Arithmetic, Arithmetic>& v ) const noexcept {
68  return v.first * v.second;
69  }
70  };
71 
75  struct WeightedSquare {
76  template <typename Arithmetic>
77  constexpr decltype( auto ) operator()( const std::pair<Arithmetic, Arithmetic>& v ) const noexcept {
78  return v.first * v.first * v.second;
79  }
80  };
81 
88  template <atomicity Atomicity, typename Arithmetic>
90  : GenericAccumulator<std::pair<Arithmetic, Arithmetic>, Arithmetic, Atomicity, ExtractWeight> {
92  using Base::Base;
93  using Base::operator+=;
95  WeightedCountAccumulator operator+=( const Arithmetic weight ) {
96  *this += { Arithmetic{}, weight };
97  return *this;
98  }
99  Arithmetic nEntries() const { return this->value(); }
100  };
101 
108  template <atomicity Atomicity, typename Arithmetic>
110  : GenericAccumulator<std::pair<Arithmetic, Arithmetic>, Arithmetic, Atomicity, WeightedProduct> {
111  using GenericAccumulator<std::pair<Arithmetic, Arithmetic>, Arithmetic, Atomicity,
113  Arithmetic sum() const { return this->value(); }
114  };
115 
121  template <atomicity Atomicity, typename Arithmetic = double>
123  : GenericAccumulator<std::pair<Arithmetic, Arithmetic>, Arithmetic, Atomicity, WeightedSquare> {
124  using GenericAccumulator<std::pair<Arithmetic, Arithmetic>, Arithmetic, Atomicity,
126  Arithmetic sum2() const { return this->value(); };
127  };
128 
134  template <atomicity Atomicity, typename Arithmetic>
137 
143  template <atomicity Atomicity, typename Arithmetic>
146 
150  template <typename Arithmetic>
151  struct Axis {
152  Axis( unsigned int _nBins, Arithmetic _minValue, Arithmetic _maxValue, std::string _title = {},
153  std::vector<std::string> _labels = {} )
154  : nBins( _nBins )
155  , minValue( _minValue )
156  , maxValue( _maxValue )
157  , title( std::move( _title ) )
158  , labels( std::move( _labels ) )
159  , ratio( _nBins / ( _maxValue - _minValue ) ){};
161  unsigned int nBins;
163  Arithmetic minValue, maxValue;
172  Arithmetic ratio;
173 
175  unsigned int index( Arithmetic value ) const {
176  int idx = std::floor( ( value - minValue ) * ratio ) + 1;
177  return idx < 0 ? 0 : ( (unsigned int)idx > nBins ? nBins + 1 : (unsigned int)idx );
178  }
179  };
180 
182  template <typename Arithmetic>
183  void to_json( nlohmann::json& j, const Axis<Arithmetic>& axis ) {
184  j = nlohmann::json{ { "nBins", axis.nBins },
185  { "minValue", axis.minValue },
186  { "maxValue", axis.maxValue },
187  { "title", axis.title } };
188  if ( !axis.labels.empty() ) { j["labels"] = axis.labels; }
189  }
190 
192  template <typename Arithmetic, unsigned int ND, unsigned int NIndex = ND>
193  struct HistoInputType : std::array<Arithmetic, ND> {
194  // allow construction from set of values
195  template <class... ARGS>
196  HistoInputType( ARGS... args ) : std::array<Arithmetic, ND>{ static_cast<Arithmetic>( args )... } {}
197  // The change on NIndex == 1 allow to have simpler syntax in that case, that is no tuple of one item
199  using AxisArithmeticType = Arithmetic;
200  unsigned int computeIndex( const std::array<Axis<Arithmetic>, NIndex>& axis ) const {
201  unsigned int index = 0;
202  for ( unsigned int j = 0; j < NIndex; j++ ) {
203  unsigned int dim = NIndex - j - 1;
204  // compute local index for a given dimension
205  int localIndex = axis[dim].index( ( *this )[dim] );
206  // compute global index. Bins are stored in a column first manner
207  index *= ( axis[dim].nBins + 2 );
208  index += localIndex;
209  }
210  return index;
211  }
212  auto forInternalCounter() { return this->operator[]( ND - 1 ); }
213  };
214 
217  template <typename Arithmetic>
218  class HistoInputType<Arithmetic, 1> {
219  public:
221  using AxisArithmeticType = Arithmetic;
222  HistoInputType( Arithmetic a ) : value( a ) {}
223  unsigned int computeIndex( const std::array<Axis<Arithmetic>, 1>& axis ) const { return axis[0].index( value ); }
224  Arithmetic& operator[]( int ) { return value; }
225  operator Arithmetic() const { return value; }
226  auto forInternalCounter() { return value; }
227 
228  private:
229  Arithmetic value;
230  };
231 
233  template <typename Arithmetic, unsigned int ND, unsigned int NIndex = ND>
234  struct WeightedHistoInputType : std::pair<HistoInputType<Arithmetic, ND, NIndex>, Arithmetic> {
235  // The change on NIndex == 1 allow to have simpler syntax in that case, that is no tuple of one item
237  using AxisArithmeticType = Arithmetic;
239  unsigned int computeIndex( const std::array<Axis<Arithmetic>, NIndex>& axis ) const {
240  return this->first.computeIndex( axis );
241  }
242  auto forInternalCounter() { return std::pair( this->first.forInternalCounter(), this->second ); }
243  };
244 
259  template <atomicity Atomicity, typename InputType, typename Arithmetic, typename ND,
260  template <atomicity Ato, typename Arith> typename BaseAccumulatorT>
262  template <atomicity, typename, typename, typename, template <atomicity, typename> typename>
264 
265  public:
266  using BaseAccumulator = BaseAccumulatorT<Atomicity, Arithmetic>;
267  using AxisArithmeticType = typename InputType::AxisArithmeticType;
268  template <std::size_t... Is>
269  HistogramingAccumulatorInternal( GetTuple_t<Axis<AxisArithmeticType>, ND::value> axis, std::index_sequence<Is...> )
270  : m_axis{ std::get<Is>( axis )... }
273  reset();
274  }
275  template <atomicity ato>
280  reset();
281  }
283  accumulator( v.computeIndex( m_axis ) ) += v.forInternalCounter();
284  return *this;
285  }
286  void reset() {
287  for ( unsigned int index = 0; index < m_totNBins; index++ ) accumulator( index ).reset();
288  }
289  template <atomicity ato>
291  assert( m_totNBins == other.m_totNBins );
292  for ( unsigned int index = 0; index < m_totNBins; index++ ) {
293  accumulator( index ).mergeAndReset( std::move( other.accumulator( index ) ) );
294  }
295  }
296  auto operator[]( typename InputType::ValueType v ) {
298  }
299 
300  protected:
301  auto& axis() const { return m_axis; }
302  auto nBins( unsigned int i ) const { return m_axis[i].nBins; }
303  auto minValue( unsigned int i ) const { return m_axis[i].minValue; }
304  auto maxValue( unsigned int i ) const { return m_axis[i].maxValue; }
305  auto binValue( unsigned int i ) const { return accumulator( i ).value(); }
306  auto nEntries( unsigned int i ) const { return accumulator( i ).nEntries(); }
307  auto totNBins() const { return m_totNBins; }
308 
309  private:
310  BaseAccumulator& accumulator( unsigned int index ) const {
311  assert( index < m_totNBins );
312  return m_value[index];
313  }
314  unsigned int computeTotNBins() const {
315  unsigned int nTotBins = 1;
316  for ( unsigned int i = 0; i < ND::value; i++ ) { nTotBins *= ( m_axis[i].nBins + 2 ); }
317  return nTotBins;
318  }
322  unsigned int m_totNBins;
325  };
326 
332  template <atomicity Atomicity, typename Arithmetic, typename ND>
334  unsigned long, ND, IntegralAccumulator>;
335 
341  template <atomicity Atomicity, typename Arithmetic, typename ND>
345 
351  template <atomicity Atomicity, typename Arithmetic, typename ND>
355 
361  template <atomicity Atomicity, typename Arithmetic, typename ND>
364  Arithmetic, ND, WeightedSigmaAccumulator>;
365 
419  template <unsigned int ND, atomicity Atomicity, typename Arithmetic, const char* Type,
420  template <atomicity, typename, typename> typename Accumulator, typename Seq>
422  template <unsigned int ND, atomicity Atomicity, typename Arithmetic, const char* Type,
423  template <atomicity, typename, typename> typename Accumulator, std::size_t... NDs>
424  class HistogramingCounterBaseInternal<ND, Atomicity, Arithmetic, Type, Accumulator, std::index_sequence<NDs...>>
425  : public BufferableCounter<Atomicity, Accumulator, Arithmetic, std::integral_constant<int, ND>> {
426  public:
428  template <typename OWNER>
429  HistogramingCounterBaseInternal( OWNER* owner, std::string const& name, std::string const& title,
430  GetTuple_t<Axis<Arithmetic>, ND> axis )
431  : Parent( owner, name, std::string( Type ) + ":" + typeid( Arithmetic ).name(), axis,
432  std::make_index_sequence<ND>{} )
433  , m_title( title ) {}
434  template <typename OWNER>
435  HistogramingCounterBaseInternal( OWNER* owner, std::string const& name, std::string const& title,
436  alwaysT<NDs, Axis<Arithmetic>>... allAxis )
437  : HistogramingCounterBaseInternal( owner, name, title, std::make_tuple( allAxis... ) ) {}
438  using Parent::print;
439  template <typename stream>
440  stream& printImpl( stream& o, bool /*tableFormat*/ ) const {
441  o << ND << "D Histogram with config ";
442  for ( unsigned int i = 0; i < ND; i++ ) {
443  o << this->nBins( i ) << " " << this->minValue( i ) << " " << this->maxValue( i ) << " ";
444  }
445  return o;
446  }
447  std::ostream& print( std::ostream& o, bool tableFormat = false ) const override {
448  return printImpl( o, tableFormat );
449  }
450  MsgStream& print( MsgStream& o, bool tableFormat = false ) const override { return printImpl( o, tableFormat ); }
451  nlohmann::json toJSON() const override {
452  // get all bin values and compute total nbEntries
453  using Acc = Accumulator<Atomicity, Arithmetic, std::integral_constant<int, ND>>;
455  bins.reserve( this->totNBins() );
456  unsigned long totNEntries{ 0 };
457  for ( unsigned int i = 0; i < this->totNBins(); i++ ) {
458  bins.push_back( this->binValue( i ) );
459  totNEntries += this->nEntries( i );
460  }
461  // build json
462  return { { "type", std::string( Type ) + ":" + typeid( Arithmetic ).name() },
463  { "title", m_title },
464  { "dimension", ND },
465  { "empty", totNEntries == 0 },
466  { "nEntries", totNEntries },
467  { "axis", this->axis() },
468  { "bins", bins } };
469  }
470 
471  private:
473  };
474  template <unsigned int ND, atomicity Atomicity, typename Arithmetic, const char* Type,
475  template <atomicity, typename, typename> typename Accumulator>
478 
479  namespace {
480  static const char histogramString[] = "histogram:Histogram";
481  static const char weightedHistogramString[] = "histogram:WeightedHistogram";
482  static const char profilehistogramString[] = "histogram:ProfileHistogram";
483  static const char weightedProfilehistogramString[] = "histogram:WeightedProfileHistogram";
484  } // namespace
486  template <unsigned int ND, atomicity Atomicity = atomicity::full, typename Arithmetic = double>
488 
490  template <unsigned int ND, atomicity Atomicity = atomicity::full, typename Arithmetic = double>
493 
495  template <unsigned int ND, atomicity Atomicity = atomicity::full, typename Arithmetic = double>
498 
500  template <unsigned int ND, atomicity Atomicity = atomicity::full, typename Arithmetic = double>
501  using WeightedProfileHistogram = HistogramingCounterBase<ND, Atomicity, Arithmetic, weightedProfilehistogramString,
503 
504 } // namespace Gaudi::Accumulators
Gaudi::Accumulators::Axis::minValue
Arithmetic minValue
min and max values on this axis
Definition: Histogram.h:163
Gaudi::Accumulators::ExtractWeight
A functor to extract weight, take a pair (valueTuple, weight) as input.
Definition: Histogram.h:55
Gaudi::Accumulators::HistogramingAccumulatorInternal::HistogramingAccumulatorInternal
HistogramingAccumulatorInternal(GetTuple_t< Axis< AxisArithmeticType >, ND::value > axis, std::index_sequence< Is... >)
Definition: Histogram.h:269
std::floor
T floor(T... args)
Gaudi::Accumulators::HistogramingAccumulatorInternal::nBins
auto nBins(unsigned int i) const
Definition: Histogram.h:302
Gaudi::Accumulators::WeightedSquareAccumulator
WeightedSquareAccumulator.
Definition: Histogram.h:123
Write.stream
stream
Definition: Write.py:32
std::string
STL class.
GaudiPython.HistoUtils.nEntries
nEntries
Definition: HistoUtils.py:939
Gaudi::Accumulators::WeightedHistoInputType::forInternalCounter
auto forInternalCounter()
Definition: Histogram.h:242
std::move
T move(T... args)
Gaudi::Accumulators::HistogramingAccumulatorInternal::accumulator
BaseAccumulator & accumulator(unsigned int index) const
Definition: Histogram.h:310
Gaudi::Accumulators::WeightedCountAccumulator::nEntries
Arithmetic nEntries() const
Definition: Histogram.h:99
MonitoringHub.h
Gaudi::Accumulators::HistogramingAccumulatorInternal::mergeAndReset
void mergeAndReset(HistogramingAccumulatorInternal< ato, InputType, Arithmetic, ND, BaseAccumulatorT > &&other)
Definition: Histogram.h:290
std::pair
std::vector::reserve
T reserve(T... args)
Gaudi::Accumulators::HistogramingAccumulatorInternal::AxisArithmeticType
typename InputType::AxisArithmeticType AxisArithmeticType
Definition: Histogram.h:267
Gaudi::Accumulators::HistoInputType< Arithmetic, 1 >::value
Arithmetic value
Definition: Histogram.h:229
Gaudi::Accumulators::Axis::maxValue
Arithmetic maxValue
Definition: Histogram.h:163
Gaudi::Accumulators::Axis::nBins
unsigned int nBins
number of bins for this Axis
Definition: Histogram.h:159
Properties.long
long
(c) Copyright 1998-2020 CERN for the benefit of the LHCb and ATLAS collaborations # # This software i...
Definition: Properties.py:15
Gaudi::Accumulators::HistogramingAccumulatorInternal::binValue
auto binValue(unsigned int i) const
Definition: Histogram.h:305
std::vector< std::string >
Gaudi::Accumulators::IntegralAccumulator
IntegralAccumulator.
Definition: Accumulators.h:598
Gaudi::Accumulators::HistogramingCounterBaseInternal< ND, Atomicity, Arithmetic, Type, Accumulator, std::index_sequence< NDs... > >::toJSON
nlohmann::json toJSON() const override
Basic JSON export for Gaudi::Monitoring::Hub support.
Definition: Histogram.h:451
Gaudi::Accumulators::WeightedSumAccumulator::sum
Arithmetic sum() const
Definition: Histogram.h:113
std::tuple
Gaudi::Accumulators::HistogramingAccumulatorInternal::operator+=
HistogramingAccumulatorInternal & operator+=(InputType v)
Definition: Histogram.h:282
Gaudi::Accumulators::HistogramingCounterBaseInternal< ND, Atomicity, Arithmetic, Type, Accumulator, std::index_sequence< NDs... > >::HistogramingCounterBaseInternal
HistogramingCounterBaseInternal(OWNER *owner, std::string const &name, std::string const &title, alwaysT< NDs, Axis< Arithmetic >>... allAxis)
Definition: Histogram.h:435
Gaudi::Accumulators::AveragingAccumulatorBase
AveragingAccumulatorBase.
Definition: Accumulators.h:710
jsonFromLHCbLog.json
dictionary json
Definition: jsonFromLHCbLog.py:87
Gaudi::Accumulators::WeightedSumAccumulator
WeightedSumAccumulator.
Definition: Histogram.h:110
Gaudi::Accumulators::Axis
Definition of an Histogram Axis.
Definition: Histogram.h:151
Gaudi::Accumulators::HistoInputType::HistoInputType
HistoInputType(ARGS... args)
Definition: Histogram.h:196
std::vector::push_back
T push_back(T... args)
Gaudi::Accumulators::HistogramingCounterBaseInternal< ND, Atomicity, Arithmetic, Type, Accumulator, std::index_sequence< NDs... > >::printImpl
stream & printImpl(stream &o, bool) const
Definition: Histogram.h:440
Gaudi::Accumulators::HistoInputType::computeIndex
unsigned int computeIndex(const std::array< Axis< Arithmetic >, NIndex > &axis) const
Definition: Histogram.h:200
Gaudi::Accumulators::HistogramingCounterBaseInternal< ND, Atomicity, Arithmetic, Type, Accumulator, std::index_sequence< NDs... > >::print
std::ostream & print(std::ostream &o, bool tableFormat=false) const override
prints the counter to a stream
Definition: Histogram.h:447
Gaudi::Accumulators::WeightedHistoInputType::computeIndex
unsigned int computeIndex(const std::array< Axis< Arithmetic >, NIndex > &axis) const
Definition: Histogram.h:239
Gaudi::Accumulators::HistoInputType
small class used as InputType for regular Histograms
Definition: Histogram.h:193
Gaudi::Accumulators::HistoInputType< Arithmetic, 1 >::AxisArithmeticType
Arithmetic AxisArithmeticType
Definition: Histogram.h:221
TimingHistograms.name
name
Definition: TimingHistograms.py:25
Gaudi::Accumulators::HistogramingAccumulatorInternal::BaseAccumulator
BaseAccumulatorT< Atomicity, Arithmetic > BaseAccumulator
Definition: Histogram.h:266
std::ostream
STL class.
Gaudi::Accumulators::HistogramingAccumulatorInternal::totNBins
auto totNBins() const
Definition: Histogram.h:307
Gaudi::Accumulators::HistogramingAccumulatorInternal::operator[]
auto operator[](typename InputType::ValueType v)
Definition: Histogram.h:296
Gaudi::Accumulators::HistogramingCounterBaseInternal< ND, Atomicity, Arithmetic, Type, Accumulator, std::index_sequence< NDs... > >::print
MsgStream & print(MsgStream &o, bool tableFormat=false) const override
Definition: Histogram.h:450
Gaudi::Accumulators::WeightedHistoInputType
small class used as InputType for weighted Histograms
Definition: Histogram.h:234
Gaudi::Accumulators::GenericAccumulator< std::pair< Arithmetic, Arithmetic >, Arithmetic, Atomicity, WeightedProduct >::GenericAccumulator
friend class GenericAccumulator
Definition: Accumulators.h:437
std::array
STL class.
Gaudi::Accumulators::HistogramingAccumulatorInternal::maxValue
auto maxValue(unsigned int i) const
Definition: Histogram.h:304
Gaudi::Accumulators::Axis::index
unsigned int index(Arithmetic value) const
returns the bin number for a given value, ranging from 0 (underflow) to nBins+1 (overflow)
Definition: Histogram.h:175
Gaudi::Accumulators::HistogramingCounterBaseInternal< ND, Atomicity, Arithmetic, Type, Accumulator, std::index_sequence< NDs... > >::m_title
std::string const m_title
Definition: Histogram.h:472
Gaudi::Accumulators::HistoInputType::forInternalCounter
auto forInternalCounter()
Definition: Histogram.h:212
Gaudi::Accumulators::HistogramingAccumulatorInternal::axis
auto & axis() const
Definition: Histogram.h:301
Gaudi::Accumulators::HistogramingAccumulatorInternal::nEntries
auto nEntries(unsigned int i) const
Definition: Histogram.h:306
Gaudi::Accumulators::HistogramingAccumulatorInternal::reset
void reset()
Definition: Histogram.h:286
Gaudi::Accumulators::HistoInputType< Arithmetic, 1 >::forInternalCounter
auto forInternalCounter()
Definition: Histogram.h:226
Gaudi::Accumulators::GenericAccumulator
Generic Accumulator, templated by.
Definition: Accumulators.h:435
Gaudi::Accumulators::HistogramingAccumulatorInternal::minValue
auto minValue(unsigned int i) const
Definition: Histogram.h:303
MsgStream
Definition: MsgStream.h:34
Gaudi::Accumulators::HistogramingAccumulatorInternal::HistogramingAccumulatorInternal
HistogramingAccumulatorInternal(construct_empty_t, const HistogramingAccumulatorInternal< ato, InputType, Arithmetic, ND, BaseAccumulatorT > &other)
Definition: Histogram.h:276
Gaudi::Accumulators::to_json
void to_json(nlohmann::json &j, const Axis< Arithmetic > &axis)
automatic conversion of the Axis type to json
Definition: Histogram.h:183
Gaudi::Accumulators::Axis::Axis
Axis(unsigned int _nBins, Arithmetic _minValue, Arithmetic _maxValue, std::string _title={}, std::vector< std::string > _labels={})
Definition: Histogram.h:152
Gaudi::Accumulators::GenericAccumulator< std::pair< Arithmetic, Arithmetic >, Arithmetic, Atomicity, ExtractWeight >::value
OutputType value() const
Definition: Accumulators.h:461
Gaudi::Accumulators::WeightedProduct
A Product functor, take a pair (value, weight) as input.
Definition: Histogram.h:65
Gaudi::Accumulators::BufferableCounter
An empty ancester of all counters that provides a buffer method that returns a buffer on itself Also ...
Definition: Accumulators.h:869
HistoDumpEx.v
v
Definition: HistoDumpEx.py:27
Gaudi::Accumulators::HistogramingAccumulatorInternal
Internal Accumulator class dealing with Histograming.
Definition: Histogram.h:261
Accumulators.h
Gaudi::Accumulators::HistoInputType< Arithmetic, 1 >::computeIndex
unsigned int computeIndex(const std::array< Axis< Arithmetic >, 1 > &axis) const
Definition: Histogram.h:223
Gaudi::Accumulators
Definition: HistogramsTests.cpp:19
gaudirun.type
type
Definition: gaudirun.py:160
Gaudi::Accumulators::HistoInputType< Arithmetic, 1 >::HistoInputType
HistoInputType(Arithmetic a)
Definition: Histogram.h:222
Gaudi::Accumulators::HistoInputType::AxisArithmeticType
Arithmetic AxisArithmeticType
Definition: Histogram.h:199
Containers::array
struct GAUDI_API array
Parametrisation class for redirection array - like implementation.
Definition: KeyedObjectManager.h:37
gaudirun.args
args
Definition: gaudirun.py:336
Gaudi::Accumulators::HistogramingCounterBaseInternal< ND, Atomicity, Arithmetic, Type, Accumulator, std::index_sequence< NDs... > >::HistogramingCounterBaseInternal
HistogramingCounterBaseInternal(OWNER *owner, std::string const &name, std::string const &title, GetTuple_t< Axis< Arithmetic >, ND > axis)
Definition: Histogram.h:429
Gaudi::Accumulators::HistogramingAccumulatorInternal::m_value
std::unique_ptr< BaseAccumulator[]> m_value
Histogram content.
Definition: Histogram.h:324
Tuples::Type
Type
Definition: TupleObj.h:91
std
STL namespace.
Gaudi::Accumulators::WeightedSquare
A WeightedSquare functor, take a pair (value, weight) as input.
Definition: Histogram.h:75
Gaudi::Accumulators::HistogramingAccumulatorInternal::m_totNBins
unsigned int m_totNBins
total number of bins in this histogram, under and overflow included
Definition: Histogram.h:322
Gaudi::Accumulators::SigmaAccumulatorBase
SigmaAccumulatorBase.
Definition: Accumulators.h:739
Gaudi::Accumulators::Buffer
Buffer is a non atomic Accumulator which, when it goes out-of-scope, updates the underlying thread-sa...
Definition: Accumulators.h:807
Gaudi::Accumulators::atomicity
atomicity
Defines atomicity of the accumulators.
Definition: Accumulators.h:237
std::vector::empty
T empty(T... args)
Gaudi::Accumulators::Axis::ratio
Arithmetic ratio
precomputed ratio to convert a value into bin number equal to nBins/(maxValue-minValue)
Definition: Histogram.h:172
Gaudi::Accumulators::construct_empty_t
constant used to disambiguate construction of an empty Accumulator versus the copy constructor.
Definition: Accumulators.h:410
std::tuple_cat
T tuple_cat(T... args)
Gaudi::Accumulators::WeightedCountAccumulator
WeightedCountAccumulator.
Definition: Histogram.h:90
std::size_t
Gaudi::Accumulators::WeightedHistoInputType::AxisArithmeticType
Arithmetic AxisArithmeticType
Definition: Histogram.h:237
Gaudi::Accumulators::HistogramingAccumulatorInternal::m_axis
std::array< Axis< AxisArithmeticType >, ND::value > m_axis
set of Axis of this Histogram
Definition: Histogram.h:320
Gaudi::Accumulators::HistogramingCounterBaseInternal
A base counter dealing with Histograms.
Definition: Histogram.h:421
std::unique_ptr< BaseAccumulator[]>
Gaudi::Accumulators::WeightedSquareAccumulator::sum2
Arithmetic sum2() const
Definition: Histogram.h:126
Gaudi::Accumulators::WeightedCountAccumulator::operator+=
WeightedCountAccumulator operator+=(const Arithmetic weight)
Definition: Histogram.h:95
Gaudi::Accumulators::Axis::title
std::string title
title of this axis
Definition: Histogram.h:165
Gaudi::Accumulators::Axis::labels
std::vector< std::string > labels
labels for the bins
Definition: Histogram.h:167
std::array< Arithmetic, ND >::operator[]
Arithmetic operator[](Arithmetic ... args)
Gaudi::Accumulators::HistogramingAccumulatorInternal::computeTotNBins
unsigned int computeTotNBins() const
Definition: Histogram.h:314
Gaudi::Accumulators::HistoInputType< Arithmetic, 1 >::operator[]
Arithmetic & operator[](int)
Definition: Histogram.h:224
std::declval
T declval(T... args)