ATTPCROOT  0.3.0-alpha
A ROOT-based framework for analyzing data from active target detectors
Public Member Functions | List of all members
GETMath2 Class Reference

#include <GETMath2.h>

Public Member Functions

 GETMath2 ()
 
void Reset ()
 Reset all the values. More...
 
void Add (Double_t value)
 
Double_t GetMean ()
 Return the calculated mean value. More...
 
Double_t GetRMS ()
 Return the calculated RMS value. More...
 
Double_t GetRMS2 ()
 Return the calculated RMS squared value. More...
 
void Set (Int_t numValues, Double_t mean, Double_t rms2)
 

Detailed Description

Basically, what this class does is the same as TH1D class in ROOT. The difference is that this class only provides the mean and RMS values. Nothing else!

Definition at line 29 of file GETMath2.h.

Constructor & Destructor Documentation

◆ GETMath2()

GETMath2::GETMath2 ( )

Member Function Documentation

◆ Add()

void GETMath2::Add ( Double_t  value)

With the mean and RMS, calculated before, use the value to calculate new mean and RMS recursively.

This method uses the formulae below to calculate mean and RMS.
$\text{mean}\Rightarrow \mu_{n+1} = \mu_n + \displaystyle\frac{x_{n+1} - \mu_n}{n + 1},\quad(n\geq0)$
$\text{RMS}\Rightarrow\sigma^2_{n+1} = \displaystyle\frac{n}{n + 1}\sigma^2_n + \displaystyle\frac{(x_{n+1} - *\mu_{n+1})^2}{n},\quad(n>0)$

Definition at line 27 of file GETMath2.cxx.

◆ GetMean()

Double_t GETMath2::GetMean ( )

Return the calculated mean value.

Definition at line 43 of file GETMath2.cxx.

◆ GetRMS()

Double_t GETMath2::GetRMS ( )

Return the calculated RMS value.

Definition at line 47 of file GETMath2.cxx.

◆ GetRMS2()

Double_t GETMath2::GetRMS2 ( )

Return the calculated RMS squared value.

Definition at line 51 of file GETMath2.cxx.

◆ Reset()

void GETMath2::Reset ( )

Reset all the values.

Definition at line 63 of file GETMath2.cxx.

◆ Set()

void GETMath2::Set ( Int_t  numValues,
Double_t  mean,
Double_t  rms2 
)

Definition at line 56 of file GETMath2.cxx.


The documentation for this class was generated from the following files: