CMS 3D CMS Logo

Public Member Functions | Private Attributes

CaloValidationStatistics Class Reference

#include <CaloValidationStatistics.h>

List of all members.

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_

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.

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

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

{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.

References n_, and sum_.

Referenced by operator<<().

                                           {
  return sum_/n_;
}
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_;
}

Member Data Documentation

Definition at line 38 of file CaloValidationStatistics.h.

Referenced by expectedMean().

Definition at line 39 of file CaloValidationStatistics.h.

Referenced by expectedRMS().

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

Definition at line 40 of file CaloValidationStatistics.h.

Referenced by addEntry(), mean(), and RMS().

Definition at line 41 of file CaloValidationStatistics.h.

Referenced by addEntry(), and RMS().

Definition at line 43 of file CaloValidationStatistics.h.

Referenced by addEntry(), and weightedMean().

Definition at line 42 of file CaloValidationStatistics.h.

Referenced by addEntry(), and weightedMean().