Belle II Software development
UncertainSZLine Class Reference

A line in sz where s is the transverse travel distance as seen in the xy projection with uncertainties in the slope and intercept of the line. More...

#include <UncertainSZLine.h>

Public Member Functions

 UncertainSZLine ()
 Default constructor for ROOT compatibility.
 
 UncertainSZLine (const double tanLambda, const double z0, const SZCovariance &szCovariance=SZUtil::identity(), const double chi2=0.0, const size_t ndf=0)
 Composes an uncertain sz line from the perigee parameters and a 2x2 covariance matrix.
 
 UncertainSZLine (const SZParameters szParameters, const SZCovariance &szCovariance=SZUtil::identity(), const double chi2=0.0, const size_t ndf=0)
 Composes an uncertain sz line from the perigee parameters and a 2x2 covariance matrix.
 
 UncertainSZLine (const SZLine &szLine, const SZCovariance &szCovariance=SZUtil::identity(), const double chi2=0.0, const size_t ndf=0)
 Augments a plain two dimensional line with a covariance matrix.
 
const SZLineoperator-> () 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 const SZLine & () const
 Downcast to the "super" class.
 
const SZLineszLine () const
 Getter for the underlying sz line.
 
SZParameters szParameters () const
 Getter for the sz parameters in the order defined by ESZParameter.h.
 
void setSZCovariance (const SZCovariance &szCovariance)
 Setter for the whole covariance matrix of the sz line parameters.
 
const SZCovarianceszCovariance () const
 Getter for the whole covariance matrix of the sz line parameters.
 
double covariance (const ESZParameter &iRow, const ESZParameter &iCol) const
 Getter for individual elements of the covariance matrix.
 
