CbmRoot
Loading...
Searching...
No Matches
boost::histogram::RootStyleProfileAccumulator< ValueType > Class Template Reference

A ROOT-style accumulator for the Boost-histogram profiles. More...

#include <Accumulators.h>

Inheritance diagram for boost::histogram::RootStyleProfileAccumulator< ValueType >:
[legend]

Public Types

using Value_t = ValueType
 
using ConstRef_t = const Value_t&
 
using Weight_t = weight_type<Value_t>
 

Public Member Functions

 RootStyleProfileAccumulator ()=default
 Default constructor.
 
template<class OtherValueType>
 RootStyleProfileAccumulator (const RootStyleProfileAccumulator< OtherValueType > &other)
 Copy constructor from the instances with other types.
 
 RootStyleProfileAccumulator (ConstRef_t sumWV, ConstRef_t sumWV2, ConstRef_t sumW, ConstRef_t sumW2)
 Constructor from the external counters.
 
void operator() (ConstRef_t v)
 Inserts sample with 1. weight.
 
void operator() (const Weight_t &w, ConstRef_t v)
 Inserts sample with weight.
 
RootStyleProfileAccumulatoroperator+= (const RootStyleProfileAccumulator &rhs)
 Adds another accumulator.
 
RootStyleProfileAccumulatoroperator*= (ConstRef_t s) noexcept
 Scales all entries by value.
 
bool operator== (const RootStyleProfileAccumulator &rhs) const noexcept
 Equality operator.
 
bool operator!= (const RootStyleProfileAccumulator &rhs) const noexcept
 Non-equality operator.
 
ConstRef_t GetSumW () const noexcept
 Returns sum of weights.
 
ConstRef_t GetSumW2 () const noexcept
 Returns sum of weight squares.
 
ConstRef_t GetSumWV () const noexcept
 Returns sum of products of weight multiplied by value.
 
ConstRef_t GetSumWV2 () const noexcept
 Returns sum of products of weight multiplied by squared value.
 
Value_t GetMean () const noexcept
 Returns the mean value.
 
Value_t GetEffCount () const noexcept
 Returns effective sum of values.
 
Value_t GetVariance () const noexcept
 Returns variance.
 
Value_t GetStdDev () const noexcept
 Returns standard deviation of the sample.
 
Value_t GetSEM () const noexcept
 Returns standard error of the mean.
 

Private Member Functions

template<class Archive>
void serialize (Archive &ar, const unsigned int)
 Serialization rule.
 

Private Attributes

Value_t fSumWV {}
 Sum of weight * value.
 
Value_t fSumWV2 {}
 Sum of weight * value * value.
 
Value_t fSumW {}
 Sum of weights.
 
Value_t fSumW2 {}
 Sum of squared weights.
 

Friends

class boost::serialization::access
 

Detailed Description

template<class ValueType>
class boost::histogram::RootStyleProfileAccumulator< ValueType >

A ROOT-style accumulator for the Boost-histogram profiles.

Template Parameters
ValueTypeType of the values

Definition at line 25 of file Accumulators.h.

Member Typedef Documentation

◆ ConstRef_t

template<class ValueType>
using boost::histogram::RootStyleProfileAccumulator< ValueType >::ConstRef_t = const Value_t&

Definition at line 28 of file Accumulators.h.

◆ Value_t

template<class ValueType>
using boost::histogram::RootStyleProfileAccumulator< ValueType >::Value_t = ValueType

Definition at line 27 of file Accumulators.h.

◆ Weight_t

template<class ValueType>
using boost::histogram::RootStyleProfileAccumulator< ValueType >::Weight_t = weight_type<Value_t>

Definition at line 29 of file Accumulators.h.

Constructor & Destructor Documentation

◆ RootStyleProfileAccumulator() [1/3]

template<class ValueType>
boost::histogram::RootStyleProfileAccumulator< ValueType >::RootStyleProfileAccumulator ( )
default

Default constructor.

◆ RootStyleProfileAccumulator() [2/3]

template<class ValueType>
template<class OtherValueType>
boost::histogram::RootStyleProfileAccumulator< ValueType >::RootStyleProfileAccumulator ( const RootStyleProfileAccumulator< OtherValueType > & other)
inline

Copy constructor from the instances with other types.

Definition at line 36 of file Accumulators.h.

◆ RootStyleProfileAccumulator() [3/3]

template<class ValueType>
boost::histogram::RootStyleProfileAccumulator< ValueType >::RootStyleProfileAccumulator ( ConstRef_t sumWV,
ConstRef_t sumWV2,
ConstRef_t sumW,
ConstRef_t sumW2 )
inline

Constructor from the external counters.

Parameters
sumWVSum of weight * value
sumWVSum of weight * value * value
sumWSum of weights
sumW2Sum of weights

Definition at line 49 of file Accumulators.h.

Member Function Documentation

◆ GetEffCount()

template<class ValueType>
Value_t boost::histogram::RootStyleProfileAccumulator< ValueType >::GetEffCount ( ) const
inlinenoexcept

Returns effective sum of values.

Definition at line 118 of file Accumulators.h.

Referenced by boost::histogram::RootStyleProfileAccumulator< common_type_t< T, U > >::GetSEM().

◆ GetMean()

template<class ValueType>
Value_t boost::histogram::RootStyleProfileAccumulator< ValueType >::GetMean ( ) const
inlinenoexcept

Returns the mean value.

Definition at line 115 of file Accumulators.h.

