Mantid
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
Mantid::DataObjects::MDDimensionStats Class Reference

A simple class holding some statistics on the distribution of events in a particular dimension. More...

#include <MDDimensionStats.h>

Public Member Functions

void addPoint (const coord_t x)
 Add a point with the given coordinate; track the mean and variance. More...
 
coord_t getApproxVariance () const
 Returns the approximate standard deviation of the position of events in this dimension. More...
 
coord_t getMean () const
 Returns the mean position of events in this dimension. More...
 
 MDDimensionStats ()
 Constructor. More...
 

Public Attributes

size_t numPoints
 Number of points counted (used to give the mean). More...
 
coord_t total
 Total dimension (summed by each event). More...
 
coord_t totalApproxVariance
 Approximate variance - used for quick std.deviation estimates. More...
 

Detailed Description

A simple class holding some statistics on the distribution of events in a particular dimension.

Author
Janik Zikovsky
Date
2011-04-19 10:55:12.567192

Definition at line 20 of file MDDimensionStats.h.

Constructor & Destructor Documentation

◆ MDDimensionStats()

Mantid::DataObjects::MDDimensionStats::MDDimensionStats ( )
inline

Constructor.

Definition at line 23 of file MDDimensionStats.h.

Member Function Documentation

◆ addPoint()

void Mantid::DataObjects::MDDimensionStats::addPoint ( const coord_t  x)
inline

Add a point with the given coordinate; track the mean and variance.

Parameters
x:: coordinate value of the point in this dimension.

Definition at line 37 of file MDDimensionStats.h.

References Mantid::Geometry::x.

◆ getApproxVariance()

coord_t Mantid::DataObjects::MDDimensionStats::getApproxVariance ( ) const
inline

Returns the approximate standard deviation of the position of events in this dimension.

Definition at line 31 of file MDDimensionStats.h.

◆ getMean()

coord_t Mantid::DataObjects::MDDimensionStats::getMean ( ) const
inline

Returns the mean position of events in this dimension.

Definition at line 27 of file MDDimensionStats.h.

Member Data Documentation

◆ numPoints

size_t Mantid::DataObjects::MDDimensionStats::numPoints

Number of points counted (used to give the mean).

Definition at line 62 of file MDDimensionStats.h.

◆ total

coord_t Mantid::DataObjects::MDDimensionStats::total

Total dimension (summed by each event).

Divide by numPoints to get the mean

Definition at line 49 of file MDDimensionStats.h.

◆ totalApproxVariance

coord_t Mantid::DataObjects::MDDimensionStats::totalApproxVariance

Approximate variance - used for quick std.deviation estimates.

A running sum of (X - mean(X))^2, where mean(X) is calculated at the time of adding the point. This approximation gets better as the number of points increases.

Divide by the number of points to get the square of the standard deviation!

Definition at line 59 of file MDDimensionStats.h.


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