Belle II Software development
UncertainParameterLine2D Class Reference

A parameter line including including an line covariance matrix which is interpreted as located in the support point. More...

#include <UncertainParameterLine2D.h>

Public Member Functions

 UncertainParameterLine2D ()
 Default constructor for ROOT compatibility.
 
 UncertainParameterLine2D (const ParameterLine2D &parameterLine2D, const LineCovariance &lineCovariance=LineUtil::identity(), const double chi2=0.0, const size_t ndf=0)
 Attaching a covariance matrix to a parameter line.
 
const ParameterLine2Doperator-> () const
 Access to the constant interface of the underlying parameter line Allows the user of this "super" class to use the getters and other methods to get inforamation about the line but disallows mutation of internal state.
 
 operator ParameterLine2D () const
 Downcast to the "super" class.
 
LineParameters lineParameters () const
 Getter for the three perigee parameters in the order defined by EPerigeeParameter.h.
 
void setLineCovariance (const LineCovariance &lineCovariance)
 Setter for the whole covariance matrix of the line parameters.
 
const LineCovariancelineCovariance () const
 Getter for the whole covariance matrix of the line parameters.
 
double covariance (const ELineParameter &iRow, const ELineParameter &iCol) const
 Getter for individual elements of the covariance matrix.
 
double variance (const ELineParameter &i) const
 Getter for individual diagonal elements of the covariance matrix.
 
double chi2 () const
 Getter for the chi square value of the line fit.
 
void setChi2 (const double chi2)
 Setter for the chi square value of the line fit.
 
std::size_t ndf () const
 Getter for the number of degrees of freediom used in the line fit.
 
void setNDF (std::size_t ndf)
 Setter for the number of degrees of freediom used in the line fit.
 
void invalidate ()
 Sets all line parameters to zero including the covariance matrix.
 
void reverse ()
 Reverses the direction of flight represented by this line.
 
UncertainParameterLine2D reversed () const
 Returns a copy of the line corresponding to the reverse direction of travel.
 
void passiveMoveBy (const Vector2D &by)
 Moves the coordinate system by the vector by.
 
LineJacobian moveSupportByJacobian (double byAt) const
 Computes the Jacobi matrix for a move of the coordinate system by the given vector.
 
void moveSupportBy (double byAt)
 Moves the coordinate system by the vector by and calculates the new line and its covariance matrix.
 
LineCovariance movedSupportCovarianceBy (double byAt) const
 Getter for the covariance as if he coordinate system was moved by the given vector.
 

Private Attributes

ParameterLine2D m_parameterLine2D
 Memory for the underlying parameter line.
 
LineCovariance m_lineCovariance = LineUtil::identity()
 Memory for the 2x2 covariance matrix of the line phi0 and impact parameter relative to the support point.
 
double m_chi2 = 0.0
 Memory for the chi square value of the fit of this line.
 
size_t m_ndf = 0
 Memory for the number of degrees of freedim of the fit of this line.
 

Detailed Description

A parameter line including including an line covariance matrix which is interpreted as located in the support point.

Definition at line 24 of file UncertainParameterLine2D.h.

Constructor & Destructor Documentation

◆ UncertainParameterLine2D() [1/2]

Default constructor for ROOT compatibility.

Definition at line 28 of file UncertainParameterLine2D.h.

29 {
30 }

◆ UncertainParameterLine2D() [2/2]

UncertainParameterLine2D ( const ParameterLine2D parameterLine2D,
const LineCovariance lineCovariance = LineUtil::identity(),
const double  chi2 = 0.0,
const size_t  ndf = 0 
)
inlineexplicit

Attaching a covariance matrix to a parameter line.

Definition at line 33 of file UncertainParameterLine2D.h.

