Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  v36r7 (7f57a304)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Histogram.h
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2022 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 <array>
16 #include <cmath>
17 #include <nlohmann/json.hpp>
18 #include <string>
19 #include <type_traits>
20 #include <utility>
21 #include <vector>
22 
23 namespace Gaudi::Accumulators {
24 
25  namespace details {
26  template <std::size_t, typename T>
27  using alwaysT = T;
28  // get a tuple of n types the given Type, or directly the type for n = 1
29  template <typename Type, unsigned int ND>
30  struct GetTuple;
31  template <typename Type, unsigned int ND>
33  template <typename Type, unsigned int ND>
34  struct GetTuple {
35  using type =
37  };
38  template <typename Type>
39  struct GetTuple<Type, 1> {
41  };
42  } // namespace details
43 
47  struct ExtractWeight {
48  template <typename Arithmetic>
49  constexpr decltype( auto ) operator()( const std::pair<Arithmetic, Arithmetic>& v ) const noexcept {
50  return v.second;
51  }
52  };
53 
57  struct WeightedProduct {
58  template <typename Arithmetic>
59  constexpr decltype( auto ) operator()( const std::pair<Arithmetic, Arithmetic>& v ) const noexcept {
60  return v.first * v.second;
61  }
62  };
63 
67  struct WeightedSquare {
68  template <typename Arithmetic>
69  constexpr decltype( auto ) operator()( const std::pair<Arithmetic, Arithmetic>& v ) const noexcept {
70  return v.first * v.first * v.second;
71  }
72  };
73 
80  template <atomicity Atomicity, typename Arithmetic>
82  : GenericAccumulator<std::pair<Arithmetic, Arithmetic>, Arithmetic, Atomicity, ExtractWeight> {
84  using Base::Base;
85  using Base::operator+=;
87  WeightedCountAccumulator operator+=( const Arithmetic weight ) {
88  *this += { Arithmetic{}, weight };
89  return *this;
90  }
91  Arithmetic nEntries() const { return this->value(); }
92  };
93 
100  template <atomicity Atomicity, typename Arithmetic>
102  : GenericAccumulator<std::pair<Arithmetic, Arithmetic>, Arithmetic, Atomicity, WeightedProduct> {
103  using GenericAccumulator<std::pair<Arithmetic, Arithmetic>, Arithmetic, Atomicity,
105  Arithmetic sum() const { return this->value(); }
106  };
107 
113  template <atomicity Atomicity, typename Arithmetic = double>
115  : GenericAccumulator<std::pair<Arithmetic, Arithmetic>, Arithmetic, Atomicity, WeightedSquare> {
116  using GenericAccumulator<std::pair<Arithmetic, Arithmetic>, Arithmetic, Atomicity,
118  Arithmetic sum2() const { return this->value(); };
119  };
120 
126  template <atomicity Atomicity, typename Arithmetic>
129 
135  template <atomicity Atomicity, typename Arithmetic>
138 
142  template <typename Arithmetic>
143  struct Axis {
144  Axis( unsigned int _nBins, Arithmetic _minValue, Arithmetic _maxValue, std::string _title = {},
145  std::vector<std::string> _labels = {} )
146  : nBins( _nBins )
147  , minValue( _minValue )
148  , maxValue( _maxValue )
149  , title( std::move( _title ) )
150  , labels( std::move( _labels ) )
151  , ratio( _nBins / ( _maxValue - _minValue ) ){};
153  unsigned int nBins;
155  Arithmetic minValue, maxValue;
164  Arithmetic ratio;
165 
167  unsigned int index( Arithmetic value ) const {
168  int idx = std::floor( ( value - minValue ) * ratio ) + 1;
169  return idx < 0 ? 0 : ( (unsigned int)idx > nBins ? nBins + 1 : (unsigned int)idx );
170  }
171  };
172 
174  template <typename Arithmetic>
175  void to_json( nlohmann::json& j, const Axis<Arithmetic>& axis ) {
176  j = nlohmann::json{ { "nBins", axis.nBins },
177  { "minValue", axis.minValue },
178  { "maxValue", axis.maxValue },
179  { "title", axis.title } };
180  if ( !axis.labels.empty() ) { j["labels"] = axis.labels; }
181  }
182 
184  template <typename Arithmetic, unsigned int ND, unsigned int NIndex = ND>
185  struct HistoInputType : std::array<Arithmetic, ND> {
186  // allow construction from set of values
187  template <class... ARGS, typename = typename std::enable_if_t<( sizeof...( ARGS ) == NIndex )>>
188  HistoInputType( ARGS... args ) : std::array<Arithmetic, ND>{ static_cast<Arithmetic>( args )... } {}
189  // The change on NIndex == 1 allow to have simpler syntax in that case, that is no tuple of one item
191  using AxisArithmeticType = Arithmetic;
192  unsigned int computeIndex( const std::array<Axis<Arithmetic>, NIndex>& axis ) const {
193  unsigned int index = 0;
194  for ( unsigned int j = 0; j < NIndex; j++ ) {
195  unsigned int dim = NIndex - j - 1;
196  // compute local index for a given dimension
197  int localIndex = axis[dim].index( ( *this )[dim] );
198  // compute global index. Bins are stored in a column first manner
199  index *= ( axis[dim].nBins + 2 );
200  index += localIndex;
201  }
202  return index;
203  }
204  auto forInternalCounter() { return 1ul; }
205  template <typename AxisType, long unsigned NAxis>
206  static unsigned int computeTotNBins( std::array<AxisType, NAxis> axis ) {
207  unsigned int nTotBins = 1;
208  for ( unsigned int i = 0; i < NAxis; i++ ) { nTotBins *= ( axis[i].nBins + 2 ); }
209  return nTotBins;
210  }
211  };
212 
215  template <typename Arithmetic>
216  class HistoInputType<Arithmetic, 1> {
217  public:
219  using AxisArithmeticType = Arithmetic;
220  HistoInputType( Arithmetic a ) : value( a ) {}
221  unsigned int computeIndex( const std::array<Axis<Arithmetic>, 1>& axis ) const { return axis[0].index( value ); }
222  Arithmetic& operator[]( int ) { return value; }
223  operator Arithmetic() const { return value; }
224  auto forInternalCounter() { return 1ul; }
225  template <typename AxisType>
226  static unsigned int computeTotNBins( std::array<AxisType, 1> axis ) {
227  return axis[0].nBins + 2;
228  }
229 
230  private:
231  Arithmetic value;
232  };
233 
235  template <typename Arithmetic, unsigned int ND, unsigned int NIndex = ND>
236  struct WeightedHistoInputType : std::pair<HistoInputType<Arithmetic, ND, NIndex>, Arithmetic> {
237  // The change on NIndex == 1 allow to have simpler syntax in that case, that is no tuple of one item
239  using AxisArithmeticType = Arithmetic;
241  unsigned int computeIndex( const std::array<Axis<Arithmetic>, NIndex>& axis ) const {
242  return this->first.computeIndex( axis );
243  }
244  auto forInternalCounter() { return std::pair( this->first.forInternalCounter(), this->second ); }
245  template <typename AxisType, long unsigned NAxis>
246  static unsigned int computeTotNBins( std::array<AxisType, NAxis> axis ) {
248  }
249  };
250 
265  template <atomicity Atomicity, typename InputType, typename Arithmetic, typename ND,
266  template <atomicity Ato, typename Arith> typename BaseAccumulatorT>
268  template <atomicity, typename, typename, typename, template <atomicity, typename> typename>
270 
271  public:
272  using BaseAccumulator = BaseAccumulatorT<Atomicity, Arithmetic>;
273  using AxisArithmeticType = typename InputType::AxisArithmeticType;
274  template <std::size_t... Is>
276  std::index_sequence<Is...> )
277  : m_axis{ std::get<Is>( axis )... }
278  , m_totNBins{ InputType::computeTotNBins( m_axis ) }
280  reset();
281  }
282  template <atomicity ato>
286  : m_axis( other.m_axis )
287  , m_totNBins{ InputType::computeTotNBins( m_axis ) }
289  reset();
290  }
291  [[deprecated( "Use `++h1[x]`, `++h2[{x,y}]`, etc. instead." )]] HistogramingAccumulatorInternal&
292  operator+=( InputType v ) {
293  accumulator( v.computeIndex( m_axis ) ) += v.forInternalCounter();
294  return *this;
295  }
296  void reset() {
297  for ( unsigned int index = 0; index < m_totNBins; index++ ) accumulator( index ).reset();
298  }
299  template <atomicity ato>
301  assert( m_totNBins == other.m_totNBins );
302  for ( unsigned int index = 0; index < m_totNBins; index++ ) {
303  accumulator( index ).mergeAndReset( std::move( other.accumulator( index ) ) );
304  }
305  }
306  [[nodiscard]] auto operator[]( typename InputType::ValueType v ) {
308  }
309 
310  protected:
311  auto& axis() const { return m_axis; }
312  auto nBins( unsigned int i ) const { return m_axis[i].nBins; }
313  auto minValue( unsigned int i ) const { return m_axis[i].minValue; }
314  auto maxValue( unsigned int i ) const { return m_axis[i].maxValue; }
315  auto binValue( unsigned int i ) const { return accumulator( i ).value(); }
316  auto nEntries( unsigned int i ) const { return accumulator( i ).nEntries(); }
317  auto totNBins() const { return m_totNBins; }
318 
319  private:
320  BaseAccumulator& accumulator( unsigned int index ) const {
321  assert( index < m_totNBins );
322  return m_value[index];
323  }
327  unsigned int m_totNBins;
330  };
331 
337  template <atomicity Atomicity, typename Arithmetic, typename ND>
339  unsigned long, ND, IntegralAccumulator>;
340 
346  template <atomicity Atomicity, typename Arithmetic, typename ND>
350 
356  template <atomicity Atomicity, typename Arithmetic, typename ND>
360 
366  template <atomicity Atomicity, typename Arithmetic, typename ND>
369  Arithmetic, ND, WeightedSigmaAccumulator>;
370 
424  template <unsigned int ND, atomicity Atomicity, typename Arithmetic, const char* Type,
425  template <atomicity, typename, typename> typename Accumulator, typename Seq>
427  template <unsigned int ND, atomicity Atomicity, typename Arithmetic, const char* Type,
428  template <atomicity, typename, typename> typename Accumulator, std::size_t... NDs>
429  class HistogramingCounterBaseInternal<ND, Atomicity, Arithmetic, Type, Accumulator, std::index_sequence<NDs...>>
430  : public BufferableCounter<Atomicity, Accumulator, Arithmetic, std::integral_constant<int, ND>> {
431  public:
433  template <typename OWNER>
434  HistogramingCounterBaseInternal( OWNER* owner, std::string const& name, std::string const& title,
436  : Parent( owner, name, std::string( Type ) + ":" + typeid( Arithmetic ).name(), axis,
437  std::make_index_sequence<ND>{} )
438  , m_title( title ) {}
439  template <typename OWNER>
440  HistogramingCounterBaseInternal( OWNER* owner, std::string const& name, std::string const& title,
441  details::alwaysT<NDs, Axis<Arithmetic>>... allAxis )
442  : HistogramingCounterBaseInternal( owner, name, title, std::make_tuple( allAxis... ) ) {}
443  using Parent::print;
444  template <typename stream>
445  stream& printImpl( stream& o, bool /*tableFormat*/ ) const {
446  o << ND << "D Histogram with config ";
447  for ( unsigned int i = 0; i < ND; i++ ) {
448  o << this->nBins( i ) << " " << this->minValue( i ) << " " << this->maxValue( i ) << " ";
449  }
450  return o;
451  }
452  std::ostream& print( std::ostream& o, bool tableFormat = false ) const override {
453  return printImpl( o, tableFormat );
454  }
455  MsgStream& print( MsgStream& o, bool tableFormat = false ) const override { return printImpl( o, tableFormat ); }
456  nlohmann::json toJSON() const override {
457  // get all bin values and compute total nbEntries
458  using Acc = Accumulator<Atomicity, Arithmetic, std::integral_constant<int, ND>>;
460  bins.reserve( this->totNBins() );
461  unsigned long totNEntries{ 0 };
462  for ( unsigned int i = 0; i < this->totNBins(); i++ ) {
463  bins.push_back( this->binValue( i ) );
464  totNEntries += this->nEntries( i );
465  }
466  // build json
467  return { { "type", std::string( Type ) + ":" + typeid( Arithmetic ).name() },
468  { "title", m_title },
469  { "dimension", ND },
470  { "empty", totNEntries == 0 },
471  { "nEntries", totNEntries },
472  { "axis", this->axis() },
473  { "bins", bins } };
474  }
475 
476  private:
478  };
479  template <unsigned int ND, atomicity Atomicity, typename Arithmetic, const char* Type,
480  template <atomicity, typename, typename> typename Accumulator>
483 
484  namespace naming {
485  constexpr char histogramString[] = "histogram:Histogram";
486  constexpr char weightedHistogramString[] = "histogram:WeightedHistogram";
487  constexpr char profilehistogramString[] = "histogram:ProfileHistogram";
488  constexpr char weightedProfilehistogramString[] = "histogram:WeightedProfileHistogram";
489  } // namespace naming
491  template <unsigned int ND, atomicity Atomicity = atomicity::full, typename Arithmetic = double>
492  using Histogram =
494 
496  template <unsigned int ND, atomicity Atomicity = atomicity::full, typename Arithmetic = double>
499 
501  template <unsigned int ND, atomicity Atomicity = atomicity::full, typename Arithmetic = double>
504 
506  template <unsigned int ND, atomicity Atomicity = atomicity::full, typename Arithmetic = double>
510 
511 } // namespace Gaudi::Accumulators
Gaudi::Accumulators::Axis::minValue
Arithmetic minValue
min and max values on this axis
Definition: Histogram.h:155
Gaudi::Accumulators::ExtractWeight
A functor to extract weight, take a pair (valueTuple, weight) as input.
Definition: Histogram.h:47
std::floor
T floor(T... args)
Gaudi::Accumulators::HistogramingAccumulatorInternal::nBins
auto nBins(unsigned int i) const
Definition: Histogram.h:312
Gaudi::Accumulators::WeightedSquareAccumulator
WeightedSquareAccumulator.
Definition: Histogram.h:115
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:244
std::move
T move(T... args)
Gaudi::Accumulators::HistogramingAccumulatorInternal::accumulator
BaseAccumulator & accumulator(unsigned int index) const
Definition: Histogram.h:320
Gaudi::Accumulators::WeightedCountAccumulator::nEntries
Arithmetic nEntries() const
Definition: Histogram.h:91
MonitoringHub.h
Gaudi::Accumulators::HistogramingAccumulatorInternal::mergeAndReset
void mergeAndReset(HistogramingAccumulatorInternal< ato, InputType, Arithmetic, ND, BaseAccumulatorT > &&other)
Definition: Histogram.h:300
std::pair
std::vector::reserve
T reserve(T... args)
Gaudi::Accumulators::HistogramingAccumulatorInternal::AxisArithmeticType
typename InputType::AxisArithmeticType AxisArithmeticType
Definition: Histogram.h:273
Gaudi::Accumulators::HistoInputType< Arithmetic, 1 >::value
Arithmetic value
Definition: Histogram.h:231
Gaudi::Accumulators::Axis::maxValue
Arithmetic maxValue
Definition: Histogram.h:155
Gaudi::Accumulators::Axis::nBins
unsigned int nBins
number of bins for this Axis
Definition: Histogram.h:151
Gaudi::Accumulators::HistogramingCounterBaseInternal< ND, Atomicity, Arithmetic, Type, Accumulator, std::index_sequence< NDs... > >::HistogramingCounterBaseInternal
HistogramingCounterBaseInternal(OWNER *owner, std::string const &name, std::string const &title, details::GetTuple_t< Axis< Arithmetic >, ND > axis)
Definition: Histogram.h:434
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:315
std::vector< std::string >
Gaudi::Accumulators::IntegralAccumulator
IntegralAccumulator.
Definition: Accumulators.h:601
Gaudi::Accumulators::naming::weightedHistogramString
constexpr char weightedHistogramString[]
Definition: Histogram.h:486
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:456
Gaudi::Accumulators::WeightedSumAccumulator::sum
Arithmetic sum() const
Definition: Histogram.h:105
std::tuple
Gaudi::Accumulators::HistogramingAccumulatorInternal::operator+=
HistogramingAccumulatorInternal & operator+=(InputType v)
Definition: Histogram.h:292
Gaudi::Accumulators::details::alwaysT
T alwaysT
Definition: Histogram.h:27
Gaudi::Accumulators::naming::weightedProfilehistogramString
constexpr char weightedProfilehistogramString[]
Definition: Histogram.h:488
Gaudi::Accumulators::HistogramingAccumulatorInternal::HistogramingAccumulatorInternal
HistogramingAccumulatorInternal(details::GetTuple_t< Axis< AxisArithmeticType >, ND::value > axis, std::index_sequence< Is... >)
Definition: Histogram.h:275
Gaudi::Accumulators::AveragingAccumulatorBase
AveragingAccumulatorBase.
Definition: Accumulators.h:713
jsonFromLHCbLog.json
dictionary json
Definition: jsonFromLHCbLog.py:87
Gaudi::Accumulators::WeightedSumAccumulator
WeightedSumAccumulator.
Definition: Histogram.h:102
Gaudi::Accumulators::naming::profilehistogramString
constexpr char profilehistogramString[]
Definition: Histogram.h:487
Gaudi::Accumulators::HistoInputType< Arithmetic, 1 >::computeTotNBins
static unsigned int computeTotNBins(std::array< AxisType, 1 > axis)
Definition: Histogram.h:226
Gaudi::Accumulators::Axis
Definition of an Histogram Axis.
Definition: Histogram.h:143
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:445
Gaudi::Accumulators::HistoInputType::computeIndex
unsigned int computeIndex(const std::array< Axis< Arithmetic >, NIndex > &axis) const
Definition: Histogram.h:192
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:452
Gaudi::Accumulators::WeightedHistoInputType::computeIndex
unsigned int computeIndex(const std::array< Axis< Arithmetic >, NIndex > &axis) const
Definition: Histogram.h:241
Gaudi::Accumulators::HistoInputType
small class used as InputType for regular Histograms
Definition: Histogram.h:185
Gaudi::Accumulators::HistoInputType< Arithmetic, 1 >::AxisArithmeticType
Arithmetic AxisArithmeticType
Definition: Histogram.h:219
TimingHistograms.name
name
Definition: TimingHistograms.py:25
Gaudi::Accumulators::HistogramingAccumulatorInternal::BaseAccumulator
BaseAccumulatorT< Atomicity, Arithmetic > BaseAccumulator
Definition: Histogram.h:272
details
Definition: AnyDataWrapper.h:18
std::ostream
STL class.
Gaudi::Accumulators::HistogramingAccumulatorInternal::totNBins
auto totNBins() const
Definition: Histogram.h:317
Gaudi::Accumulators::HistogramingAccumulatorInternal::operator[]
auto operator[](typename InputType::ValueType v)
Definition: Histogram.h:306
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:455
Gaudi::Accumulators::WeightedHistoInputType
small class used as InputType for weighted Histograms
Definition: Histogram.h:236
Gaudi::Accumulators::details::GetTuple::type
decltype(std::tuple_cat(std::declval< std::tuple< Type > >(), std::declval< GetTuple_t< Type, ND - 1 > >())) type
Definition: Histogram.h:36
Gaudi::Accumulators::GenericAccumulator< std::pair< Arithmetic, Arithmetic >, Arithmetic, Atomicity, WeightedProduct >::GenericAccumulator
friend class GenericAccumulator
Definition: Accumulators.h:436
std::array
STL class.
Gaudi::Accumulators::HistogramingAccumulatorInternal::maxValue
auto maxValue(unsigned int i) const
Definition: Histogram.h:314
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:167
Gaudi::Accumulators::HistogramingCounterBaseInternal< ND, Atomicity, Arithmetic, Type, Accumulator, std::index_sequence< NDs... > >::m_title
std::string const m_title
Definition: Histogram.h:477
Gaudi::Accumulators::HistoInputType::forInternalCounter
auto forInternalCounter()
Definition: Histogram.h:204
Gaudi::Accumulators::HistogramingAccumulatorInternal::axis
auto & axis() const
Definition: Histogram.h:311
Gaudi::Accumulators::HistogramingAccumulatorInternal::nEntries
auto nEntries(unsigned int i) const
Definition: Histogram.h:316
Gaudi::Accumulators::HistogramingAccumulatorInternal::reset
void reset()
Definition: Histogram.h:296
Gaudi::Accumulators::WeightedHistoInputType::computeTotNBins
static unsigned int computeTotNBins(std::array< AxisType, NAxis > axis)
Definition: Histogram.h:246
Gaudi::Accumulators::HistoInputType< Arithmetic, 1 >::forInternalCounter
auto forInternalCounter()
Definition: Histogram.h:224
Gaudi::Accumulators::GenericAccumulator
Generic Accumulator, templated by.
Definition: Accumulators.h:434
Gaudi::Accumulators::HistogramingAccumulatorInternal::minValue
auto minValue(unsigned int i) const
Definition: Histogram.h:313
MsgStream
Definition: MsgStream.h:34
Gaudi::Accumulators::HistogramingAccumulatorInternal::HistogramingAccumulatorInternal
HistogramingAccumulatorInternal(construct_empty_t, const HistogramingAccumulatorInternal< ato, InputType, Arithmetic, ND, BaseAccumulatorT > &other)
Definition: Histogram.h:283
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:175
Gaudi::Accumulators::Axis::Axis
Axis(unsigned int _nBins, Arithmetic _minValue, Arithmetic _maxValue, std::string _title={}, std::vector< std::string > _labels={})
Definition: Histogram.h:144
Gaudi::Accumulators::GenericAccumulator< std::pair< Arithmetic, Arithmetic >, Arithmetic, Atomicity, ExtractWeight >::value
OutputType value() const
Definition: Accumulators.h:464
Gaudi::Accumulators::WeightedProduct
A Product functor, take a pair (value, weight) as input.
Definition: Histogram.h:57
Gaudi::Accumulators::BufferableCounter
An empty ancester of all counters that provides a buffer method that returns a buffer on itself Also ...
Definition: Accumulators.h:872
HistoDumpEx.v
v
Definition: HistoDumpEx.py:27
Gaudi::Accumulators::HistogramingAccumulatorInternal
Internal Accumulator class dealing with Histograming.
Definition: Histogram.h:267
Accumulators.h
Gaudi::Accumulators::HistoInputType< Arithmetic, 1 >::computeIndex
unsigned int computeIndex(const std::array< Axis< Arithmetic >, 1 > &axis) const
Definition: Histogram.h:221
Gaudi::Accumulators
Definition: HistogramsTests.cpp:19
Gaudi::Accumulators::HistoInputType< Arithmetic, 1 >::HistoInputType
HistoInputType(Arithmetic a)
Definition: Histogram.h:220
Gaudi::Accumulators::HistoInputType::AxisArithmeticType
Arithmetic AxisArithmeticType
Definition: Histogram.h:191
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::HistoInputType::HistoInputType
HistoInputType(ARGS... args)
Definition: Histogram.h:188
Gaudi::Accumulators::HistogramingAccumulatorInternal::m_value
std::unique_ptr< BaseAccumulator[]> m_value
Histogram content.
Definition: Histogram.h:329
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:67
Gaudi::Accumulators::HistogramingAccumulatorInternal::m_totNBins
unsigned int m_totNBins
total number of bins in this histogram, under and overflow included
Definition: Histogram.h:327
Gaudi::Accumulators::HistogramingAccumulatorInternal::HistogramingAccumulatorInternal
friend class HistogramingAccumulatorInternal
Definition: Histogram.h:269
Gaudi::Accumulators::SigmaAccumulatorBase
SigmaAccumulatorBase.
Definition: Accumulators.h:742
Gaudi::Accumulators::Buffer
Buffer is a non atomic Accumulator which, when it goes out-of-scope, updates the underlying thread-sa...
Definition: Accumulators.h:810
Gaudi::Accumulators::HistogramingCounterBaseInternal< ND, Atomicity, Arithmetic, Type, Accumulator, std::index_sequence< NDs... > >::HistogramingCounterBaseInternal
HistogramingCounterBaseInternal(OWNER *owner, std::string const &name, std::string const &title, details::alwaysT< NDs, Axis< Arithmetic >>... allAxis)
Definition: Histogram.h:440
Gaudi::Accumulators::atomicity
atomicity
Defines atomicity of the accumulators.
Definition: Accumulators.h:236
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:164
Gaudi::Accumulators::construct_empty_t
constant used to disambiguate construction of an empty Accumulator versus the copy constructor.
Definition: Accumulators.h:409
Gaudi::Accumulators::HistoInputType::computeTotNBins
static unsigned int computeTotNBins(std::array< AxisType, NAxis > axis)
Definition: Histogram.h:206
std::tuple_cat
T tuple_cat(T... args)
Gaudi::Accumulators::WeightedCountAccumulator
WeightedCountAccumulator.
Definition: Histogram.h:82
std::size_t
Gaudi::Accumulators::details::GetTuple
Definition: Histogram.h:30
Gaudi::Accumulators::WeightedHistoInputType::AxisArithmeticType
Arithmetic AxisArithmeticType
Definition: Histogram.h:239
Gaudi::Accumulators::HistogramingAccumulatorInternal::m_axis
std::array< Axis< AxisArithmeticType >, ND::value > m_axis
set of Axis of this Histogram
Definition: Histogram.h:325
Gaudi::Accumulators::details::GetTuple_t
typename GetTuple< Type, ND >::type GetTuple_t
Definition: Histogram.h:32
Gaudi::Accumulators::naming::histogramString
constexpr char histogramString[]
Definition: Histogram.h:485
Gaudi::Accumulators::HistogramingCounterBaseInternal
A base counter dealing with Histograms.
Definition: Histogram.h:426
std::unique_ptr< BaseAccumulator[]>
Gaudi::Accumulators::WeightedSquareAccumulator::sum2
Arithmetic sum2() const
Definition: Histogram.h:118
Gaudi::Accumulators::WeightedCountAccumulator::operator+=
WeightedCountAccumulator operator+=(const Arithmetic weight)
Definition: Histogram.h:87
Gaudi::Accumulators::Axis::title
std::string title
title of this axis
Definition: Histogram.h:157
Gaudi::Accumulators::Axis::labels
std::vector< std::string > labels
labels for the bins
Definition: Histogram.h:159
Gaudi::Accumulators::HistoInputType< Arithmetic, 1 >::operator[]
Arithmetic & operator[](int)
Definition: Histogram.h:222
std::declval
T declval(T... args)