ATLAS Offline Software
Public Member Functions | Public Attributes | List of all members
Muon::Fit2D::LinStats Struct Reference

A structure to hold linear fit statistics. More...

#include <Fit2D.h>

Collaboration diagram for Muon::Fit2D::LinStats:

Public Member Functions

 LinStats ()
 Constructor. More...
 
void clear ()
 Clear the statistics before a new fit. More...
 
void eval (double fX, double &fY, double &fYerr) const
 Evaluate a point along the fitted line. More...
 
std::string toString () const
 Get a string representation of the fit parameters. More...
 

Public Attributes

int n
 Number of points. More...
 
double fIntercept
 Intercept of the fit line. More...
 
double fSlope
 Slope of the fit line. More...
 
double fCov [2][2]
 The parameter covariance matrix. More...
 
double fChi2
 Chi-squared of the fit. More...
 

Detailed Description

A structure to hold linear fit statistics.

Definition at line 76 of file Fit2D.h.

Constructor & Destructor Documentation

◆ LinStats()

Muon::Fit2D::LinStats::LinStats ( )
inline

Constructor.

Definition at line 163 of file Fit2D.h.

163  :
164  n(0),
165  fIntercept(0.0),
166  fSlope(0.0),
167  fChi2(0.0)
168  {
169  memset(fCov, 0, sizeof(fCov));
170  }

Member Function Documentation

◆ clear()

void Muon::Fit2D::LinStats::clear ( )
inline

Clear the statistics before a new fit.

Definition at line 172 of file Fit2D.h.

173  {
174  n = 0;
175  fIntercept = fSlope = fChi2 = 0.0;
176  memset(fCov, 0, sizeof(fCov));
177  }

◆ eval()

void Muon::Fit2D::LinStats::eval ( double  fX,
double &  fY,
double &  fYerr 
) const

Evaluate a point along the fitted line.

Parameters
fXThe X value of the point to project
fY[output] The projected Y value
fYerr[output] The error of the projected Y value

Definition at line 26 of file Fit2D.cxx.

27 {
28  gsl_fit_linear_est(fX, fIntercept, fSlope, fCov[0][0], fCov[0][1], fCov[1][1], &fY, &fYerr);
29 }

◆ toString()

std::string Muon::Fit2D::LinStats::toString ( ) const

Get a string representation of the fit parameters.

Definition at line 31 of file Fit2D.cxx.

Member Data Documentation

◆ fChi2

double Muon::Fit2D::LinStats::fChi2

Chi-squared of the fit.

Definition at line 82 of file Fit2D.h.

◆ fCov

double Muon::Fit2D::LinStats::fCov[2][2]

The parameter covariance matrix.

Definition at line 81 of file Fit2D.h.

◆ fIntercept

double Muon::Fit2D::LinStats::fIntercept

Intercept of the fit line.

Definition at line 79 of file Fit2D.h.

◆ fSlope

double Muon::Fit2D::LinStats::fSlope

Slope of the fit line.

Definition at line 80 of file Fit2D.h.

◆ n

int Muon::Fit2D::LinStats::n

Number of points.

Definition at line 78 of file Fit2D.h.


The documentation for this struct was generated from the following files:
Muon::Fit2D::LinStats::n
int n
Number of points.
Definition: Fit2D.h:78
Muon::Fit2D::LinStats::fSlope
double fSlope
Slope of the fit line.
Definition: Fit2D.h:80
Muon::Fit2D::LinStats::fCov
double fCov[2][2]
The parameter covariance matrix.
Definition: Fit2D.h:81
Muon::Fit2D::LinStats::fChi2
double fChi2
Chi-squared of the fit.
Definition: Fit2D.h:82
Muon::Fit2D::LinStats::fIntercept
double fIntercept
Intercept of the fit line.
Definition: Fit2D.h:79