| The Gaudi Framework v32r1 (f65d50dc)

Public Member Functions | List of all members
Gaudi::Accumulators::SigmaAccumulator< Arithmetic, Atomicity > Struct Template Reference

SigmaAccumulator. More...

`#include <GaudiKernel/Counters.h>`

Inheritance diagram for Gaudi::Accumulators::SigmaAccumulator< Arithmetic, Atomicity >:
[legend]
Collaboration diagram for Gaudi::Accumulators::SigmaAccumulator< Arithmetic, Atomicity >:
[legend]

## Public Member Functions
template<typename Result = fp_result_type<Arithmetic>>
auto | biased_sample_variance () const
template<typename Result = fp_result_type<Arithmetic>>
auto | unbiased_sample_variance () const
template<typename Result = fp_result_type<Arithmetic>>
auto | standard_deviation () const
Arithmetic | rms () const
template<typename Result = fp_result_type<Arithmetic>>
auto | meanErr () const
Public Member Functions inherited from Gaudi::Accumulators::AccumulatorSet< Arithmetic, Atomicity, Bases >
constexpr | AccumulatorSet ()=default
AccumulatorSet & | operator+= (const InputType by)
OutputType | value () const
void | reset ()
template<atomicity Ato>
void | mergeAndReset (AccumulatorSet< Arithmetic, Ato, Bases... > &&other)

## Additional Inherited Members
Public Types inherited from Gaudi::Accumulators::AccumulatorSet< Arithmetic, Atomicity, Bases >
using | InputType = Arithmetic
using | OutputType = std::tuple< typename Bases< Arithmetic, Atomicity >::OutputType... >
Protected Member Functions inherited from Gaudi::Accumulators::AccumulatorSet< Arithmetic, Atomicity, Bases >
void | reset (const std::tuple< typename Bases< Arithmetic, Atomicity >::OutputType... > &t)

## Detailed Description

### template<typename Arithmetic, atomicity Atomicity = atomicity::full>
struct Gaudi::Accumulators::SigmaAccumulator< Arithmetic, Atomicity >

SigmaAccumulator.

A SigmaAccumulator is an Accumulator able to compute an average and variance/rms

See also
  Gaudi::Accumulators for detailed documentation

Definition at line 524 of file Counters.h.

## Member Function Documentation

## ◆ biased_sample_variance()

template<typename Arithmetic , atomicity Atomicity = atomicity::full>
template<typename Result = fp_result_type<Arithmetic>>

auto Gaudi::Accumulators::SigmaAccumulator< Arithmetic, Atomicity >::biased_sample_variance | ( |  | ) | const
| inline

Definition at line 527 of file Counters.h.

527 {
528 auto n = this->nEntries();
529 Result sum = this->sum();
530 return ( n > 0 ) ? static_cast<Result>( ( this->sum2() - sum * ( sum / n ) ) / n ) : Result{};
531 }
GaudiPluginService.cpluginsvc.n
n
Definition: cpluginsvc.py:210
GaudiPython.HistoUtils.nEntries
nEntries
Definition: HistoUtils.py:910

## ◆ meanErr()

template<typename Arithmetic , atomicity Atomicity = atomicity::full>
template<typename Result = fp_result_type<Arithmetic>>

auto Gaudi::Accumulators::SigmaAccumulator< Arithmetic, Atomicity >::meanErr | ( |  | ) | const
| inline

Definition at line 554 of file Counters.h.

554 {
555 auto n = this->nEntries();
556 if ( 0 == n ) return Result{};
557 // Note the usage of using, aiming at using the std version of sqrt by default, without preventing
558 // more specialized versions to be used via ADL (see http://en.cppreference.com/w/cpp/language/adl)
559 using Gaudi::Accumulators::sqrt;
560 using std::sqrt;
561 Result v = biased_sample_variance();
562 return ( Result{0} > v ) ? Result{} : static_cast<Result>( sqrt( v / n ) );
563 }
GaudiPluginService.cpluginsvc.n
n
Definition: cpluginsvc.py:210
GaudiPython.HistoUtils.nEntries
nEntries
Definition: HistoUtils.py:910
Gaudi::Accumulators::sqrt
auto sqrt(std::chrono::duration< Rep, Period > d)
sqrt for std::chrono::duration
Definition: Counters.h:28
std::sqrt
T sqrt(T... args)
Gaudi::Accumulators::SigmaAccumulator::biased_sample_variance
auto biased_sample_variance() const
Definition: Counters.h:527

## ◆ rms()

template<typename Arithmetic , atomicity Atomicity = atomicity::full>

Arithmetic Gaudi::Accumulators::SigmaAccumulator< Arithmetic, Atomicity >::rms | ( |  | ) | const
| inline

Definition at line 549 of file Counters.h.

549 {
550 return standard_deviation();
551 }
Gaudi::Accumulators::SigmaAccumulator::standard_deviation
auto standard_deviation() const
Definition: Counters.h:541

## ◆ standard_deviation()

template<typename Arithmetic , atomicity Atomicity = atomicity::full>
template<typename Result = fp_result_type<Arithmetic>>

auto Gaudi::Accumulators::SigmaAccumulator< Arithmetic, Atomicity >::standard_deviation | ( |  | ) | const
| inline

Definition at line 541 of file Counters.h.

541 {
542 // Note the usage of using, aiming at using the std version of sqrt by default, without preventing
543 // more specialized versions to be used via ADL (see http://en.cppreference.com/w/cpp/language/adl)
544 using Gaudi::Accumulators::sqrt;
545 using std::sqrt;
546 Result v = biased_sample_variance();
547 return ( Result{0} > v ) ? Result{} : static_cast<Result>( sqrt( v ) );
548 }
Gaudi::Accumulators::sqrt
auto sqrt(std::chrono::duration< Rep, Period > d)
sqrt for std::chrono::duration
Definition: Counters.h:28
std::sqrt
T sqrt(T... args)
Gaudi::Accumulators::SigmaAccumulator::biased_sample_variance
auto biased_sample_variance() const
Definition: Counters.h:527

## ◆ unbiased_sample_variance()

template<typename Arithmetic , atomicity Atomicity = atomicity::full>
template<typename Result = fp_result_type<Arithmetic>>

auto Gaudi::Accumulators::SigmaAccumulator< Arithmetic, Atomicity >::unbiased_sample_variance | ( |  | ) | const
| inline

Definition at line 534 of file Counters.h.

534 {
535 auto n = this->nEntries();
536 Result sum = this->sum();
537 return ( n > 1 ) ? static_cast<Result>( ( this->sum2() - sum * ( sum / n ) ) / ( n - 1 ) ) : Result{};
538 }
GaudiPluginService.cpluginsvc.n
n
Definition: cpluginsvc.py:210
GaudiPython.HistoUtils.nEntries
nEntries
Definition: HistoUtils.py:910

The documentation for this struct was generated from the following file:

- GaudiKernel/GaudiKernel/Counters.h