CMS 3D CMS Logo

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

\Author Rick Wilkinson

Definition at line 12 of file CaloValidationStatistics.h.

Constructor & Destructor Documentation

◆ CaloValidationStatistics()

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

Definition at line 6 of file CaloValidationStatistics.cc.

7  : name_(name),
10  sum_(0.),
11  sumOfSquares_(0.),
12  weightedSum_(0.),
13  sumOfWeights_(0.),
14  n_(0) {}

◆ ~CaloValidationStatistics()

CaloValidationStatistics::~CaloValidationStatistics ( )

prints to LogInfo upon destruction

Definition at line 16 of file CaloValidationStatistics.cc.

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

Member Function Documentation

◆ addEntry()

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

◆ expectedMean()

float CaloValidationStatistics::expectedMean ( ) const
inline

Definition at line 28 of file CaloValidationStatistics.h.

28 { return expectedMean_; }

References expectedMean_.

◆ expectedRMS()

float CaloValidationStatistics::expectedRMS ( ) const
inline

Definition at line 30 of file CaloValidationStatistics.h.

30 { return expectedRMS_; }

References expectedRMS_.

◆ mean()

float CaloValidationStatistics::mean ( ) const

Definition at line 26 of file CaloValidationStatistics.cc.

26 { return sum_ / n_; }

References n_, and sum_.

◆ name()

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

Definition at line 20 of file CaloValidationStatistics.h.

20 { return name_; }

References name_.

Referenced by config.CFG::__str__(), and validation.Sample::digest().

◆ nEntries()

int CaloValidationStatistics::nEntries ( ) const
inline

Definition at line 32 of file CaloValidationStatistics.h.

32 { return n_; }

References n_.

◆ RMS()

float CaloValidationStatistics::RMS ( ) const

Definition at line 28 of file CaloValidationStatistics.cc.

28  {
29  float numerator = n_ * sumOfSquares_ - sum_ * sum_;
30  int denominator = n_ * (n_ - 1);
32 }

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

◆ weightedMean()

float CaloValidationStatistics::weightedMean ( ) const

Definition at line 34 of file CaloValidationStatistics.cc.

34 { return weightedSum_ / sumOfWeights_; }

References sumOfWeights_, and weightedSum_.

Member Data Documentation

◆ expectedMean_

float CaloValidationStatistics::expectedMean_
private

Definition at line 36 of file CaloValidationStatistics.h.

Referenced by expectedMean().

◆ expectedRMS_

float CaloValidationStatistics::expectedRMS_
private

Definition at line 37 of file CaloValidationStatistics.h.

Referenced by expectedRMS().

◆ n_

int CaloValidationStatistics::n_
private

Definition at line 42 of file CaloValidationStatistics.h.

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

◆ name_

std::string CaloValidationStatistics::name_
private

Definition at line 35 of file CaloValidationStatistics.h.

Referenced by name().

◆ sum_

float CaloValidationStatistics::sum_
private

Definition at line 38 of file CaloValidationStatistics.h.

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

◆ sumOfSquares_

float CaloValidationStatistics::sumOfSquares_
private

Definition at line 39 of file CaloValidationStatistics.h.

Referenced by addEntry(), and RMS().

◆ sumOfWeights_

float CaloValidationStatistics::sumOfWeights_
private

Definition at line 41 of file CaloValidationStatistics.h.

Referenced by addEntry(), and weightedMean().

◆ weightedSum_

float CaloValidationStatistics::weightedSum_
private

Definition at line 40 of file CaloValidationStatistics.h.

Referenced by addEntry(), and weightedMean().

CaloValidationStatistics::sumOfSquares_
float sumOfSquares_
Definition: CaloValidationStatistics.h:39
mps_merge.weight
weight
Definition: mps_merge.py:88
CaloValidationStatistics::name_
std::string name_
Definition: CaloValidationStatistics.h:35
CaloValidationStatistics::expectedRMS_
float expectedRMS_
Definition: CaloValidationStatistics.h:37
CaloValidationStatistics::sumOfWeights_
float sumOfWeights_
Definition: CaloValidationStatistics.h:41
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
CaloValidationStatistics::n_
int n_
Definition: CaloValidationStatistics.h:42
CaloValidationStatistics::sum_
float sum_
Definition: CaloValidationStatistics.h:38
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
value
Definition: value.py:1
CaloValidationStatistics::expectedMean
float expectedMean() const
Definition: CaloValidationStatistics.h:28
HLTTauDQMOffline_cfi.numerator
numerator
Definition: HLTTauDQMOffline_cfi.py:179
CaloValidationStatistics::expectedRMS
float expectedRMS() const
Definition: CaloValidationStatistics.h:30
HLTTauDQMOffline_cfi.denominator
denominator
Definition: HLTTauDQMOffline_cfi.py:180
relativeConstraints.value
value
Definition: relativeConstraints.py:53
CaloValidationStatistics::name
std::string name() const
Definition: CaloValidationStatistics.h:20
CaloValidationStatistics::expectedMean_
float expectedMean_
Definition: CaloValidationStatistics.h:36
CaloValidationStatistics::weightedSum_
float weightedSum_
Definition: CaloValidationStatistics.h:40