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 count_t &R) const
 
bool operator< (const stats_t &R) const
 
bool operator== (const count_t &R) const
 
bool operator== (const stats_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

Definition at line 54 of file ErrorPropogationTypes.h.

54 : value(0), err2(1) {}

Referenced by stats_t< T >::from_relative_uncertainty2(), and stats_t< T >::inverse().

◆ stats_t() [2/3]

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

Definition at line 55 of file ErrorPropogationTypes.h.

55 : value(c()), err2(c.error2()) {}

◆ stats_t() [3/3]

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

Definition at line 56 of file ErrorPropogationTypes.h.

56 : value(q), err2(e2) {}

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.

107 { return err2; }

References stats_t< T >::err2.

Referenced by StripCPEgeometric::offset_from_firstStrip().

◆ from_relative_uncertainty2()

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

Definition at line 57 of file ErrorPropogationTypes.h.

57 { return stats_t(q, q * q * re2); }

References data-class-funcs::q, and stats_t< T >::stats_t().

Referenced by StripCPEgeometric::localParameters().

◆ inverse()

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

Definition at line 104 of file ErrorPropogationTypes.h.

104 { return stats_t(1. / value, err2 / pow(value, 4)); }

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

◆ operator()()

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

Definition at line 106 of file ErrorPropogationTypes.h.

106 { return value; }

References stats_t< T >::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.

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

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

◆ operator*=() [2/2]

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

Definition at line 93 of file ErrorPropogationTypes.h.

93  {
94  value *= r;
95  err2 *= r * r;
96  return *this;
97  }

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

◆ 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.

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

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

◆ operator+=() [2/2]

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

Definition at line 85 of file ErrorPropogationTypes.h.

85  {
86  value += r;
87  return *this;
88  }

References alignCSCRings::r.

◆ 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.

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

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

◆ operator-=() [2/2]

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

Definition at line 89 of file ErrorPropogationTypes.h.

89  {
90  value -= r;
91  return *this;
92  }

References alignCSCRings::r.

◆ 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.

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

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

◆ operator/=() [2/2]

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

Definition at line 98 of file ErrorPropogationTypes.h.

98  {
99  value /= r;
100  err2 /= r * r;
101  return *this;
102  }

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

◆ operator<() [1/2]

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

Definition at line 60 of file ErrorPropogationTypes.h.

60 { return value < R(); }

References dttmaxenums::R.

◆ operator<() [2/2]

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

Definition at line 59 of file ErrorPropogationTypes.h.

59 { return value < R.value; }

References dttmaxenums::R.

◆ operator==() [1/2]

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

Definition at line 62 of file ErrorPropogationTypes.h.

62 { return value == R() && err2 == R.error2(); }

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

◆ operator==() [2/2]

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

Definition at line 61 of file ErrorPropogationTypes.h.

61 { return value == R.value && err2 == R.err2; }

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

◆ relative_error()

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

Definition at line 109 of file ErrorPropogationTypes.h.

109 { return sqrt(err2) / value; }

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

◆ sigmaFrom()

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

Definition at line 110 of file ErrorPropogationTypes.h.

110 { return fabs(value - x) / error(); }

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

Member Data Documentation

◆ err2

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

◆ value

template<class T>
T stats_t< T >::value
private
data-class-funcs.q
q
Definition: data-class-funcs.py:169
DDAxes::x
stats_t::stats_t
stats_t()
Definition: ErrorPropogationTypes.h:54
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
stats_t::error
T error() const
Definition: ErrorPropogationTypes.h:108
value
Definition: value.py:1
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
alignCSCRings.r
r
Definition: alignCSCRings.py:93
stats_t::value
T value
Definition: ErrorPropogationTypes.h:51
funct::pow
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:30
stats_t::err2
T err2
Definition: ErrorPropogationTypes.h:51
dttmaxenums::R
Definition: DTTMax.h:29