#include <Utility.h>
Classes | |
class | Params |
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_ |
sistrip::MeanAndStdDev::MeanAndStdDev | ( | ) |
void sistrip::MeanAndStdDev::add | ( | const float & | value, |
const float & | error | ||
) |
void sistrip::MeanAndStdDev::fit | ( | Params & | fit_params | ) |
Definition at line 104 of file Utility.cc.
References getHLTprescales::index, m, sistrip::MeanAndStdDev::Params::mean_, sistrip::MeanAndStdDev::Params::median_, sistrip::MeanAndStdDev::Params::rms_, python::multivaluedict::sort(), mathSSE::sqrt(), and lumiQTWidget::t.
{ if ( s_ > 0. ) { float m = x_/s_; float t = xx_/s_ - m*m; if ( t > 0. ) { t = sqrt(t); } else { t = 0.; } params.mean_ = m; params.rms_ = t; } if ( !vec_.empty() ) { sort( vec_.begin(), vec_.end() ); uint16_t index = vec_.size()%2 ? vec_.size()/2 : vec_.size()/2-1; params.median_ = vec_[index]; } }
float sistrip::MeanAndStdDev::s_ [private] |
std::vector<float> sistrip::MeanAndStdDev::vec_ [private] |
float sistrip::MeanAndStdDev::x_ [private] |
float sistrip::MeanAndStdDev::xx_ [private] |