double variance (const ESZParameter &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 sz line.
 
UncertainSZLine reversed () const
 Returns a copy of the line corresponding to the reverse direction of travel.
 
void passiveMoveBy (const ROOT::Math::XYVector &bySZ)
 Moves the coordinate system by the vector by and calculates the new sz line and its covariance matrix.
 
SZCovariance passiveMovedCovarianceBy (const ROOT::Math::XYVector &bySZ) const
 Calculates the jacobian matrix that is needed for the translation of the parameter covariance for a passive move of the coordinate system.
 

Private Attributes

SZLine m_szLine
 Memory for the underlying line.
 
SZCovariance m_szCovariance = SZUtil::identity()
 Memory for the 2x2 covariance matrix of sz slope (aka tan lambda) and z0.
 
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 line in sz where s is the transverse travel distance as seen in the xy projection with uncertainties in the slope and intercept of the line.

Definition at line 29 of file UncertainSZLine.h.

Constructor & Destructor Documentation

◆ UncertainSZLine() [1/4]

UncertainSZLine ( )
inline

Default constructor for ROOT compatibility.

Definition at line 33 of file UncertainSZLine.h.

34 {
35 }

◆ UncertainSZLine() [2/4]

UncertainSZLine ( const double tanLambda,
const double z0,
const SZCovariance & szCovariance = SZUtil::identity(),
const double chi2 = 0.0,
const size_t ndf = 0 )
inline

Composes an uncertain sz line from the perigee parameters and a 2x2 covariance matrix.

Covariance matrix defaults to a zero matrix.

Definition at line 39 of file UncertainSZLine.h.

44 : m_szLine(tanLambda, z0)
45 , m_szCovariance(szCovariance)
46 , m_chi2(chi2)
47 , m_ndf(ndf)
48 {
49 }

◆ UncertainSZLine() [3/4]

UncertainSZLine ( const SZParameters szParameters,
const SZCovariance & szCovariance = SZUtil::identity(),
const double chi2 = 0.0,
const size_t ndf = 0 )
inlineexplicit

Composes an uncertain sz line from the perigee parameters and a 2x2 covariance matrix.

Covariance matrix defaults to a zero matrix.

Definition at line 53 of file UncertainSZLine.h.

57 : m_szLine(szParameters)
58 , m_szCovariance(szCovariance)
59 , m_chi2(chi2)
60 , m_ndf(ndf)
61 {
62 }

◆ UncertainSZLine() [4/4]

UncertainSZLine ( const SZLine & szLine,
const SZCovariance & szCovariance = SZUtil::identity(),
const double chi2 = 0.0,
const size_t ndf = 0 )
inlineexplicit

Augments a plain two dimensional line with a covariance matrix.

Covariance defaults to zero.

Definition at line 66 of file UncertainSZLine.h.

70 : m_szLine(szLine)
71 , m_szCovariance(szCovariance)
72 , m_chi2(chi2)
73 , m_ndf(ndf)
74 {
75 }

Member Function Documentation

◆ chi2()

double chi2 ( ) const
inline

Getter for the chi square value of the line fit.

Definition at line 135 of file UncertainSZLine.h.

136 {
137 return m_chi2;
138 }

◆ covariance()

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

Getter for individual elements of the covariance matrix.

Definition at line 123 of file UncertainSZLine.h.

124 {
125 return szCovariance()(iRow, iCol);
126 }

◆ invalidate()

void invalidate ( )
inline

Sets all line parameters to zero including the covariance matrix.

Definition at line 159 of file UncertainSZLine.h.

160 {
161 m_szLine.invalidate();
162 m_szCovariance = SZUtil::identity();
163 m_chi2 = 0.0;
164 m_ndf = 0;
165 }

◆ ndf()

std::size_t ndf ( ) const
inline

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

Definition at line 147 of file UncertainSZLine.h.

148 {
149 return m_ndf;
150 }

◆ operator const SZLine &()

operator const SZLine & ( ) const
inline

Downcast to the "super" class.

Definition at line 92 of file UncertainSZLine.h.

93 {
94 return m_szLine;
95 }

◆ operator->()

const SZLine * 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 86 of file UncertainSZLine.h.

87 {
88 return &m_szLine;
89 }

◆ passiveMoveBy()

void passiveMoveBy ( const ROOT::Math::XYVector & bySZ)
inline

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

Change is inplace.

Definition at line 184 of file UncertainSZLine.h.

185 {
186 // Move the covariance matrix first to have access to the original parameters
187 SZJacobian jacobian = m_szLine.passiveMoveByJacobian(bySZ);
188 SZUtil::transport(jacobian, m_szCovariance);
189 m_szLine.passiveMoveBy(bySZ);
190 }

◆ passiveMovedCovarianceBy()

SZCovariance passiveMovedCovarianceBy ( const ROOT::Math::XYVector & bySZ) const
inline

Calculates the jacobian matrix that is needed for the translation of the parameter covariance for a passive move of the coordinate system.

Definition at line 197 of file UncertainSZLine.h.

198 {
199 SZJacobian jacobian = m_szLine.passiveMoveByJacobian(bySZ);
200 return SZUtil::transported(jacobian, szCovariance());
201 }

◆ reverse()

void reverse ( )
inline

Reverses the direction of flight represented by this sz line.

Definition at line 169 of file UncertainSZLine.h.

170 {
171 m_szLine.reverse();
172 SZUtil::reverse(m_szCovariance);
173 }

◆ reversed()

UncertainSZLine reversed ( ) const
inline

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

Definition at line 176 of file UncertainSZLine.h.

177 {
178 return UncertainSZLine(m_szLine.reversed(), SZUtil::reversed(szCovariance()), chi2(), ndf());
179 }

◆ setChi2()

void setChi2 ( const double chi2)
inline

Setter for the chi square value of the line fit.

Definition at line 141 of file UncertainSZLine.h.

142 {
143 m_chi2 = chi2;
144 }

◆ setNDF()

void setNDF ( std::size_t ndf)
inline

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

Definition at line 153 of file UncertainSZLine.h.

154 {
155 m_ndf = ndf;
156 }

◆ setSZCovariance()

void setSZCovariance ( const SZCovariance & szCovariance)
inline

Setter for the whole covariance matrix of the sz line parameters.

Definition at line 111 of file UncertainSZLine.h.

112 {
113 m_szCovariance = szCovariance;
114 }

◆ szCovariance()

const SZCovariance & szCovariance ( ) const
inline

Getter for the whole covariance matrix of the sz line parameters.

Definition at line 117 of file UncertainSZLine.h.

118 {
119 return m_szCovariance;
120 }

◆ szLine()

const SZLine & szLine ( ) const
inline

Getter for the underlying sz line.

Definition at line 98 of file UncertainSZLine.h.

99 {
100 return m_szLine;
101 }

◆ szParameters()

SZParameters szParameters ( ) const
inline

Getter for the sz parameters in the order defined by ESZParameter.h.

Definition at line 104 of file UncertainSZLine.h.

105 {
106 return m_szLine.szParameters();
107 }

◆ variance()

double variance ( const ESZParameter & i) const
inline

Getter for individual diagonal elements of the covariance matrix.

Definition at line 129 of file UncertainSZLine.h.

130 {
131 return szCovariance()(i, i);
132 }

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 211 of file UncertainSZLine.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 214 of file UncertainSZLine.h.

◆ m_szCovariance

SZCovariance m_szCovariance = SZUtil::identity()
private

Memory for the 2x2 covariance matrix of sz slope (aka tan lambda) and z0.

Definition at line 208 of file UncertainSZLine.h.

◆ m_szLine

SZLine m_szLine
private

Memory for the underlying line.

Definition at line 205 of file UncertainSZLine.h.


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