ATLAS Offline Software
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
Muon::Fit2D Class Reference

A 2D linear regression calculator. More...

#include <Fit2D.h>

Collaboration diagram for Muon::Fit2D:

Classes

struct  LinStats
 A structure to hold linear fit statistics. More...
 
struct  Point
 A 2D point used in statistics and fit. More...
 
struct  SimpleStats
 

Public Types

typedef std::vector< Point * > PointArray
 A vector of points. More...
 

Public Member Functions

 Fit2D ()
 Constructor. More...
 

Static Public Member Functions

static void SimpleStatistics (const PointArray &points, SimpleStats &stats)
 Calculate simple statistics for the Y values of a set of points. More...
 
static void fitLine (PointArray &points, double fExclChi2, bool bDump, LinStats &stats)
 Fit a straight line through the given points. More...
 
static void fitPoint (PointArray &points, double fExclChi2, bool bDump, SimpleStats &stats)
 Estimate a new point from the given points. More...
 

Detailed Description

A 2D linear regression calculator.

The class accepts a list of X/ points and computes the least-squares straight line fit. It reports the intercept, slope and goodness of fit.

Points can be excluded from the calculation, and can also have a weight associated with them.

The class also computes simple statistics (meand, standard deviation) of the Y values.

Definition at line 28 of file Fit2D.h.

Member Typedef Documentation

◆ PointArray

typedef std::vector<Point*> Muon::Fit2D::PointArray

A vector of points.

Definition at line 59 of file Fit2D.h.

Constructor & Destructor Documentation

◆ Fit2D()

Muon::Fit2D::Fit2D ( )
inline

Constructor.

Definition at line 179 of file Fit2D.h.

180  {
181  }

Member Function Documentation

◆ fitLine()

static void Muon::Fit2D::fitLine ( PointArray points,
double  fExclChi2,
bool  bDump,
LinStats stats 
)
static

Fit a straight line through the given points.

Parameters
pointsThe list of data points
fExclChi2CHi2 value for excluding outliers
bDumpWrite details to log
stats[output] The fit results

◆ fitPoint()

static void Muon::Fit2D::fitPoint ( PointArray points,
double  fExclChi2,
bool  bDump,
SimpleStats stats 
)
static

Estimate a new point from the given points.

Parameters
pointsThe list of data points
fExclChi2CHi2 value for excluding outliers
bDumpWrite details to log
stats[output] The fit results

◆ SimpleStatistics()

static void Muon::Fit2D::SimpleStatistics ( const PointArray points,
SimpleStats stats 
)
static

Calculate simple statistics for the Y values of a set of points.

Parameters
pointsThe list of data points
stats[output] The statistics results

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