CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
stats_t< T > Class Template Reference

#include <ErrorPropogationTypes.h>

Inheritance diagram for stats_t< T >:

Public Member Functions

T error () const
 
T error2 () const
 
stats_t inverse () const
 
T operator() () const
 
stats_t operator*= (const stats_t &R)
 
stats_t operator*= (const T &r)
 
stats_t operator+= (const stats_t &R)
 
stats_t operator+= (const T &r)
 
stats_t operator-= (const stats_t &R)
 
stats_t operator-= (const T &r)
 
stats_t operator/= (const stats_t &R)
 
stats_t operator/= (const T &r)
 
bool operator< (const stats_t &R) const
 
bool operator< (const count_t &R) const
 
bool operator== (const stats_t &R) const
 
bool operator== (const count_t &R) const
 
T relative_error () const
 
T sigmaFrom (const T &x) const
 
 stats_t ()
 
 stats_t (count_t c)
 
 stats_t (T q, T e2)
 

Static Public Member Functions

static stats_t from_relative_uncertainty2 (T q, T re2)
 

Private Attributes

T err2
 
T value
 

Detailed Description

template<class T>
class stats_t< T >

Definition at line 38 of file ErrorPropogationTypes.h.

Constructor & Destructor Documentation

◆ stats_t() [1/3]

template<class T>
stats_t< T >::stats_t ( )
inline

◆ stats_t() [2/3]

template<class T>
stats_t< T >::stats_t ( count_t  c)
inline

◆ stats_t() [3/3]

template<class T>
stats_t< T >::stats_t ( T  q,
T  e2 
)
inline

Member Function Documentation

◆ error()

template<class T>
T stats_t< T >::error ( ) const
inline

◆ error2()

template<class T>
T stats_t< T >::error2 ( ) const
inline

Definition at line 107 of file ErrorPropogationTypes.h.

References stats_t< T >::err2.

Referenced by StripCPEgeometric::offset_from_firstStrip().

107 { return err2; }

◆ from_relative_uncertainty2()

template<class T>
static stats_t stats_t< T >::from_relative_uncertainty2 ( T  q,
T  re2 
)
inlinestatic

◆ inverse()

template<class T>
stats_t stats_t< T >::inverse ( ) const
inline

Definition at line 104 of file ErrorPropogationTypes.h.

References stats_t< T >::err2, funct::pow(), and stats_t< T >::stats_t().

104 { return stats_t(1. / value, err2 / pow(value, 4)); }
Definition: value.py:1
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29

◆ operator()()

template<class T>
T stats_t< T >::operator() ( ) const
inline

Definition at line 106 of file ErrorPropogationTypes.h.

References stats_t< T >::value.

106 { return value; }

◆ operator*=() [1/2]

template<class T>
stats_t stats_t< T >::operator*= ( const stats_t< T > &  R)
inline

Definition at line 74 of file ErrorPropogationTypes.h.

References stats_t< T >::err2, and dttmaxenums::R.

74  {
75  err2 = R.err2 * value * value + err2 * R.value * R.value;
76  value *= R.value;
77  return *this;
78  }
Definition: value.py:1

◆ operator*=() [2/2]

template<class T>
stats_t stats_t< T >::operator*= ( const T r)
inline

Definition at line 93 of file ErrorPropogationTypes.h.

References stats_t< T >::err2, and alignCSCRings::r.

93  {
94  value *= r;
95  err2 *= r * r;
96  return *this;
97  }
Definition: value.py:1

◆ operator+=() [1/2]

template<class T>
stats_t stats_t< T >::operator+= ( const stats_t< T > &  R)
inline

Definition at line 64 of file ErrorPropogationTypes.h.

References stats_t< T >::err2, and dttmaxenums::R.

64  {
65  value += R.value;
66  err2 += R.err2;
67  return *this;
68  }
Definition: value.py:1

◆ operator+=() [2/2]

template<class T>
stats_t stats_t< T >::operator+= ( const T r)
inline

Definition at line 85 of file ErrorPropogationTypes.h.

References alignCSCRings::r.

85  {
86  value += r;
87  return *this;
88  }
Definition: value.py:1

◆ operator-=() [1/2]

template<class T>
stats_t stats_t< T >::operator-= ( const stats_t< T > &  R)
inline

Definition at line 69 of file ErrorPropogationTypes.h.

References stats_t< T >::err2, and dttmaxenums::R.

69  {
70  value -= R.value;
71  err2 += R.err2;
72  return *this;
73  }
Definition: value.py:1

◆ operator-=() [2/2]

template<class T>
stats_t stats_t< T >::operator-= ( const T r)
inline

Definition at line 89 of file ErrorPropogationTypes.h.

References alignCSCRings::r.

89  {
90  value -= r;
91  return *this;
92  }
Definition: value.py:1

◆ operator/=() [1/2]

template<class T>
stats_t stats_t< T >::operator/= ( const stats_t< T > &  R)
inline

Definition at line 79 of file ErrorPropogationTypes.h.

References stats_t< T >::err2, and dttmaxenums::R.

79  {
80  value /= R.value;
81  err2 = (err2 + value * value * R.err2) / (R.value * R.value);
82  return *this;
83  }
Definition: value.py:1

◆ operator/=() [2/2]

template<class T>
stats_t stats_t< T >::operator/= ( const T r)
inline

Definition at line 98 of file ErrorPropogationTypes.h.

References stats_t< T >::err2, and alignCSCRings::r.

98  {
99  value /= r;
100  err2 /= r * r;
101  return *this;
102  }
Definition: value.py:1

◆ operator<() [1/2]

template<class T>
bool stats_t< T >::operator< ( const stats_t< T > &  R) const
inline

Definition at line 59 of file ErrorPropogationTypes.h.

References dttmaxenums::R.

59 { return value < R.value; }
Definition: value.py:1

◆ operator<() [2/2]

template<class T>
bool stats_t< T >::operator< ( const count_t R) const
inline

Definition at line 60 of file ErrorPropogationTypes.h.

References dttmaxenums::R.

60 { return value < R(); }
Definition: value.py:1

◆ operator==() [1/2]

template<class T>
bool stats_t< T >::operator== ( const stats_t< T > &  R) const
inline

Definition at line 61 of file ErrorPropogationTypes.h.

References stats_t< T >::err2, and dttmaxenums::R.

61 { return value == R.value && err2 == R.err2; }
Definition: value.py:1

◆ operator==() [2/2]

template<class T>
bool stats_t< T >::operator== ( const count_t R) const
inline

Definition at line 62 of file ErrorPropogationTypes.h.

References stats_t< T >::err2, and dttmaxenums::R.

62 { return value == R() && err2 == R.error2(); }
Definition: value.py:1

◆ relative_error()

template<class T>
T stats_t< T >::relative_error ( ) const
inline

Definition at line 109 of file ErrorPropogationTypes.h.

References stats_t< T >::err2, mathSSE::sqrt(), and stats_t< T >::value.

109 { return sqrt(err2) / value; }
T sqrt(T t)
Definition: SSEVec.h:19

◆ sigmaFrom()

template<class T>
T stats_t< T >::sigmaFrom ( const T x) const
inline

Definition at line 110 of file ErrorPropogationTypes.h.

References stats_t< T >::error(), and x.

110 { return fabs(value - x) / error(); }
Definition: value.py:1

Member Data Documentation

◆ err2

template<class T>
T stats_t< T >::err2
private

◆ value

template<class T>
T stats_t< T >::value
private