37 : m_parameterLine2D(parameterLine2D)
39 , m_chi2(chi2)
40 , m_ndf(ndf)
41 {
42 }
const LineCovariance & lineCovariance() const
Getter for the whole covariance matrix of the line parameters.
ParameterLine2D m_parameterLine2D
Memory for the underlying parameter line.
LineCovariance m_lineCovariance
Memory for the 2x2 covariance matrix of the line phi0 and impact parameter relative to the support po...
double m_chi2
Memory for the chi square value of the fit of this line.
double chi2() const
Getter for the chi square value of the line fit.
size_t m_ndf
Memory for the number of degrees of freedim of the fit of this line.
std::size_t ndf() const
Getter for the number of degrees of freediom used in the line fit.

Member Function Documentation

◆ chi2()

double chi2 ( ) const
inline

Getter for the chi square value of the line fit.

Definition at line 100 of file UncertainParameterLine2D.h.

101 {
102 return m_chi2;
103 }

◆ covariance()

double covariance ( const ELineParameter iRow,
const ELineParameter iCol 
) const
inline

Getter for individual elements of the covariance matrix.

Definition at line 88 of file UncertainParameterLine2D.h.

89 {
90 return lineCovariance()(iRow, iCol);
91 }

◆ invalidate()

void invalidate ( )
inline

Sets all line parameters to zero including the covariance matrix.

Definition at line 124 of file UncertainParameterLine2D.h.

125 {
128 m_chi2 = 0.0;
129 m_ndf = 0;
130 }
void invalidate()
Clear all information from the line.

◆ lineCovariance()

const LineCovariance & lineCovariance ( ) const
inline

Getter for the whole covariance matrix of the line parameters.

Definition at line 82 of file UncertainParameterLine2D.h.

83 {
84 return m_lineCovariance;
85 }

◆ lineParameters()

LineParameters lineParameters ( ) const
inline

Getter for the three perigee parameters in the order defined by EPerigeeParameter.h.

Definition at line 66 of file UncertainParameterLine2D.h.

67 {
68 using namespace NLineParameterIndices;
69 LineParameters result;
70 result(c_Phi0) = m_parameterLine2D.tangential().phi();
71 result(c_I) = 0;
72 return result;
73 }
const Vector2D & tangential() const
Gives the tangential vector of the line.
double phi() const
Gives the azimuth angle being the angle to the x axes ( range -M_PI to M_PI )
Definition: Vector2D.h:569

◆ movedSupportCovarianceBy()

LineCovariance movedSupportCovarianceBy ( double  byAt) const
inline

Getter for the covariance as if he coordinate system was moved by the given vector.

Definition at line 180 of file UncertainParameterLine2D.h.

181 {
182 LineJacobian jacobian = moveSupportByJacobian(byAt);
183 return LineUtil::transported(jacobian, lineCovariance());
184 }
LineJacobian moveSupportByJacobian(double byAt) const
Computes the Jacobi matrix for a move of the coordinate system by the given vector.
static CovarianceMatrix transported(const JacobianMatrix &jacobian, const CovarianceMatrix &cov)
Return a copy of the covariance matrix transported with the given jacobian matrix.

◆ moveSupportBy()

void moveSupportBy ( double  byAt)
inline

Moves the coordinate system by the vector by and calculates the new line and its covariance matrix.

Change is inplace.

Definition at line 171 of file UncertainParameterLine2D.h.

172 {
173 // Move the covariance matrix first to have access to the original parameters
174 LineJacobian jacobian = moveSupportByJacobian(byAt);
177 }
void passiveMoveAtBy(const double delta)
Moves the support point by the given amount of the parameter in the forward direction.
static void transport(const JacobianMatrix &jacobian, CovarianceMatrix &cov)
Transport the covariance matrix inplace with the given jacobian matrix.

◆ moveSupportByJacobian()

LineJacobian moveSupportByJacobian ( double  byAt) const
inline

Computes the Jacobi matrix for a move of the coordinate system by the given vector.

Definition at line 161 of file UncertainParameterLine2D.h.

162 {
163 using namespace NLineParameterIndices;
164 LineJacobian result = LineUtil::identity();
165 result(c_I, c_Phi0) = -byAt * m_parameterLine2D.tangential().norm();
166 return result;
167 }
double norm() const
Calculates the length of the vector.
Definition: Vector2D.h:175

