ATLAS Offline Software
Public Member Functions | Protected Attributes | List of all members
MeanAndRMS Class Reference

#include <MeanAndRMS.h>

Collaboration diagram for MeanAndRMS:

Public Member Functions

 MeanAndRMS ()
 
 MeanAndRMS (const double xadd, const double weight=1)
 
 MeanAndRMS (const MeanAndRMS &ref)
 
MeanAndRMSadd (double xadd, double weight=1)
 
MeanAndRMSoperator+= (double xadd)
 
MeanAndRMSoperator-= (double xadd)
 
MeanAndRMSoperator= (const MeanAndRMS &ref)
 
double sum_weight () const
 
double mean () const
 
double mean2 () const
 
double rms2 () const
 
double rms () const
 
double mean_error () const
 
double rms_error () const
 
 operator double () const
 

Protected Attributes

double m_w
 
double m_wx
 
double m_wx2
 

Detailed Description

Definition at line 10 of file MeanAndRMS.h.

Constructor & Destructor Documentation

◆ MeanAndRMS() [1/3]

MeanAndRMS::MeanAndRMS ( )
inline

Definition at line 12 of file MeanAndRMS.h.

12 :m_w(0),m_wx(0),m_wx2(0) {};

◆ MeanAndRMS() [2/3]

MeanAndRMS::MeanAndRMS ( const double  xadd,
const double  weight = 1 
)
inline

Definition at line 13 of file MeanAndRMS.h.

13 :m_w(weight),m_wx(weight*xadd),m_wx2(weight*xadd*xadd) {};

◆ MeanAndRMS() [3/3]

MeanAndRMS::MeanAndRMS ( const MeanAndRMS ref)
inline

Definition at line 14 of file MeanAndRMS.h.

14 :m_w(ref.m_w),m_wx(ref.m_wx),m_wx2(ref.m_wx2) {};

Member Function Documentation

◆ add()

MeanAndRMS& MeanAndRMS::add ( double  xadd,
double  weight = 1 
)
inline

Definition at line 16 of file MeanAndRMS.h.

16 {m_wx+=weight*xadd;m_wx2+=weight*xadd*xadd;m_w+=weight;return *this;};

◆ mean()

double MeanAndRMS::mean ( ) const
inline

Definition at line 22 of file MeanAndRMS.h.

22 {if(m_w!=0) return m_wx/m_w; else return 0;};

◆ mean2()

double MeanAndRMS::mean2 ( ) const
inline

Definition at line 23 of file MeanAndRMS.h.

23 {double x=mean();return x*x;};

◆ mean_error()

double MeanAndRMS::mean_error ( ) const
inline

Definition at line 26 of file MeanAndRMS.h.

26 {if(m_w>0) return rms()/sqrt(m_w); else return 0;};

◆ operator double()

MeanAndRMS::operator double ( ) const
inline

Definition at line 29 of file MeanAndRMS.h.

29 { return mean(); }

◆ operator+=()

MeanAndRMS& MeanAndRMS::operator+= ( double  xadd)
inline

Definition at line 17 of file MeanAndRMS.h.

17 {return add(xadd);};

◆ operator-=()

MeanAndRMS& MeanAndRMS::operator-= ( double  xadd)
inline

Definition at line 18 of file MeanAndRMS.h.

18 {return add(-xadd);};

◆ operator=()

MeanAndRMS& MeanAndRMS::operator= ( const MeanAndRMS ref)
inline

Definition at line 19 of file MeanAndRMS.h.

19 {m_w=ref.m_w;m_wx=ref.m_wx;m_wx2=ref.m_wx2;return *this;};

◆ rms()

double MeanAndRMS::rms ( ) const
inline

Definition at line 25 of file MeanAndRMS.h.

25 {double r2=rms2();if(r2>=0) return sqrt(r2); else return 0;};

◆ rms2()

double MeanAndRMS::rms2 ( ) const
inline

Definition at line 24 of file MeanAndRMS.h.

24 {if(m_w!=0) return m_wx2/m_w - mean2(); else return 0;};

◆ rms_error()

double MeanAndRMS::rms_error ( ) const
inline

Definition at line 27 of file MeanAndRMS.h.

27 {if(m_w>0) return rms()/sqrt(2*m_w); else return 0;};

◆ sum_weight()

double MeanAndRMS::sum_weight ( ) const
inline

Definition at line 21 of file MeanAndRMS.h.

21 {return m_w;};

Member Data Documentation

◆ m_w

double MeanAndRMS::m_w
protected

Definition at line 31 of file MeanAndRMS.h.

◆ m_wx

double MeanAndRMS::m_wx
protected

Definition at line 32 of file MeanAndRMS.h.

◆ m_wx2

double MeanAndRMS::m_wx2
protected

Definition at line 32 of file MeanAndRMS.h.


The documentation for this class was generated from the following file:
MeanAndRMS::add
MeanAndRMS & add(double xadd, double weight=1)
Definition: MeanAndRMS.h:16
MeanAndRMS::rms
double rms() const
Definition: MeanAndRMS.h:25
MeanAndRMS::rms2
double rms2() const
Definition: MeanAndRMS.h:24
MCP::ScaleSmearParam::r2
@ r2
x
#define x
dqt_zlumi_pandas.weight
int weight
Definition: dqt_zlumi_pandas.py:189
MeanAndRMS::m_w
double m_w
Definition: MeanAndRMS.h:31
MeanAndRMS::m_wx
double m_wx
Definition: MeanAndRMS.h:32
ref
const boost::regex ref(r_ef)
MeanAndRMS::mean
double mean() const
Definition: MeanAndRMS.h:22
MeanAndRMS::mean2
double mean2() const
Definition: MeanAndRMS.h:23
MeanAndRMS::m_wx2
double m_wx2
Definition: MeanAndRMS.h:32