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 information 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 ROOT::Math::XYVector &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 26 of file UncertainParameterLine2D.h.

Constructor & Destructor Documentation

◆ UncertainParameterLine2D() [1/2]

Default constructor for ROOT compatibility.

Definition at line 30 of file UncertainParameterLine2D.h.

31 {
32 }

◆ 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 35 of file UncertainParameterLine2D.h.

39 : m_parameterLine2D(parameterLine2D)
40 , m_lineCovariance(lineCovariance)
41 , m_chi2(chi2)
42 , m_ndf(ndf)
43 {
44 }

Member Function Documentation

◆ chi2()

double chi2 ( ) const
inline

Getter for the chi square value of the line fit.

Definition at line 102 of file UncertainParameterLine2D.h.

103 {
104 return m_chi2;
105 }

◆ covariance()

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

Getter for individual elements of the covariance matrix.

Definition at line 90 of file UncertainParameterLine2D.h.

91 {
92 return lineCovariance()(iRow, iCol);
93 }

◆ invalidate()

void invalidate ( )
inline

Sets all line parameters to zero including the covariance matrix.

Definition at line 126 of file UncertainParameterLine2D.h.

127 {
128 m_parameterLine2D.invalidate();
129 m_lineCovariance = LineUtil::identity();
130 m_chi2 = 0.0;
131 m_ndf = 0;
132 }

◆ lineCovariance()

const LineCovariance & lineCovariance ( ) const
inline

Getter for the whole covariance matrix of the line parameters.

Definition at line 84 of file UncertainParameterLine2D.h.

85 {
86 return m_lineCovariance;
87 }

◆ lineParameters()

LineParameters lineParameters ( ) const
inline

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

Definition at line 68 of file UncertainParameterLine2D.h.

69 {
70 using namespace NLineParameterIndices;
71 LineParameters result;
72 result(c_Phi0) = m_parameterLine2D.tangential().Phi();
73 result(c_I) = 0;
74 return result;
75 }

◆ 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 182 of file UncertainParameterLine2D.h.

183 {
184 LineJacobian jacobian = moveSupportByJacobian(byAt);
185 return LineUtil::transported(jacobian, lineCovariance());
186 }

◆ 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 173 of file UncertainParameterLine2D.h.

174 {
175 // Move the covariance matrix first to have access to the original parameters
176 LineJacobian jacobian = moveSupportByJacobian(byAt);
177 LineUtil::transport(jacobian, m_lineCovariance);
178 m_parameterLine2D.passiveMoveAtBy(byAt);
179 }

◆ 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 163 of file UncertainParameterLine2D.h.

164 {
165 using namespace NLineParameterIndices;
166 LineJacobian result = LineUtil::identity();
167 result(c_I, c_Phi0) = -byAt * m_parameterLine2D.tangential().R();
168 return result;
169 }

◆ ndf()

std::size_t ndf ( ) const
inline

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

Definition at line 114 of file UncertainParameterLine2D.h.

115 {
116 return m_ndf;
117 }

◆ operator ParameterLine2D()

operator ParameterLine2D ( ) const
inline

Downcast to the "super" class.

Definition at line 61 of file UncertainParameterLine2D.h.

62 {
63 return m_parameterLine2D;
64 }

◆ 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 information 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 accessible by normal . method calls

Definition at line 55 of file UncertainParameterLine2D.h.

56 {
57 return &m_parameterLine2D;
58 }

◆ passiveMoveBy()

void passiveMoveBy ( const ROOT::Math::XYVector & 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 157 of file UncertainParameterLine2D.h.

158 {
159 m_parameterLine2D.passiveMoveBy(by);
160 }

◆ reverse()

void reverse ( )
inline

Reverses the direction of flight represented by this line.

Definition at line 136 of file UncertainParameterLine2D.h.

137 {
138 m_parameterLine2D.reverse();
139 LineUtil::reverse(m_lineCovariance);
140 }

◆ reversed()

UncertainParameterLine2D reversed ( ) const
inline

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

Definition at line 143 of file UncertainParameterLine2D.h.

144 {
145 return UncertainParameterLine2D(m_parameterLine2D.reversed(),
146 LineUtil::reversed(lineCovariance()),
147 m_chi2,
148 m_ndf);
149 }

◆ setChi2()

void setChi2 ( const double chi2)
inline

Setter for the chi square value of the line fit.

Definition at line 108 of file UncertainParameterLine2D.h.

109 {
110 m_chi2 = chi2;
111 }

◆ setLineCovariance()

void setLineCovariance ( const LineCovariance & lineCovariance)
inline

Setter for the whole covariance matrix of the line parameters.

Definition at line 78 of file UncertainParameterLine2D.h.

79 {
80 m_lineCovariance = lineCovariance;
81 }

◆ setNDF()

void setNDF ( std::size_t ndf)
inline

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

Definition at line 120 of file UncertainParameterLine2D.h.

121 {
122 m_ndf = ndf;
123 }

◆ variance()

double variance ( const ELineParameter & i) const
inline

Getter for individual diagonal elements of the covariance matrix.

Definition at line 96 of file UncertainParameterLine2D.h.

97 {
98 return lineCovariance()(i, i);
99 }

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 197 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 194 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 200 of file UncertainParameterLine2D.h.

◆ m_parameterLine2D

ParameterLine2D m_parameterLine2D
private

Memory for the underlying parameter line.

Definition at line 190 of file UncertainParameterLine2D.h.


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