#include <Rtypes.h>#include <TMath.h>#include <iostream>#include <fstream>Go to the source code of this file.
Classes | |
| class | ValueErr< T > |
Typedefs | |
| typedef ValueErr< double > | DoubleErr |
| typedef ValueErr< float > | FloatErr |
Functions | |
| template<class T> | |
| std::ifstream & | operator>> (std::ifstream &ins, ValueErr< T > &x) |
| template<class T> | |
| std::ostream & | operator<< (std::ostream &outs, const ValueErr< T > &x) |
| template<class T> | |
| ValueErr< T > | operator+ (const T &lhs, const ValueErr< T > &rhs) |
| template<class T> | |
| ValueErr< T > | operator+ (const ValueErr< T > &lhs, const T &rhs) |
| template<class T> | |
| ValueErr< T > | operator+ (const ValueErr< T > &lhs, const ValueErr< T > &rhs) |
| template<class T> | |
| ValueErr< T > | operator- (const T &lhs, const ValueErr< T > &rhs) |
| template<class T> | |
| ValueErr< T > | operator- (const ValueErr< T > &lhs, const T &rhs) |
| template<class T> | |
| ValueErr< T > | operator- (const ValueErr< T > &lhs, const ValueErr< T > &rhs) |
| template<class T> | |
| ValueErr< T > | operator * (const T &lhs, const ValueErr< T > &rhs) |
| template<class T> | |
| ValueErr< T > | operator * (const ValueErr< T > &lhs, const T &rhs) |
| template<class T> | |
| ValueErr< T > | operator * (const ValueErr< T > &lhs, const ValueErr< T > &rhs) |
| template<class T> | |
| ValueErr< T > | operator/ (const T &lhs, const ValueErr< T > &rhs) |
| template<class T> | |
| ValueErr< T > | operator/ (const ValueErr< T > &lhs, const T &rhs) |
| template<class T> | |
| ValueErr< T > | operator/ (const ValueErr< T > &lhs, const ValueErr< T > &rhs) |
Variables | |
| const float | kValueErr_Big = 1e19 |
|
|
|
||||||||||||||||
|
Definition at line 167 of file RootUtil/ValueErr.h. References ValueErr< T >::GetFracError2(), ValueErr< T >::GetValue(), and ValueErr< T >::valueErr2(). 00168 {
00169 T x = lhs.GetValue() * rhs.GetValue();
00170 T err2;
00171 if(x!=0)
00172 err2 = x*x * ( lhs.GetFracError2() + rhs.GetFracError2() );
00173 else
00174 err2 = kValueErr_Big; // FIXME: could use some presciption here.
00175 return ValueErr<T>::valueErr2(x,err2);
00176 }
|
|
||||||||||||||||
|
Definition at line 163 of file RootUtil/ValueErr.h. References ValueErr< T >::GetError(), ValueErr< T >::GetValue(), and ValueErr< T >::valueErr2(). 00164 { return ValueErr<T>::valueErr2(lhs.GetValue() * rhs, lhs.GetError()*rhs*rhs); }
|
|
||||||||||||||||
|
Definition at line 159 of file RootUtil/ValueErr.h. References ValueErr< T >::GetError2(), ValueErr< T >::GetValue(), and ValueErr< T >::valueErr2(). 00160 { return ValueErr<T>::valueErr2(lhs * rhs.GetValue(), rhs.GetError2()*lhs*lhs); }
|
|
||||||||||||||||
|
Definition at line 133 of file RootUtil/ValueErr.h. References ValueErr< T >::GetError2(), ValueErr< T >::GetValue(), and ValueErr< T >::valueErr2(). 00134 {
00135 T value = ( lhs.GetValue() + rhs.GetValue());
00136 T err2 = ( lhs.GetError2() + rhs.GetError2() );
00137 return ValueErr<T>::valueErr2(value,err2);
00138 }
|
|
||||||||||||||||
|
Definition at line 129 of file RootUtil/ValueErr.h. References ValueErr< T >::GetError2(), ValueErr< T >::GetValue(), and ValueErr< T >::valueErr2(). 00130 { return ValueErr<T>::valueErr2(lhs.GetValue() + rhs, lhs.GetError2()); }
|
|
||||||||||||||||
|
Definition at line 125 of file RootUtil/ValueErr.h. References ValueErr< T >::GetError2(), ValueErr< T >::GetValue(), and ValueErr< T >::valueErr2(). 00126 { return ValueErr<T>::valueErr2(lhs + rhs.GetValue(), rhs.GetError2()); }
|
|
||||||||||||||||
|
Definition at line 150 of file RootUtil/ValueErr.h. References ValueErr< T >::GetError2(), ValueErr< T >::GetValue(), and ValueErr< T >::valueErr2(). 00151 {
00152 T value = ( lhs.GetValue() - rhs.GetValue() );
00153 T err2 = ( lhs.GetError2() + rhs.GetError2());
00154 return ValueErr<T>::valueErr2(value,err2);
00155 }
|
|
||||||||||||||||
|
Definition at line 146 of file RootUtil/ValueErr.h. References ValueErr< T >::GetError2(), ValueErr< T >::GetValue(), and ValueErr< T >::valueErr2(). 00147 { return ValueErr<T>::valueErr2(lhs.GetValue() - rhs, lhs.GetError2()); }
|
|
||||||||||||||||
|
Definition at line 142 of file RootUtil/ValueErr.h. References ValueErr< T >::GetError2(), ValueErr< T >::GetValue(), and ValueErr< T >::valueErr2(). 00143 { return ValueErr<T>::valueErr2(lhs - rhs.GetValue(), rhs.GetError2()); }
|
|
||||||||||||||||
|
Definition at line 189 of file RootUtil/ValueErr.h. References ValueErr< T >::GetError2(), ValueErr< T >::GetValue(), and ValueErr< T >::valueErr2(). 00190 {
00191 // Note: doesn't trap rhs=0 (i.e. divide-by-zero)
00192 T x = lhs.GetValue();
00193 T y = rhs.GetValue();
00194 T f = x/y;
00195 T y2 = y*y;
00196 T x2 = x*x;
00197 // err = x/y * sqrt( dx2/x2 + dy2/y2) // This works, but has a div-by-zero for x=0
00198 T err2 = ( lhs.GetError2()/y2 + rhs.GetError2()*x2/(y2*y2) ); // This is ok for y!=0
00199
00200 return ValueErr<T>::valueErr2(f,err2);
00201 }
|
|
||||||||||||||||
|
Definition at line 185 of file RootUtil/ValueErr.h. References ValueErr< T >::GetError2(), ValueErr< T >::GetValue(), and ValueErr< T >::valueErr2(). 00186 { return ValueErr<T>::valueErr2(lhs.GetValue() / rhs, lhs.GetError2()/(rhs*rhs)); }
|
|
||||||||||||||||
|
Definition at line 181 of file RootUtil/ValueErr.h. References ValueErr< T >::GetError2(), ValueErr< T >::GetValue(), ValueErr< T >::GetValue2(), and ValueErr< T >::valueErr2(). 00182 { return ValueErr<T>::valueErr2(lhs / rhs.GetValue(), lhs * lhs * rhs.GetError2() / (rhs.GetValue2()*rhs.GetValue2() )); }
|
|
||||||||||||||||
|
Definition at line 28 of file Calibrator/ValueErr.cxx. References ValueErr< T >::GetError(), ValueErr< T >::GetValue(), and kPlusMinus. 00029 {
00030 outs << x.GetValue() << kPlusMinus << x.GetError();
00031 return outs;
00032 }
|
|
||||||||||||||||
|
Definition at line 17 of file Calibrator/ValueErr.cxx. References ValueErr< T >::Set(). 00018 {
00019 T value;
00020 T error;
00021 ins >> value >> error;
00022 x.Set(value,error);
00023 return ins;
00024 }
|
|
|
Definition at line 26 of file RootUtil/ValueErr.h. |
1.3.9.1