The Gaudi Framework  master (37c0b60a)
StaticRootHistogram.h
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2024 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 
14 
15 #include <type_traits>
16 
17 namespace {
18  template <typename tuple_t>
19  constexpr auto get_array_from_tuple( tuple_t&& tuple ) {
20  constexpr auto get_array = []( auto&&... x ) { return std::array{ std::forward<decltype( x )>( x )... }; };
21  return std::apply( get_array, std::forward<tuple_t>( tuple ) );
22  }
23 } // namespace
24 
25 namespace Gaudi::Accumulators {
26 
29  constexpr unsigned int NSUMS( unsigned int ND ) { return 1 + ND + ND * ( ND + 1 ) / 2; }
30 
31  template <typename Arithmetic, atomicity Atomicity, unsigned int ND>
33  using InputType = std::conditional_t<ND == 1, Arithmetic, std::array<Arithmetic, ND>>;
34  using OutputType = std::array<Arithmetic, NSUMS( ND )>;
35  struct OutputTypeTS : std::array<std::atomic<Arithmetic>, NSUMS( ND )> {
38  explicit OutputTypeTS( OutputType const& other ) {
39  for ( unsigned int i = 0; i < NSUMS( ND ); i++ ) { ( *this )[i] = other[i]; }
40  }
41  // operator= from non thread safe type
42  OutputTypeTS& operator=( OutputType const& other ) {
43  for ( unsigned int i = 0; i < NSUMS( ND ); i++ ) { ( *this )[i] = other[i]; }
44  return *this;
45  }
46  // automatic conversion to non thread safe type
47  operator OutputType() const {
49  for ( unsigned int i = 0; i < NSUMS( ND ); i++ ) { out[i] = ( *this )[i].load( std::memory_order_relaxed ); }
50  return out;
51  }
52  };
53  using InternalType = std::conditional_t<Atomicity == atomicity::full, OutputTypeTS, OutputType>;
54  static constexpr OutputType getValue( const InternalType& v ) noexcept {
55  // Note automatic conversion will happen
56  return v;
57  };
58  static OutputType exchange( InternalType& v, OutputType newv ) noexcept {
59  if constexpr ( Atomicity == atomicity::full ) {
60  OutputType old;
61  for ( unsigned int i = 0; i < NSUMS( ND ); i++ ) { old[i] = v[i].exchange( newv[i] ); }
62  return old;
63  } else {
64  return std::exchange( v, newv );
65  }
66  }
67  static constexpr OutputType DefaultValue() { return InternalType{}; }
68  static void merge( InternalType& a, const OutputType& b ) noexcept {
69  if constexpr ( Atomicity == atomicity::full ) {
70  for ( unsigned int i = 0; i < NSUMS( ND ); i++ ) { fetch_add( a[i], b[i] ); }
71  } else {
72  for ( unsigned int i = 0; i < ND * ( ND + 3 ); i++ ) a[i] += b[i];
73  }
74  }
75  static void merge( InternalType& a, InputType b ) noexcept {
76  // prepare values to increment internal values
77  OutputType diff{};
78  diff[0] = 1.;
79  if constexpr ( ND == 1 ) {
80  // no operator[] for b in this case
81  diff[1] = b;
82  diff[2] = b * b;
83  } else {
84  for ( unsigned int i = 0; i < ND; i++ ) diff[i + 1] += b[i];
85  unsigned int n = 1 + ND;
86  for ( unsigned int i = 0; i < ND; i++ ) {
87  for ( unsigned int j = i; j < ND; j++ ) {
88  diff[n] = b[i] * b[j];
89  n++;
90  }
91  }
92  }
93  // Now increase original counter
94  if constexpr ( Atomicity == atomicity::full ) {
95  for ( unsigned int i = 0; i < NSUMS( ND ); i++ ) { fetch_add( a[i], diff[i] ); }
96  } else {
97  for ( unsigned int i = 0; i < NSUMS( ND ); i++ ) a[i] += diff[i];
98  }
99  }
100  };
101 
102  template <typename Arithmetic, atomicity Atomicity, unsigned int ND>
104  : GenericAccumulator<std::array<Arithmetic, ND>, std::array<Arithmetic, NSUMS( ND )>, Atomicity, Identity,
105  Identity, SigmasValueHandler<Arithmetic, Atomicity, ND>> {
106  std::array<Arithmetic, NSUMS( ND )> const sums() const { return this->value(); }
107  };
108 
110  template <typename Arithmetic, atomicity Atomicity>
111  struct SigmaNAccumulator<Arithmetic, Atomicity, 1>
112  : GenericAccumulator<Arithmetic, std::array<Arithmetic, 3>, Atomicity, Identity, Identity,
113  SigmasValueHandler<Arithmetic, Atomicity, 1>> {
114  std::array<Arithmetic, 3> const sums() const { return this->value(); }
115  };
116 
122  template <atomicity Atomicity, typename Arithmetic, unsigned int ND, typename AxisTupleType>
124  : public HistogramingAccumulatorInternal<Atomicity, HistoInputType<AxisToArithmetic_t<AxisTupleType>, ND>,
125  unsigned long, IntegralAccumulator, AxisTupleType> {
126 
128  using Parent =
130 
131  template <atomicity, typename, unsigned int, typename>
133 
134  static_assert( ND <= 3, "Root on supports histogrmas with dimension <= 3" );
135 
140  struct Proxy {
141  Proxy( RootHistogramingAccumulatorInternal& histo, typename InputType::ValueType& v )
142  : m_histo( histo ), m_v( v ) {}
143  void operator++() { m_histo.update( m_v ); }
145  typename InputType::ValueType m_v;
146  };
147 
148  public:
149  using Parent::Parent;
150  friend struct Proxy;
151 
152  [[deprecated( "Use `++h1[x]`, `++h2[{x,y}]`, etc. instead." )]] RootHistogramingAccumulatorInternal&
153  operator+=( typename InputType::ValueType v ) {
154  update( v );
155  return *this;
156  }
157  void reset() {
158  m_accumulator.reset();
159  Parent::reset();
160  }
161  template <atomicity ato>
163  m_accumulator.mergeAndReset( other.m_accumulator );
164  Parent::mergeAndReset( other );
165  }
166  [[nodiscard]] auto operator[]( typename InputType::ValueType v ) { return Proxy( *this, v ); }
167 
172  auto sums2() const { return m_accumulator.sums(); }
173 
174  private:
175  void update( typename InputType::ValueType v ) {
176  // Do not accumulate in m_accumulator if we are outside the histo range
177  // We mimic here the behavior of ROOT
178  if ( v.inAcceptance( this->axis() ) ) {
179  if constexpr ( ND == 1 ) {
180  m_accumulator += std::get<0>( v );
181  } else {
182  m_accumulator += get_array_from_tuple( static_cast<typename InputType::InternalType>( v ) );
183  }
184  }
185  ++Parent::operator[]( v );
186  }
187  // Accumulator for keeping squared sum of value stored in the histogram and correlation values
188  // they get stored in "alphabetical" order, e.g. for ND=3 x^2, xy, xz, y^2, yz, z^2
190  };
191 
192  namespace {
194  template <typename Arithmetic>
195  Arithmetic stddev( Arithmetic n, Arithmetic s, Arithmetic s2 ) {
197  using std::sqrt;
198  auto v = ( n > 0 ) ? ( ( s2 - s * ( s / n ) ) / n ) : Arithmetic{};
199  return ( Arithmetic{ 0 } > v ) ? Arithmetic{} : sqrt( v );
200  }
201  } // namespace
202 
206  template <atomicity Atomicity, typename Arithmetic, typename ND, typename AxisTupleType>
208 
209  template <atomicity Atomicity, typename Arithmetic, typename AxisTupleType>
210  struct RootHistogramingAccumulator<Atomicity, Arithmetic, std::integral_constant<unsigned int, 1>, AxisTupleType>
211  : RootHistogramingAccumulatorInternal<Atomicity, Arithmetic, 1, AxisTupleType> {
212  using RootHistogramingAccumulatorInternal<Atomicity, Arithmetic, 1,
215  Arithmetic nEntries() const { return this->sums2()[0]; }
216  Arithmetic sum() const { return this->sums2()[1]; }
217  Arithmetic sum2() const { return this->sums2()[2]; }
218  Arithmetic mean() const { return sum() / nEntries(); }
219  Arithmetic standard_deviation() const { return stddev( nEntries(), sum(), sum2() ); }
220  };
221 
222  template <atomicity Atomicity, typename Arithmetic, typename AxisTupleType>
223  struct RootHistogramingAccumulator<Atomicity, Arithmetic, std::integral_constant<unsigned int, 2>, AxisTupleType>
224  : RootHistogramingAccumulatorInternal<Atomicity, Arithmetic, 2, AxisTupleType> {
225  using RootHistogramingAccumulatorInternal<Atomicity, Arithmetic, 2,
228  Arithmetic nEntries() const { return this->sums2()[0]; }
229  Arithmetic sumx() const { return this->sums2()[1]; }
230  Arithmetic sumy() const { return this->sums2()[2]; }
231  Arithmetic sumx2() const { return this->sums2()[3]; }
232  Arithmetic sumy2() const { return this->sums2()[5]; }
233  Arithmetic sumxy() const { return this->sums2()[4]; }
234  Arithmetic meanx() const { return sumx() / nEntries(); }
235  Arithmetic meany() const { return sumy() / nEntries(); }
236  Arithmetic standard_deviationx() const { return stddev( nEntries(), sumx(), sumx2() ); }
237  Arithmetic standard_deviationy() const { return stddev( nEntries(), sumy(), sumy2() ); }
238  };
239 
240  template <atomicity Atomicity, typename Arithmetic, typename AxisTupleType>
241  struct RootHistogramingAccumulator<Atomicity, Arithmetic, std::integral_constant<unsigned int, 3>, AxisTupleType>
242  : RootHistogramingAccumulatorInternal<Atomicity, Arithmetic, 3, AxisTupleType> {
243  using RootHistogramingAccumulatorInternal<Atomicity, Arithmetic, 3,
246  Arithmetic nEntries() const { return this->sums2()[0]; }
247  Arithmetic sumx() const { return this->sums2()[1]; }
248  Arithmetic sumy() const { return this->sums2()[2]; }
249  Arithmetic sumz() const { return this->sums2()[3]; }
250  Arithmetic sumx2() const { return this->sums2()[4]; }
251  Arithmetic sumy2() const { return this->sums2()[7]; }
252  Arithmetic sumz2() const { return this->sums2()[9]; }
253  Arithmetic sumxy() const { return this->sums2()[5]; }
254  Arithmetic sumxz() const { return this->sums2()[6]; }
255  Arithmetic sumyz() const { return this->sums2()[8]; }
256  Arithmetic meanx() const { return sumx() / nEntries(); }
257  Arithmetic meany() const { return sumy() / nEntries(); }
258  Arithmetic meanz() const { return sumz() / nEntries(); }
259  Arithmetic standard_deviationx() const { return stddev( nEntries(), sumx(), sumx2() ); }
260  Arithmetic standard_deviationy() const { return stddev( nEntries(), sumy(), sumy2() ); }
261  Arithmetic standard_deviationz() const { return stddev( nEntries(), sumz(), sumz2() ); }
262  };
263 
282  template <unsigned int ND, atomicity Atomicity, typename Arithmetic, const char* Type, typename AxisTupleType>
284 
285  template <atomicity Atomicity, typename Arithmetic, const char* Type, typename AxisTupleType>
286  class RootHistogramingCounterBase<1, Atomicity, Arithmetic, Type, AxisTupleType>
287  : public HistogramingCounterBase<1, Atomicity, Arithmetic, Type, RootHistogramingAccumulator, AxisTupleType> {
288  public:
290  using Parent::Parent;
291 
292  friend void to_json( nlohmann::json& j,
294  to_json( j, static_cast<Parent const&>( h ) );
295  j["nTotEntries"] = h.nEntries();
296  j["sum"] = h.sum();
297  j["mean"] = h.mean();
298  j["sum2"] = h.sum2();
299  j["standard_deviation"] = h.standard_deviation();
300  }
301  };
302 
303  template <atomicity Atomicity, typename Arithmetic, const char* Type, typename AxisTupleType>
304  class RootHistogramingCounterBase<2, Atomicity, Arithmetic, Type, AxisTupleType>
305  : public HistogramingCounterBase<2, Atomicity, Arithmetic, Type, RootHistogramingAccumulator, AxisTupleType> {
306  public:
308  using Parent::Parent;
309 
310  friend void to_json( nlohmann::json& j,
312  to_json( j, static_cast<Parent const&>( h ) );
313  j["nTotEntries"] = h.nEntries();
314  j["sumx"] = h.sumx();
315  j["sumy"] = h.sumy();
316  j["meanx"] = h.meanx();
317  j["meany"] = h.meany();
318  j["sumx2"] = h.sumx2();
319  j["sumy2"] = h.sumy2();
320  j["sumxy"] = h.sumxy();
321  j["standard_deviationx"] = h.standard_deviationx();
322  j["standard_deviationy"] = h.standard_deviationy();
323  }
324  };
325 
326  template <atomicity Atomicity, typename Arithmetic, const char* Type, typename AxisTupleType>
327  class RootHistogramingCounterBase<3, Atomicity, Arithmetic, Type, AxisTupleType>
328  : public HistogramingCounterBase<3, Atomicity, Arithmetic, Type, RootHistogramingAccumulator, AxisTupleType> {
329  public:
331  using Parent::Parent;
332 
333  friend void to_json( nlohmann::json& j,
335  to_json( j, static_cast<Parent const&>( h ) );
336  j["nTotEntries"] = h.nEntries();
337  j["sumx"] = h.sumx();
338  j["sumy"] = h.sumy();
339  j["sumz"] = h.sumz();
340  j["meanx"] = h.meanx();
341  j["meany"] = h.meany();
342  j["meanz"] = h.meanz();
343  j["sumx2"] = h.sumx2();
344  j["sumy2"] = h.sumy2();
345  j["sumz2"] = h.sumz2();
346  j["sumxy"] = h.sumxy();
347  j["sumxz"] = h.sumxz();
348  j["sumyz"] = h.sumyz();
349  j["standard_deviationx"] = h.standard_deviationx();
350  j["standard_deviationy"] = h.standard_deviationy();
351  j["standard_deviationz"] = h.standard_deviationz();
352  }
353  };
354 
356  template <unsigned int ND, atomicity Atomicity = atomicity::full, typename Arithmetic = double,
357  typename AxisTupleType = make_tuple_t<Axis<Arithmetic>, ND>>
360 
361 } // namespace Gaudi::Accumulators
Gaudi::Accumulators::HistogramingAccumulatorInternal::operator[]
auto operator[](typename InputType::ValueType v)
Definition: StaticHistogram.h:503
Gaudi::Accumulators::RootHistogramingAccumulator< Atomicity, Arithmetic, std::integral_constant< unsigned int, 2 >, AxisTupleType >::standard_deviationx
Arithmetic standard_deviationx() const
Definition: StaticRootHistogram.h:236
Gaudi::Accumulators::RootHistogramingAccumulator
Class implementing a root histogram accumulator.
Definition: StaticRootHistogram.h:207
Gaudi::Accumulators::RootHistogramingAccumulatorInternal::sums2
auto sums2() const
returns the nbentries, sums and "squared sums" of the inputs Practically we have first the number of ...
Definition: StaticRootHistogram.h:172
Gaudi::Accumulators::RootHistogramingAccumulator< Atomicity, Arithmetic, std::integral_constant< unsigned int, 2 >, AxisTupleType >::sumy
Arithmetic sumy() const
Definition: StaticRootHistogram.h:230
Gaudi::Accumulators::RootHistogramingAccumulatorInternal::update
void update(typename InputType::ValueType v)
Definition: StaticRootHistogram.h:175
Gaudi::Accumulators::sqrt
auto sqrt(std::chrono::duration< Rep, Period > d)
sqrt for std::chrono::duration
Definition: Counters.h:34
Gaudi::Accumulators::RootHistogramingAccumulatorInternal::operator+=
RootHistogramingAccumulatorInternal & operator+=(typename InputType::ValueType v)
Definition: StaticRootHistogram.h:153
Gaudi::Accumulators::SigmasValueHandler::merge
static void merge(InternalType &a, InputType b) noexcept
Definition: StaticRootHistogram.h:75
Gaudi::Accumulators::RootHistogramingAccumulator< Atomicity, Arithmetic, std::integral_constant< unsigned int, 2 >, AxisTupleType >::meanx
Arithmetic meanx() const
Definition: StaticRootHistogram.h:234
std::integral_constant
Gaudi::Accumulators::RootHistogramingAccumulatorInternal::mergeAndReset
void mergeAndReset(RootHistogramingAccumulatorInternal< ato, Arithmetic, ND, AxisTupleType > &other)
Definition: StaticRootHistogram.h:162
Gaudi::Accumulators::RootHistogramingAccumulatorInternal::Proxy
friend struct Proxy
Definition: StaticRootHistogram.h:150
Gaudi::Accumulators::RootHistogramingAccumulator< Atomicity, Arithmetic, std::integral_constant< unsigned int, 2 >, AxisTupleType >::sumxy
Arithmetic sumxy() const
Definition: StaticRootHistogram.h:233
Gaudi::Accumulators::RootHistogramingAccumulator< Atomicity, Arithmetic, std::integral_constant< unsigned int, 1 >, AxisTupleType >::mean
Arithmetic mean() const
Definition: StaticRootHistogram.h:218
Gaudi::Accumulators::RootHistogramingCounterBase< 1, Atomicity, Arithmetic, Type, AxisTupleType >
Definition: StaticRootHistogram.h:287
Gaudi::Accumulators::RootHistogramingAccumulator< Atomicity, Arithmetic, std::integral_constant< unsigned int, 3 >, AxisTupleType >::standard_deviationx
Arithmetic standard_deviationx() const
Definition: StaticRootHistogram.h:259
Gaudi::Accumulators::atomicity::full
@ full
gaudirun.s
string s
Definition: gaudirun.py:346
Gaudi::Accumulators::RootHistogramingAccumulator< Atomicity, Arithmetic, std::integral_constant< unsigned int, 3 >, AxisTupleType >::sumxz
Arithmetic sumxz() const
Definition: StaticRootHistogram.h:254
Gaudi::Accumulators::RootHistogramingAccumulator< Atomicity, Arithmetic, std::integral_constant< unsigned int, 3 >, AxisTupleType >::sumyz
Arithmetic sumyz() const
Definition: StaticRootHistogram.h:255
Gaudi::Accumulators::HistogramingCounterBase
A base counter dealing with Histograms.
Definition: StaticHistogram.h:653
Gaudi::Accumulators::RootHistogramingCounterBase< 2, Atomicity, Arithmetic, Type, AxisTupleType >
Definition: StaticRootHistogram.h:305
Gaudi::Accumulators::RootHistogramingAccumulator< Atomicity, Arithmetic, std::integral_constant< unsigned int, 3 >, AxisTupleType >::nEntries
Arithmetic nEntries() const
Definition: StaticRootHistogram.h:246
Gaudi::Accumulators::RootHistogramingAccumulator< Atomicity, Arithmetic, std::integral_constant< unsigned int, 3 >, AxisTupleType >::sumxy
Arithmetic sumxy() const
Definition: StaticRootHistogram.h:253
jsonFromLHCbLog.json
json
Definition: jsonFromLHCbLog.py:86
Gaudi::Accumulators::RootHistogramingAccumulator< Atomicity, Arithmetic, std::integral_constant< unsigned int, 3 >, AxisTupleType >::meanz
Arithmetic meanz() const
Definition: StaticRootHistogram.h:258
Gaudi::Accumulators::RootHistogramingAccumulatorInternal::operator[]
auto operator[](typename InputType::ValueType v)
Definition: StaticRootHistogram.h:166
Gaudi::Accumulators::SigmasValueHandler::OutputTypeTS::operator=
OutputTypeTS & operator=(OutputType const &other)
Definition: StaticRootHistogram.h:42
Gaudi::Accumulators::SigmaNAccumulator< Arithmetic, Atomicity, 1 >::sums
std::array< Arithmetic, 3 > const sums() const
Definition: StaticRootHistogram.h:114
std::sqrt
T sqrt(T... args)
Gaudi::Accumulators::SigmaNAccumulator
Definition: StaticRootHistogram.h:105
Gaudi::Accumulators::RootHistogramingCounterBase< 1, Atomicity, Arithmetic, Type, AxisTupleType >::to_json
friend void to_json(nlohmann::json &j, RootHistogramingCounterBase< 1, Atomicity, Arithmetic, Type, AxisTupleType > const &h)
Definition: StaticRootHistogram.h:292
Gaudi::Accumulators::SigmasValueHandler::getValue
static constexpr OutputType getValue(const InternalType &v) noexcept
Definition: StaticRootHistogram.h:54
Gaudi::Accumulators::SigmasValueHandler::InternalType
std::conditional_t< Atomicity==atomicity::full, OutputTypeTS, OutputType > InternalType
Definition: StaticRootHistogram.h:53
Gaudi::Accumulators::SigmasValueHandler::exchange
static OutputType exchange(InternalType &v, OutputType newv) noexcept
Definition: StaticRootHistogram.h:58
Gaudi::Accumulators::RootHistogramingAccumulator< Atomicity, Arithmetic, std::integral_constant< unsigned int, 2 >, AxisTupleType >::standard_deviationy
Arithmetic standard_deviationy() const
Definition: StaticRootHistogram.h:237
Gaudi::Accumulators::RootHistogramingAccumulator< Atomicity, Arithmetic, std::integral_constant< unsigned int, 2 >, AxisTupleType >::sumx
Arithmetic sumx() const
Definition: StaticRootHistogram.h:229
Gaudi::Accumulators::RootHistogramingAccumulator< Atomicity, Arithmetic, std::integral_constant< unsigned int, 1 >, AxisTupleType >::standard_deviation
Arithmetic standard_deviation() const
Definition: StaticRootHistogram.h:219
Gaudi::Accumulators::HistoInputType
small class used as InputType for regular Histograms basically a tuple of the given values,...
Definition: StaticHistogram.h:342
Gaudi::Accumulators::RootHistogramingAccumulator< Atomicity, Arithmetic, std::integral_constant< unsigned int, 3 >, AxisTupleType >::meanx
Arithmetic meanx() const
Definition: StaticRootHistogram.h:256
Gaudi::Accumulators::RootHistogramingAccumulator< Atomicity, Arithmetic, std::integral_constant< unsigned int, 2 >, AxisTupleType >::sumy2
Arithmetic sumy2() const
Definition: StaticRootHistogram.h:232
ProduceConsume.j
j
Definition: ProduceConsume.py:104
Gaudi::Accumulators::RootHistogramingCounterBase< 3, Atomicity, Arithmetic, Type, AxisTupleType >
Definition: StaticRootHistogram.h:328
AlgSequencer.h
h
Definition: AlgSequencer.py:31
Gaudi::Accumulators::SigmasValueHandler::merge
static void merge(InternalType &a, const OutputType &b) noexcept
Definition: StaticRootHistogram.h:68
Gaudi::Accumulators::RootHistogramingAccumulator< Atomicity, Arithmetic, std::integral_constant< unsigned int, 2 >, AxisTupleType >::meany
Arithmetic meany() const
Definition: StaticRootHistogram.h:235
Gaudi::Accumulators::RootHistogramingAccumulatorInternal::Proxy::m_histo
RootHistogramingAccumulatorInternal & m_histo
Definition: StaticRootHistogram.h:144
std::array
STL class.
Gaudi::Accumulators::RootHistogramingCounterBase< 3, Atomicity, Arithmetic, Type, AxisTupleType >::to_json
friend void to_json(nlohmann::json &j, RootHistogramingCounterBase< 3, Atomicity, Arithmetic, Type, AxisTupleType > const &h)
Definition: StaticRootHistogram.h:333
Gaudi::Accumulators::RootHistogramingAccumulatorInternal
Internal Accumulator class dealing with RootHistograming.
Definition: StaticRootHistogram.h:125
Gaudi::Accumulators::RootHistogramingAccumulator< Atomicity, Arithmetic, std::integral_constant< unsigned int, 3 >, AxisTupleType >::standard_deviationz
Arithmetic standard_deviationz() const
Definition: StaticRootHistogram.h:261
Gaudi::Accumulators::RootHistogramingAccumulatorInternal::m_accumulator
SigmaNAccumulator< Arithmetic, Atomicity, ND > m_accumulator
Definition: StaticRootHistogram.h:189
Gaudi::Accumulators::SigmasValueHandler::InputType
std::conditional_t< ND==1, Arithmetic, std::array< Arithmetic, ND > > InputType
Definition: StaticRootHistogram.h:33
Gaudi::Accumulators::SigmasValueHandler::OutputType
std::array< Arithmetic, NSUMS(ND)> OutputType
Definition: StaticRootHistogram.h:34
Gaudi::Accumulators::RootHistogramingAccumulator< Atomicity, Arithmetic, std::integral_constant< unsigned int, 3 >, AxisTupleType >::sumy
Arithmetic sumy() const
Definition: StaticRootHistogram.h:248
Gaudi::Accumulators::GenericAccumulator
Generic Accumulator, templated by.
Definition: Accumulators.h:471
Gaudi::Accumulators::RootHistogramingAccumulator< Atomicity, Arithmetic, std::integral_constant< unsigned int, 1 >, AxisTupleType >::sum2
Arithmetic sum2() const
Definition: StaticRootHistogram.h:217
Gaudi::Accumulators::to_json
void to_json(nlohmann::json &j, const Axis< Arithmetic > &axis)
automatic conversion of the Axis type to json
Definition: StaticHistogram.h:318
Gaudi::Accumulators::GenericAccumulator< std::array< Arithmetic, ND >, std::array< Arithmetic, NSUMS(ND)>, Atomicity, Identity, Identity, SigmasValueHandler< Arithmetic, Atomicity, ND > >::value
OutputType value() const
Definition: Accumulators.h:501
cpluginsvc.n
n
Definition: cpluginsvc.py:234
Gaudi::Accumulators::HistogramingAccumulatorInternal
Internal Accumulator class dealing with Histograming.
Definition: StaticHistogram.h:466
Gaudi::Accumulators::RootHistogramingAccumulator< Atomicity, Arithmetic, std::integral_constant< unsigned int, 3 >, AxisTupleType >::sumy2
Arithmetic sumy2() const
Definition: StaticRootHistogram.h:251
Gaudi::Accumulators
Definition: CounterArray.h:18
Gaudi::Accumulators::SigmasValueHandler::DefaultValue
static constexpr OutputType DefaultValue()
Definition: StaticRootHistogram.h:67
Gaudi::Accumulators::RootHistogramingAccumulator< Atomicity, Arithmetic, std::integral_constant< unsigned int, 3 >, AxisTupleType >::sumx
Arithmetic sumx() const
Definition: StaticRootHistogram.h:247
Gaudi::Accumulators::RootHistogramingAccumulator< Atomicity, Arithmetic, std::integral_constant< unsigned int, 3 >, AxisTupleType >::standard_deviationy
Arithmetic standard_deviationy() const
Definition: StaticRootHistogram.h:260
Gaudi::Accumulators::RootHistogramingAccumulator< Atomicity, Arithmetic, std::integral_constant< unsigned int, 3 >, AxisTupleType >::sumz2
Arithmetic sumz2() const
Definition: StaticRootHistogram.h:252
Gaudi::Accumulators::RootHistogramingAccumulatorInternal::Proxy::operator++
void operator++()
Definition: StaticRootHistogram.h:143
Containers::array
struct GAUDI_API array
Parametrisation class for redirection array - like implementation.
Definition: KeyedObjectManager.h:37
std
STL namespace.
Gaudi::Accumulators::RootHistogramingAccumulator< Atomicity, Arithmetic, std::integral_constant< unsigned int, 3 >, AxisTupleType >::sumz
Arithmetic sumz() const
Definition: StaticRootHistogram.h:249
Gaudi::Accumulators::SigmasValueHandler::OutputTypeTS::OutputTypeTS
OutputTypeTS(OutputType const &other)
Definition: StaticRootHistogram.h:38
Gaudi::Accumulators::RootHistogramingAccumulatorInternal::reset
void reset()
Definition: StaticRootHistogram.h:157
Gaudi::Accumulators::RootHistogramingCounterBase< 2, Atomicity, Arithmetic, Type, AxisTupleType >::to_json
friend void to_json(nlohmann::json &j, RootHistogramingCounterBase< 2, Atomicity, Arithmetic, Type, AxisTupleType > const &h)
Definition: StaticRootHistogram.h:310
Gaudi::Accumulators::RootHistogramingAccumulator< Atomicity, Arithmetic, std::integral_constant< unsigned int, 3 >, AxisTupleType >::sumx2
Arithmetic sumx2() const
Definition: StaticRootHistogram.h:250
Gaudi::Accumulators::atomicity
atomicity
Defines atomicity of the accumulators.
Definition: Accumulators.h:263
Gaudi::Accumulators::fetch_add
void fetch_add(AtomicType &atVar, Arithmetic value)
generic fetch_add, also dealing with atomic types with no fetch_add member method
Definition: Accumulators.h:366
Properties.v
v
Definition: Properties.py:122
Gaudi::Accumulators::RootHistogramingAccumulator< Atomicity, Arithmetic, std::integral_constant< unsigned int, 1 >, AxisTupleType >::sum
Arithmetic sum() const
Definition: StaticRootHistogram.h:216
Gaudi::Accumulators::NSUMS
constexpr unsigned int NSUMS(unsigned int ND)
number of items in sums for a given dimension = 1 (nb items) + ND (sums of each dimension) + ND*(ND+1...
Definition: StaticRootHistogram.h:29
Gaudi::Accumulators::RootHistogramingAccumulatorInternal::Proxy
Small procyclass allowing operator[] to work as expected on the RootHistogram that is to return somet...
Definition: StaticRootHistogram.h:140
Gaudi::Accumulators::HistogramingAccumulatorInternal::reset
void reset()
Definition: StaticHistogram.h:492
Gaudi::Accumulators::RootHistogramingAccumulatorInternal::Proxy::Proxy
Proxy(RootHistogramingAccumulatorInternal &histo, typename InputType::ValueType &v)
Definition: StaticRootHistogram.h:141
Gaudi::Accumulators::RootHistogramingCounterBase
Extension of the standard Gaudi histogram to provide similar functionnality as ROOT.
Definition: StaticRootHistogram.h:283
Gaudi::Accumulators::SigmasValueHandler
Definition: StaticRootHistogram.h:32
Gaudi::Accumulators::SigmasValueHandler::OutputTypeTS
Definition: StaticRootHistogram.h:35
Gaudi::Accumulators::RootHistogramingAccumulator< Atomicity, Arithmetic, std::integral_constant< unsigned int, 2 >, AxisTupleType >::nEntries
Arithmetic nEntries() const
Definition: StaticRootHistogram.h:228
Gaudi::Accumulators::RootHistogramingAccumulator< Atomicity, Arithmetic, std::integral_constant< unsigned int, 2 >, AxisTupleType >::sumx2
Arithmetic sumx2() const
Definition: StaticRootHistogram.h:231
Gaudi::Accumulators::RootHistogramingAccumulator< Atomicity, Arithmetic, std::integral_constant< unsigned int, 1 >, AxisTupleType >::nEntries
Arithmetic nEntries() const
Definition: StaticRootHistogram.h:215
Gaudi::Accumulators::RootHistogramingAccumulator< Atomicity, Arithmetic, std::integral_constant< unsigned int, 3 >, AxisTupleType >::meany
Arithmetic meany() const
Definition: StaticRootHistogram.h:257
Gaudi::Accumulators::SigmaNAccumulator::sums
std::array< Arithmetic, NSUMS(ND)> const sums() const
Definition: StaticRootHistogram.h:106
Gaudi::Accumulators::HistogramingAccumulatorInternal::mergeAndReset
void mergeAndReset(HistogramingAccumulatorInternal< ato, InputType, Arithmetic, BaseAccumulatorT, AxisTupleType > &other)
Definition: StaticHistogram.h:496
Gaudi::Accumulators::RootHistogramingAccumulatorInternal::Proxy::m_v
InputType::ValueType m_v
Definition: StaticRootHistogram.h:145
StaticHistogram.h
AlgSequencer.s2
s2
Definition: AlgSequencer.py:36
PrepareBase.out
out
Definition: PrepareBase.py:20