CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 33 of file ErrorPropogationTypes.h.

Constructor & Destructor Documentation

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

Definition at line 44 of file ErrorPropogationTypes.h.

44 : value(c()), err2(c.error2()) {}
unsigned long error2() const
template<class T>
stats_t< T >::stats_t ( T  q,
T  e2 
)
inline

Definition at line 45 of file ErrorPropogationTypes.h.

Member Function Documentation

template<class T>
T stats_t< T >::error ( ) const
inline
template<class T>
T stats_t< T >::error2 ( ) const
inline
template<class T>
static stats_t stats_t< T >::from_relative_uncertainty2 ( T  q,
T  re2 
)
inlinestatic

Definition at line 46 of file ErrorPropogationTypes.h.

References stats_t< T >::stats_t().

Referenced by StripCPEgeometric::localParameters().

46 { return stats_t(q,q*q*re2);}
template<class T>
stats_t stats_t< T >::inverse ( ) const
inline

Definition at line 63 of file ErrorPropogationTypes.h.

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

63 { return stats_t(1./value, err2/pow(value,4));}
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
template<class T>
T stats_t< T >::operator() ( ) const
inline

Definition at line 65 of file ErrorPropogationTypes.h.

References stats_t< T >::value.

65 {return value;}
template<class T>
stats_t stats_t< T >::operator*= ( const stats_t< T > &  R)
inline

Definition at line 55 of file ErrorPropogationTypes.h.

References stats_t< T >::err2, and stats_t< T >::value.

55 { err2 = R.err2*value*value + err2*R.value*R.value; value *= R.value; return *this;}
template<class T>
stats_t stats_t< T >::operator*= ( const T r)
inline

Definition at line 60 of file ErrorPropogationTypes.h.

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

60 { value *= r; err2 *= r*r; return *this;}
template<class T>
stats_t stats_t< T >::operator+= ( const stats_t< T > &  R)
inline

Definition at line 53 of file ErrorPropogationTypes.h.

References stats_t< T >::err2, and stats_t< T >::value.

53 { value += R.value; err2 += R.err2; return *this;}
template<class T>
stats_t stats_t< T >::operator+= ( const T r)
inline

Definition at line 58 of file ErrorPropogationTypes.h.

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

58 { value += r; return *this;}
template<class T>
stats_t stats_t< T >::operator-= ( const stats_t< T > &  R)
inline

Definition at line 54 of file ErrorPropogationTypes.h.

References stats_t< T >::err2, and stats_t< T >::value.

54 { value -= R.value; err2 += R.err2; return *this;}
template<class T>
stats_t stats_t< T >::operator-= ( const T r)
inline

Definition at line 59 of file ErrorPropogationTypes.h.

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

59 { value -= r; return *this;}
template<class T>
stats_t stats_t< T >::operator/= ( const stats_t< T > &  R)
inline

Definition at line 56 of file ErrorPropogationTypes.h.

References stats_t< T >::err2, and stats_t< T >::value.

56 { value /= R.value; err2 = (err2 + value*value*R.err2) / (R.value*R.value); return *this;}
template<class T>
stats_t stats_t< T >::operator/= ( const T r)
inline

Definition at line 61 of file ErrorPropogationTypes.h.

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

61 { value /= r; err2 /= r*r; return *this;}
template<class T>
bool stats_t< T >::operator< ( const stats_t< T > &  R) const
inline

Definition at line 48 of file ErrorPropogationTypes.h.

References stats_t< T >::value.

48 { return value < R.value ;}
template<class T>
bool stats_t< T >::operator< ( const count_t R) const
inline

Definition at line 49 of file ErrorPropogationTypes.h.

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

49 { return value < R() ;}
template<class T>
bool stats_t< T >::operator== ( const stats_t< T > &  R) const
inline

Definition at line 50 of file ErrorPropogationTypes.h.

References stats_t< T >::err2, and stats_t< T >::value.

50 { return value == R.value && err2 == R.err2;}
template<class T>
bool stats_t< T >::operator== ( const count_t R) const
inline

Definition at line 51 of file ErrorPropogationTypes.h.

References stats_t< T >::err2, count_t::error2(), dttmaxenums::R, and stats_t< T >::value.

51 { return value == R() && err2 == R.error2();}
unsigned long error2() const
template<class T>
T stats_t< T >::relative_error ( ) const
inline

Definition at line 68 of file ErrorPropogationTypes.h.

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

68 {return sqrt(err2)/value;}
T sqrt(T t)
Definition: SSEVec.h:48
template<class T>
T stats_t< T >::sigmaFrom ( const T x) const
inline

Definition at line 69 of file ErrorPropogationTypes.h.

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

69 {return fabs(value-x)/error();}
T error() const
Definition: DDAxes.h:10

Member Data Documentation

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