◆ ndf()

std::size_t ndf ( ) const
inline

Getter for the number of degrees of freediom used in the line fit.

Definition at line 112 of file UncertainParameterLine2D.h.

113 {
114 return m_ndf;
115 }

◆ operator ParameterLine2D()

operator ParameterLine2D ( ) const
inline

Downcast to the "super" class.

Definition at line 59 of file UncertainParameterLine2D.h.

60 {
61 return m_parameterLine2D;
62 }

◆ operator->()

const ParameterLine2D * operator-> ( ) const
inline

Access to the constant interface of the underlying parameter line Allows the user of this "super" class to use the getters and other methods to get inforamation about the line but disallows mutation of internal state.

This ensures that the parameters are not changed without proper adjustment to the covariance matrix in this class, which can be achieved by the more limited set of methods in this class accessable by normal . method calls

Definition at line 53 of file UncertainParameterLine2D.h.

54 {
55 return &m_parameterLine2D;
56 }

◆ passiveMoveBy()

void passiveMoveBy ( const Vector2D by)
inline

Moves the coordinate system by the vector by.

Because the covariance matrix is pinned in the support point it does not change in this move operation

Definition at line 155 of file UncertainParameterLine2D.h.

156 {
158 }
void passiveMoveBy(const Vector2D &by)
Moves the coordinate system in the given direction in place.

◆ reverse()

void reverse ( )
inline

Reverses the direction of flight represented by this line.

Definition at line 134 of file UncertainParameterLine2D.h.

135 {
138 }
void reverse()
Reverses the tangential vector inplace.
static void reverse(CovarianceMatrix &cov)
Reverse the covariance matrix inplace.

◆ reversed()

UncertainParameterLine2D reversed ( ) const
inline

Returns a copy of the line corresponding to the reverse direction of travel.

Definition at line 141 of file UncertainParameterLine2D.h.

142 {
145 m_chi2,
146 m_ndf);
147 }
ParameterLine2D reversed() const
Makes a copy line which has the opposite tangential vector but same support point.
UncertainParameterLine2D()
Default constructor for ROOT compatibility.
static CovarianceMatrix reversed(const CovarianceMatrix &cov)
Return a copy of the reversed covariance matrix.

◆ setChi2()

void setChi2 ( const double  chi2)
inline

Setter for the chi square value of the line fit.

Definition at line 106 of file UncertainParameterLine2D.h.

107 {
108 m_chi2 = chi2;
109 }

◆ setLineCovariance()

void setLineCovariance ( const LineCovariance lineCovariance)
inline

Setter for the whole covariance matrix of the line parameters.

Definition at line 76 of file UncertainParameterLine2D.h.

◆ setNDF()

void setNDF ( std::size_t  ndf)
inline

Setter for the number of degrees of freediom used in the line fit.

Definition at line 118 of file UncertainParameterLine2D.h.

119 {
120 m_ndf = ndf;
121 }

◆ variance()

double variance ( const ELineParameter i) const
inline

Getter for individual diagonal elements of the covariance matrix.

Definition at line 94 of file UncertainParameterLine2D.h.

95 {
96 return lineCovariance()(i, i);
97 }

Member Data Documentation

◆ m_chi2

double m_chi2 = 0.0
private

Memory for the chi square value of the fit of this line.

Definition at line 195 of file UncertainParameterLine2D.h.

◆ m_lineCovariance

LineCovariance m_lineCovariance = LineUtil::identity()
private

Memory for the 2x2 covariance matrix of the line phi0 and impact parameter relative to the support point.

Definition at line 192 of file UncertainParameterLine2D.h.

◆ m_ndf

size_t m_ndf = 0
private

Memory for the number of degrees of freedim of the fit of this line.

Definition at line 198 of file UncertainParameterLine2D.h.

◆ m_parameterLine2D

ParameterLine2D m_parameterLine2D
private

Memory for the underlying parameter line.

Definition at line 188 of file UncertainParameterLine2D.h.


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