CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
CaloValidationStatistics Class Reference

#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 More...
 

Private Attributes

float expectedMean_
 
float expectedRMS_
 
int n_
 
std::string name_
 
float sum_
 
float sumOfSquares_
 
float sumOfWeights_
 
float weightedSum_
 

Detailed Description

For validation purposes. This program calculates mean and RMS of a distribution

Rick Wilkinson

Definition at line 12 of file CaloValidationStatistics.h.

Constructor & Destructor Documentation

CaloValidationStatistics::CaloValidationStatistics ( std::string  name,
float  expectedMean,
float  expectedRMS 
)
CaloValidationStatistics::~CaloValidationStatistics ( )

prints to LogInfo upon destruction

Definition at line 19 of file CaloValidationStatistics.cc.

20 {
21  edm::LogInfo("CaloValidationStatistics") << *this;
22 }

Member Function Documentation

void CaloValidationStatistics::addEntry ( float  value,
float  weight = 1. 
)
float CaloValidationStatistics::expectedMean ( ) const
inline

Definition at line 29 of file CaloValidationStatistics.h.

References expectedMean_.

Referenced by operator<<().

float CaloValidationStatistics::expectedRMS ( ) const
inline

Definition at line 31 of file CaloValidationStatistics.h.

References expectedRMS_.

Referenced by operator<<().

float CaloValidationStatistics::mean ( ) const

Definition at line 33 of file CaloValidationStatistics.cc.

References n_, and sum_.

Referenced by operator<<().

std::string CaloValidationStatistics::name ( void  ) const
inline
int CaloValidationStatistics::nEntries ( ) const
inline

Definition at line 33 of file CaloValidationStatistics.h.

References n_.

Referenced by operator<<().

float CaloValidationStatistics::RMS ( ) const

Definition at line 38 of file CaloValidationStatistics.cc.

References cuy::denominator, n_, cuy::numerator, mathSSE::sqrt(), sum_, and sumOfSquares_.

Referenced by operator<<().

38  {
39  float numerator = n_ * sumOfSquares_ - sum_*sum_;
40  int denominator = n_ * (n_-1);
41  return std::sqrt(numerator/denominator);
42 }
list numerator
Definition: cuy.py:483
list denominator
Definition: cuy.py:484
T sqrt(T t)
Definition: SSEVec.h:48
float CaloValidationStatistics::weightedMean ( ) const

Definition at line 45 of file CaloValidationStatistics.cc.

References sumOfWeights_, and weightedSum_.

Member Data Documentation

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().