#include <CaloValidationStatistics.h>
Public Member Functions | |
void | addEntry (float value, float weight=1.) |
CaloValidationStatistics (std::string name, float expectedMean, float expectedRMS) | |
float | expectedMean () const |
float | expectedRMS () const |
float | mean () const |
std::string | name () const |
int | nEntries () const |
float | RMS () const |
float | weightedMean () const |
~CaloValidationStatistics () | |
prints to LogInfo upon destruction | |
Private Attributes | |
float | expectedMean_ |
float | expectedRMS_ |
int | n_ |
std::string | name_ |
float | sum_ |
float | sumOfSquares_ |
float | sumOfWeights_ |
float | weightedSum_ |
For validation purposes. This program calculates mean and RMS of a distribution
Rick Wilkinson
Definition at line 12 of file CaloValidationStatistics.h.
CaloValidationStatistics::CaloValidationStatistics | ( | std::string | name, |
float | expectedMean, | ||
float | expectedRMS | ||
) |
Definition at line 6 of file CaloValidationStatistics.cc.
: name_(name), expectedMean_(expectedMean), expectedRMS_(expectedRMS), sum_(0.), sumOfSquares_(0.), weightedSum_(0.), sumOfWeights_(0.), n_(0) { }
CaloValidationStatistics::~CaloValidationStatistics | ( | ) |
prints to LogInfo upon destruction
Definition at line 19 of file CaloValidationStatistics.cc.
{ edm::LogInfo("CaloValidationStatistics") << *this; }
void CaloValidationStatistics::addEntry | ( | float | value, |
float | weight = 1. |
||
) |
Definition at line 24 of file CaloValidationStatistics.cc.
References n_, sum_, sumOfSquares_, sumOfWeights_, relativeConstraints::value, CommonMethods::weight(), and weightedSum_.
Referenced by HcalDigiStatistics::analyze(), CastorDigiStatistics::analyze(), and CaloHitAnalyzer::analyze().
{ sum_ += value; sumOfSquares_ += (value*value); weightedSum_ += value*weight; sumOfWeights_ += weight; ++n_; }
float CaloValidationStatistics::expectedMean | ( | ) | const [inline] |
Definition at line 29 of file CaloValidationStatistics.h.
References expectedMean_.
Referenced by operator<<().
{return expectedMean_;}
float CaloValidationStatistics::expectedRMS | ( | ) | const [inline] |
Definition at line 31 of file CaloValidationStatistics.h.
References expectedRMS_.
Referenced by operator<<().
{return expectedRMS_;}
float CaloValidationStatistics::mean | ( | ) | const |
Definition at line 33 of file CaloValidationStatistics.cc.
Referenced by operator<<().
std::string CaloValidationStatistics::name | ( | void | ) | const [inline] |
Definition at line 21 of file CaloValidationStatistics.h.
References name_.
Referenced by operator<<().
{return name_;}
int CaloValidationStatistics::nEntries | ( | ) | const [inline] |
Definition at line 33 of file CaloValidationStatistics.h.
References n_.
Referenced by operator<<().
{return n_;}
float CaloValidationStatistics::RMS | ( | ) | const |
Definition at line 38 of file CaloValidationStatistics.cc.
References RecoTauValidation_cfi::denominator, n_, mathSSE::sqrt(), sum_, and sumOfSquares_.
Referenced by operator<<().
{ float numerator = n_ * sumOfSquares_ - sum_*sum_; int denominator = n_ * (n_-1); return std::sqrt(numerator/denominator); }
float CaloValidationStatistics::weightedMean | ( | ) | const |
Definition at line 45 of file CaloValidationStatistics.cc.
References sumOfWeights_, and weightedSum_.
{ return weightedSum_ / sumOfWeights_; }
float CaloValidationStatistics::expectedMean_ [private] |
Definition at line 38 of file CaloValidationStatistics.h.
Referenced by expectedMean().
float CaloValidationStatistics::expectedRMS_ [private] |
Definition at line 39 of file CaloValidationStatistics.h.
Referenced by expectedRMS().
int CaloValidationStatistics::n_ [private] |
Definition at line 44 of file CaloValidationStatistics.h.
Referenced by addEntry(), mean(), nEntries(), and RMS().
std::string CaloValidationStatistics::name_ [private] |
Definition at line 37 of file CaloValidationStatistics.h.
Referenced by name().
float CaloValidationStatistics::sum_ [private] |
Definition at line 40 of file CaloValidationStatistics.h.
Referenced by addEntry(), mean(), and RMS().
float CaloValidationStatistics::sumOfSquares_ [private] |
Definition at line 41 of file CaloValidationStatistics.h.
Referenced by addEntry(), and RMS().
float CaloValidationStatistics::sumOfWeights_ [private] |
Definition at line 43 of file CaloValidationStatistics.h.
Referenced by addEntry(), and weightedMean().
float CaloValidationStatistics::weightedSum_ [private] |
Definition at line 42 of file CaloValidationStatistics.h.
Referenced by addEntry(), and weightedMean().