#include <DQM/SiStripCommissioningAnalysis/src/Utility.h>
Public Member Functions | |
void | add (const float &value, const float &error) |
void | fit (Params &fit_params) |
MeanAndStdDev () | |
~MeanAndStdDev () | |
Private Attributes | |
float | s_ |
std::vector< float > | vec_ |
float | x_ |
float | xx_ |
Classes | |
class | Params |
Definition at line 55 of file Utility.h.
sistrip::MeanAndStdDev::MeanAndStdDev | ( | ) |
sistrip::MeanAndStdDev::~MeanAndStdDev | ( | ) | [inline] |
void sistrip::MeanAndStdDev::add | ( | const float & | value, | |
const float & | error | |||
) |
Definition at line 86 of file Utility.cc.
References s_, funct::sqrt(), vec_, x_, and xx_.
00087 { 00088 if ( e > 0. ) { 00089 float wt = 1. / sqrt(e); 00090 s_ += wt; 00091 x_ += x*wt; 00092 xx_ += x*x*wt; 00093 } else { 00094 s_++; 00095 x_ += x; 00096 xx_ += x*x; 00097 } 00098 vec_.push_back(x); 00099 }
Definition at line 103 of file Utility.cc.
References index, m, sistrip::MeanAndStdDev::Params::mean_, sistrip::MeanAndStdDev::Params::median_, sistrip::MeanAndStdDev::Params::rms_, s_, python::multivaluedict::sort(), funct::sqrt(), t, vec_, x_, and xx_.
00103 { 00104 if ( s_ > 0. ) { 00105 float m = x_/s_; 00106 float t = xx_/s_ - m*m; 00107 if ( t > 0. ) { t = sqrt(t); } 00108 else { t = 0.; } 00109 params.mean_ = m; 00110 params.rms_ = t; 00111 } 00112 if ( !vec_.empty() ) { 00113 sort( vec_.begin(), vec_.end() ); 00114 uint16_t index = vec_.size()%2 ? vec_.size()/2 : vec_.size()/2-1; 00115 params.median_ = vec_[index]; 00116 } 00117 }
float sistrip::MeanAndStdDev::s_ [private] |
std::vector<float> sistrip::MeanAndStdDev::vec_ [private] |
float sistrip::MeanAndStdDev::x_ [private] |
float sistrip::MeanAndStdDev::xx_ [private] |