The Gaudi Framework  v41r0 (bdbe7744)
Loading...
Searching...
No Matches
Gaudi::Accumulators::SigmaAccumulatorBase< Atomicity, Arithmetic, AvgAcc, SquareAcc > Struct Template Reference

SigmaAccumulatorBase. More...

#include </builds/gaudi/Gaudi/GaudiKernel/include/Gaudi/Accumulators.h>

Inheritance diagram for Gaudi::Accumulators::SigmaAccumulatorBase< Atomicity, Arithmetic, AvgAcc, SquareAcc >:
Collaboration diagram for Gaudi::Accumulators::SigmaAccumulatorBase< Atomicity, Arithmetic, AvgAcc, SquareAcc >:

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, AvgAcc< Atomicity, Arithmetic >::InputType, AvgAcc, SquareAcc >
constexpr AccumulatorSet ()=default
AccumulatorSet & operator+= (const InputType by)
OutputType value () const
void reset ()
void mergeAndReset (AccumulatorSet< Arithmetic, Ato, InputType, AvgAcc... > &other)
void operator+ (AccumulatorSet< Arithmetic, Ato, InputType, AvgAcc... > &&other)
void operator++ ()=delete

Additional Inherited Members

Public Types inherited from Gaudi::Accumulators::AccumulatorSet< Arithmetic, Atomicity, AvgAcc< Atomicity, Arithmetic >::InputType, AvgAcc, SquareAcc >
using InputType
using OutputType
using InternalType
using JSONStringEntriesType
Static Protected Member Functions inherited from Gaudi::Accumulators::AccumulatorSet< Arithmetic, Atomicity, AvgAcc< Atomicity, Arithmetic >::InputType, AvgAcc, SquareAcc >
static InternalType extractJSONData (const nlohmann::json &j, const JSONStringEntriesType &entries)

Detailed Description

template<atomicity Atomicity, typename Arithmetic, template< atomicity, typename > typename AvgAcc, template< atomicity, typename > typename SquareAcc>
struct Gaudi::Accumulators::SigmaAccumulatorBase< Atomicity, Arithmetic, AvgAcc, SquareAcc >

SigmaAccumulatorBase.

A SigmaAccumulator is an Accumulator able to compute an average and variance/rms This Base class is still templated on the averaging and square accumulators

See also
Gaudi::Accumulators for detailed documentation

Definition at line 799 of file Accumulators.h.

Member Function Documentation

◆ biased_sample_variance()

template<atomicity Atomicity, typename Arithmetic, template< atomicity, typename > typename AvgAcc, template< atomicity, typename > typename SquareAcc>
template<typename Result = fp_result_type<Arithmetic>>
auto Gaudi::Accumulators::SigmaAccumulatorBase< Atomicity, Arithmetic, AvgAcc, SquareAcc >::biased_sample_variance ( ) const
inline

Definition at line 807 of file Accumulators.h.

807 {
808 auto n = this->nEntries();
809 Result sum = this->sum();
810 return ( n > 0 ) ? static_cast<Result>( ( this->sum2() - sum * ( sum / n ) ) / n ) : Result{};
811 }

◆ meanErr()

template<atomicity Atomicity, typename Arithmetic, template< atomicity, typename > typename AvgAcc, template< atomicity, typename > typename SquareAcc>
template<typename Result = fp_result_type<Arithmetic>>
auto Gaudi::Accumulators::SigmaAccumulatorBase< Atomicity, Arithmetic, AvgAcc, SquareAcc >::meanErr ( ) const
inline

Definition at line 834 of file Accumulators.h.

834 {
835 auto n = this->nEntries();
836 if ( 0 == n ) return Result{};
837 // Note the usage of using, aiming at using the std version of sqrt by default, without preventing
838 // more specialized versions to be used via ADL (see http://en.cppreference.com/w/cpp/language/adl)
840 using std::sqrt;
842 return ( Result{ 0 } > v ) ? Result{} : static_cast<Result>( sqrt( v / n ) );
843 }
auto sqrt(std::chrono::duration< Rep, Period > d)
sqrt for std::chrono::duration
Definition Counters.h:34

◆ rms()

template<atomicity Atomicity, typename Arithmetic, template< atomicity, typename > typename AvgAcc, template< atomicity, typename > typename SquareAcc>
Arithmetic Gaudi::Accumulators::SigmaAccumulatorBase< Atomicity, Arithmetic, AvgAcc, SquareAcc >::rms ( ) const
inline

Definition at line 829 of file Accumulators.h.

829 {
830 return standard_deviation();
831 }

◆ standard_deviation()

template<atomicity Atomicity, typename Arithmetic, template< atomicity, typename > typename AvgAcc, template< atomicity, typename > typename SquareAcc>
template<typename Result = fp_result_type<Arithmetic>>
auto Gaudi::Accumulators::SigmaAccumulatorBase< Atomicity, Arithmetic, AvgAcc, SquareAcc >::standard_deviation ( ) const
inline

Definition at line 821 of file Accumulators.h.

821 {
822 // Note the usage of using, aiming at using the std version of sqrt by default, without preventing
823 // more specialized versions to be used via ADL (see http://en.cppreference.com/w/cpp/language/adl)
825 using std::sqrt;
827 return ( Result{ 0 } > v ) ? Result{} : static_cast<Result>( sqrt( v ) );
828 }

◆ unbiased_sample_variance()

template<atomicity Atomicity, typename Arithmetic, template< atomicity, typename > typename AvgAcc, template< atomicity, typename > typename SquareAcc>
template<typename Result = fp_result_type<Arithmetic>>
auto Gaudi::Accumulators::SigmaAccumulatorBase< Atomicity, Arithmetic, AvgAcc, SquareAcc >::unbiased_sample_variance ( ) const
inline

Definition at line 814 of file Accumulators.h.

814 {
815 auto n = this->nEntries();
816 Result sum = this->sum();
817 return ( n > 1 ) ? static_cast<Result>( ( this->sum2() - sum * ( sum / n ) ) / ( n - 1 ) ) : Result{};
818 }

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