Referenced by boost::histogram::RootStyleProfileAccumulator< common_type_t< T, U > >::GetVariance().

◆ GetSEM()

template<class ValueType>
Value_t boost::histogram::RootStyleProfileAccumulator< ValueType >::GetSEM ( ) const
inlinenoexcept

Returns standard error of the mean.

Definition at line 127 of file Accumulators.h.

◆ GetStdDev()

template<class ValueType>
Value_t boost::histogram::RootStyleProfileAccumulator< ValueType >::GetStdDev ( ) const
inlinenoexcept

Returns standard deviation of the sample.

Definition at line 124 of file Accumulators.h.

Referenced by boost::histogram::RootStyleProfileAccumulator< common_type_t< T, U > >::GetSEM().

◆ GetSumW()

template<class ValueType>
ConstRef_t boost::histogram::RootStyleProfileAccumulator< ValueType >::GetSumW ( ) const
inlinenoexcept

Returns sum of weights.

Definition at line 103 of file Accumulators.h.

◆ GetSumW2()

template<class ValueType>
ConstRef_t boost::histogram::RootStyleProfileAccumulator< ValueType >::GetSumW2 ( ) const
inlinenoexcept

Returns sum of weight squares.

Definition at line 106 of file Accumulators.h.

◆ GetSumWV()

template<class ValueType>
ConstRef_t boost::histogram::RootStyleProfileAccumulator< ValueType >::GetSumWV ( ) const
inlinenoexcept

Returns sum of products of weight multiplied by value.

Definition at line 109 of file Accumulators.h.

◆ GetSumWV2()

template<class ValueType>
ConstRef_t boost::histogram::RootStyleProfileAccumulator< ValueType >::GetSumWV2 ( ) const
inlinenoexcept

Returns sum of products of weight multiplied by squared value.

Definition at line 112 of file Accumulators.h.

◆ GetVariance()

template<class ValueType>
Value_t boost::histogram::RootStyleProfileAccumulator< ValueType >::GetVariance ( ) const
inlinenoexcept

◆ operator!=()

template<class ValueType>
bool boost::histogram::RootStyleProfileAccumulator< ValueType >::operator!= ( const RootStyleProfileAccumulator< ValueType > & rhs) const
inlinenoexcept

Non-equality operator.

Definition at line 100 of file Accumulators.h.

◆ operator()() [1/2]

template<class ValueType>
void boost::histogram::RootStyleProfileAccumulator< ValueType >::operator() ( const Weight_t & w,
ConstRef_t v )
inline

Inserts sample with weight.

Parameters
vSample
wSample weight

Definition at line 64 of file Accumulators.h.

◆ operator()() [2/2]

template<class ValueType>
void boost::histogram::RootStyleProfileAccumulator< ValueType >::operator() ( ConstRef_t v)
inline

Inserts sample with 1. weight.

Parameters
vSample

Definition at line 59 of file Accumulators.h.

Referenced by boost::histogram::RootStyleProfileAccumulator< common_type_t< T, U > >::operator()().

◆ operator*=()

template<class ValueType>
RootStyleProfileAccumulator & boost::histogram::RootStyleProfileAccumulator< ValueType >::operator*= ( ConstRef_t s)
inlinenoexcept

Scales all entries by value.

Definition at line 86 of file Accumulators.h.

◆ operator+=()

template<class ValueType>
RootStyleProfileAccumulator & boost::histogram::RootStyleProfileAccumulator< ValueType >::operator+= ( const RootStyleProfileAccumulator< ValueType > & rhs)
inline

Adds another accumulator.

Definition at line 73 of file Accumulators.h.

◆ operator==()

template<class ValueType>
bool boost::histogram::RootStyleProfileAccumulator< ValueType >::operator== ( const RootStyleProfileAccumulator< ValueType > & rhs) const
inlinenoexcept

◆ serialize()

template<class ValueType>
template<class Archive>
void boost::histogram::RootStyleProfileAccumulator< ValueType >::serialize ( Archive & ar,
const unsigned int  )
inlineprivate

Serialization rule.

Definition at line 133 of file Accumulators.h.

Friends And Related Symbol Documentation

◆ boost::serialization::access

template<class ValueType>
friend class boost::serialization::access
friend

Definition at line 130 of file Accumulators.h.

Member Data Documentation

◆ fSumW

template<class ValueType>
Value_t boost::histogram::RootStyleProfileAccumulator< ValueType >::fSumW {}
private

◆ fSumW2

template<class ValueType>
Value_t boost::histogram::RootStyleProfileAccumulator< ValueType >::fSumW2 {}
private

Sum of squared weights.

Definition at line 144 of file Accumulators.h.

Referenced by boost::histogram::RootStyleProfileAccumulator< common_type_t< T, U > >::operator+=().

◆ fSumWV

template<class ValueType>
Value_t boost::histogram::RootStyleProfileAccumulator< ValueType >::fSumWV {}
private

Sum of weight * value.

Definition at line 141 of file Accumulators.h.

Referenced by boost::histogram::RootStyleProfileAccumulator< common_type_t< T, U > >::operator+=().

◆ fSumWV2

template<class ValueType>
Value_t boost::histogram::RootStyleProfileAccumulator< ValueType >::fSumWV2 {}
private

Sum of weight * value * value.

Definition at line 142 of file Accumulators.h.

Referenced by boost::histogram::RootStyleProfileAccumulator< common_type_t< T, U > >::operator+=().


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