ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
MuonCalib::MeanRMS Class Reference

#include <MeanRMS.h>

Collaboration diagram for MuonCalib::MeanRMS:

Public Member Functions

 MeanRMS ()
 
void Insert (double x)
 
double GetMean () const
 
double GetRMS () const
 
int GetN () const
 

Private Attributes

double m_sum_x
 
double m_sum_x_sq
 
int m_n_ent
 

Detailed Description

Definition at line 9 of file MeanRMS.h.

Constructor & Destructor Documentation

◆ MeanRMS()

MuonCalib::MeanRMS::MeanRMS ( )
inline

Definition at line 11 of file MeanRMS.h.

11 : m_sum_x(0.), m_sum_x_sq(0.), m_n_ent(0) {}

Member Function Documentation

◆ GetMean()

double MuonCalib::MeanRMS::GetMean ( ) const
inline

Definition at line 17 of file MeanRMS.h.

17  {
18  if (m_n_ent == 0) return 0;
19  return m_sum_x / static_cast<double>(m_n_ent);
20  }

◆ GetN()

int MuonCalib::MeanRMS::GetN ( ) const
inline

Definition at line 26 of file MeanRMS.h.

26 { return m_n_ent; }

◆ GetRMS()

double MuonCalib::MeanRMS::GetRMS ( ) const
inline

Definition at line 21 of file MeanRMS.h.

21  {
22  if (m_n_ent == 0) return 0;
23  double mean = GetMean();
24  return std::sqrt(m_sum_x_sq / static_cast<double>(m_n_ent) - mean * mean);
25  }

◆ Insert()

void MuonCalib::MeanRMS::Insert ( double  x)
inline

Definition at line 12 of file MeanRMS.h.

12  {
13  m_sum_x += x;
14  m_sum_x_sq += x * x;
15  m_n_ent++;
16  }

Member Data Documentation

◆ m_n_ent

int MuonCalib::MeanRMS::m_n_ent
private

Definition at line 31 of file MeanRMS.h.

◆ m_sum_x

double MuonCalib::MeanRMS::m_sum_x
private

Definition at line 29 of file MeanRMS.h.

◆ m_sum_x_sq

double MuonCalib::MeanRMS::m_sum_x_sq
private

Definition at line 30 of file MeanRMS.h.


The documentation for this class was generated from the following file:
mean
void mean(std::vector< double > &bins, std::vector< double > &values, const std::vector< std::string > &files, const std::string &histname, const std::string &tplotname, const std::string &label="")
Definition: dependence.cxx:254
MuonCalib::MeanRMS::GetMean
double GetMean() const
Definition: MeanRMS.h:17
x
#define x
MuonCalib::MeanRMS::m_n_ent
int m_n_ent
Definition: MeanRMS.h:31
MuonCalib::MeanRMS::m_sum_x_sq
double m_sum_x_sq
Definition: MeanRMS.h:30
MuonCalib::MeanRMS::m_sum_x
double m_sum_x
Definition: MeanRMS.h:29