ATLAS Offline Software
Loading...
Searching...
No Matches
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) {};
double m_wx
Definition MeanAndRMS.h:32
double m_wx2
Definition MeanAndRMS.h:32
double m_w
Definition MeanAndRMS.h:31

◆ 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) {};
const boost::regex ref(r_ef)

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;};
#define x
double mean() const
Definition MeanAndRMS.h:22

◆ 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;};
double rms() const
Definition MeanAndRMS.h:25

◆ 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);};
MeanAndRMS & add(double xadd, double weight=1)
Definition MeanAndRMS.h:16

◆ 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;};
double rms2() const
Definition MeanAndRMS.h:24

◆ 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;};
double mean2() const
Definition MeanAndRMS.h:23

◆ 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: