Belle II Software development
HelixUtil Struct Reference

Utility struct for functions and types related to the helix parameters. More...

#include <HelixParameters.h>

Inheritance diagram for HelixUtil:
UncertainParametersUtil< HelixUtil, EHelixParameter >

Public Types

using PerigeeAmbiguity = TrackFindingCDC::JacobianMatrix<3, 5>
 Matrix type for the ambiguity to the perigee parameters, e.g. under the stereo projection.
 
using EParamaters
 Indices of the parameters.
 
using ParameterVector
 The vector type representing the n related parameters.
 
using CovarianceMatrix
 The matrix type representing the covariance of the n related parameters.
 
using PrecisionMatrix
 The matrix type representing the precision of the n related parameters.
 
using JacobianMatrix
 The matrix type used to translate covariances and precisions im auto mapping of the parameter space.
 

Static Public Member Functions

static HelixUtil::ParameterVector reversalSigns ()
 Getter for the signs which have to be applied to reverse the parameters.
 
static PerigeeUtil::ParameterVector getPerigeeParameters (const ParameterVector &helixPar)
 Get helix parameters related to the xy space.
 
static SZUtil::ParameterVector getSZParameters (const ParameterVector &helixPar)
 Get sz parameters.
 
static HelixUtil::ParameterVector stack (const PerigeeUtil::ParameterVector &perigeePar, const SZUtil::ParameterVector &szPar)
 Combine parameters from the xy space and the sz space.
 
static PerigeeUtil::CovarianceMatrix getPerigeeCovariance (const CovarianceMatrix &helixCov)
 Get perigee covariance matrix related to the xy space.
 
static SZUtil::CovarianceMatrix getSZCovariance (const CovarianceMatrix &helixCov)
 Get sz covariance matrix.
 
static HelixUtil::CovarianceMatrix stackBlocks (const PerigeeUtil::CovarianceMatrix &perigeeCov, const SZUtil::CovarianceMatrix &szCov)
 Combine covariance matrices from the xy space and the sz space in their respective blocks.
 
static PerigeeAmbiguity defaultPerigeeAmbiguity ()
 Initialise a default covariance matrix to zero.
 
static double average (const HelixUtil::ParameterVector &fromPar, const HelixUtil::CovarianceMatrix &fromCov, const HelixUtil::ParameterVector &toPar, const HelixUtil::CovarianceMatrix &toCov, HelixUtil::ParameterVector &avgPar, HelixUtil::CovarianceMatrix &avgCov)
 Calculates the weighted average between two helix parameter sets with their respective covariance matrix.
 
static double average (const PerigeeUtil::ParameterVector &fromPar, const PerigeeUtil::CovarianceMatrix &fromCov, const HelixUtil::PerigeeAmbiguity &fromAmbiguity, const HelixUtil::ParameterVector &toPar, const HelixUtil::CovarianceMatrix &toCov, HelixUtil::ParameterVector &avgPar, HelixUtil::CovarianceMatrix &avgCov)
 Calculates the weighted average between a perigee parameter sets and helix parameter sets with their respective covariance matrix under consideration of the relative ambiguity between the helix and the given perigee parameters.
 
static double average (const PerigeeUtil::ParameterVector &fromPar, const PerigeeUtil::CovarianceMatrix &fromCov, const HelixUtil::PerigeeAmbiguity &fromAmbiguity, const PerigeeUtil::ParameterVector &toPar, const PerigeeUtil::CovarianceMatrix &toCov, const HelixUtil::PerigeeAmbiguity &toAmbiguity, const SZUtil::ParameterVector &szParameters, HelixUtil::ParameterVector &avgPar, HelixUtil::CovarianceMatrix &avgCov)
 Calculates the weighted average between two perigee parameter sets with their respective covariance matrix under consideration of their relative ambiguity to a helix near the sz parameters given as a reference.
 
static void transport (const JacobianMatrix &jacobian, CovarianceMatrix &cov)
 Transport the covariance matrix inplace with the given jacobian matrix.
 
static CovarianceMatrix transported (const JacobianMatrix &jacobian, const CovarianceMatrix &cov)
 Return a copy of the covariance matrix transported with the given jacobian matrix.
 
static JacobianMatrix reversalJacobian ()
 Jacobian matrix needed in the reversal operation of the parameter vector.
 
static void reverse (CovarianceMatrix &cov)
 Reverse the covariance matrix inplace.
 
static CovarianceMatrix reversed (const CovarianceMatrix &cov)
 Return a copy of the reversed covariance matrix.
 
static CovarianceMatrix identity ()
 Returns an identity matrix.
 
static CovarianceMatrix covarianceFromPrecision (const PrecisionMatrix &prec)
 Convert the precision matrix to the corresponding covariance matrix.
 
static PrecisionMatrix precisionFromCovariance (const CovarianceMatrix &cov)
 Convert the covariance matrix to the corresponding precision matrix.
 
static CovarianceMatrix covarianceFromFullPrecision (const PrecisionMatrix &prec)
 Convert the precision matrix to the corresponding covariance matrix.
 
static PrecisionMatrix precisionFromFullCovariance (const CovarianceMatrix &cov)
 Convert the covariance matrix to the corresponding precision matrix.
 
static AParameterVector getSubParameterVector (const ParameterVector &par)
 Getter for a sub part of the covariance matrix.
 
static ACovarianceMatrix getSubCovarianceMatrix (const CovarianceMatrix &cov)
 Getter for a sub part of the covariance matrix.
 

Static Public Attributes

static const size_t c_N
 Number of elements.
 

Detailed Description

Utility struct for functions and types related to the helix parameters.

Definition at line 56 of file HelixParameters.h.

Member Typedef Documentation

◆ CovarianceMatrix

using CovarianceMatrix
inherited

The matrix type representing the covariance of the n related parameters.

Definition at line 36 of file UncertainParameters.h.

◆ EParamaters

using EParamaters
inherited

Indices of the parameters.

Definition at line 27 of file UncertainParameters.h.

◆ JacobianMatrix

using JacobianMatrix
inherited

The matrix type used to translate covariances and precisions im auto mapping of the parameter space.

Definition at line 42 of file UncertainParameters.h.

◆ ParameterVector

using ParameterVector
inherited

The vector type representing the n related parameters.

Definition at line 33 of file UncertainParameters.h.

◆ PerigeeAmbiguity

Matrix type for the ambiguity to the perigee parameters, e.g. under the stereo projection.

Definition at line 82 of file HelixParameters.h.

◆ PrecisionMatrix

using PrecisionMatrix
inherited

The matrix type representing the precision of the n related parameters.

Definition at line 39 of file UncertainParameters.h.

Member Function Documentation

◆ average() [1/3]

double average ( const HelixUtil::ParameterVector & fromPar,
const HelixUtil::CovarianceMatrix & fromCov,
const HelixUtil::ParameterVector & toPar,
const HelixUtil::CovarianceMatrix & toCov,
HelixUtil::ParameterVector & avgPar,
HelixUtil::CovarianceMatrix & avgCov )
static

Calculates the weighted average between two helix parameter sets with their respective covariance matrix.

Returns the chi2 value of the average.

Definition at line 70 of file HelixParameters.cc.

76{
77 using namespace NHelixParameterIndices;
78 HelixParameters refPar = (fromPar + toPar) / 2.0;
79 refPar[c_Phi0] = AngleUtil::average(fromPar[c_Phi0], toPar[c_Phi0]);
80
81 HelixParameters relFromPar = fromPar - refPar;
82 AngleUtil::normalise(relFromPar[c_Phi0]);
83
84 HelixParameters relToPar = toPar - refPar;
85 AngleUtil::normalise(relToPar[c_Phi0]);
86
87 HelixParameters relAvgPar;
88 double chi2 =
89 CovarianceMatrixUtil::average(relFromPar, fromCov, relToPar, toCov, relAvgPar, avgCov);
90
91 avgPar = relAvgPar + refPar;
92 AngleUtil::normalise(avgPar[c_Phi0]);
93
94 return chi2;
95}
@ c_Phi0
Constant to address the azimuth angle of the direction of flight.
static void normalise(double &angle)
Normalise an angle inplace to lie in the range from [-pi, pi].
Definition Angle.h:41
static double average(const double angle1, double angle2)
Combines two angular values to the one that lies half way between them on the short arc.
Definition Angle.h:27
static double average(const ParameterVector< N > &par1, const CovarianceMatrix< N > &cov1, const ParameterVector< N > &par2, const CovarianceMatrix< N > &cov2, ParameterVector< N > &par, CovarianceMatrix< N > &cov)
Averages two parameter vectors taking into account their respective covariances.

◆ average() [2/3]

static double average ( const PerigeeUtil::ParameterVector & fromPar,
const PerigeeUtil::CovarianceMatrix & fromCov,
const HelixUtil::PerigeeAmbiguity & fromAmbiguity,
const HelixUtil::ParameterVector & toPar,
const HelixUtil::CovarianceMatrix & toCov,
HelixUtil::ParameterVector & avgPar,
HelixUtil::CovarianceMatrix & avgCov )
static

Calculates the weighted average between a perigee parameter sets and helix parameter sets with their respective covariance matrix under consideration of the relative ambiguity between the helix and the given perigee parameters.

Returns the chi2 value of the average.

◆ average() [3/3]

static double average ( const PerigeeUtil::ParameterVector & fromPar,
const PerigeeUtil::CovarianceMatrix & fromCov,
const HelixUtil::PerigeeAmbiguity & fromAmbiguity,
const PerigeeUtil::ParameterVector & toPar,
const PerigeeUtil::CovarianceMatrix & toCov,
const HelixUtil::PerigeeAmbiguity & toAmbiguity,
const SZUtil::ParameterVector & szParameters,
HelixUtil::ParameterVector & avgPar,
HelixUtil::CovarianceMatrix & avgCov )
static

Calculates the weighted average between two perigee parameter sets with their respective covariance matrix under consideration of their relative ambiguity to a helix near the sz parameters given as a reference.

Returns the chi2 value of the average.

◆ covarianceFromFullPrecision()

auto covarianceFromFullPrecision ( const PrecisionMatrix & prec)
staticinherited

Convert the precision matrix to the corresponding covariance matrix.

Faster version with foreknowledge that the precision is of full rank.

Definition at line 73 of file UncertainParameters.icc.h.

92 {
93 return CovarianceMatrixUtil::fromFullPrecision(prec);
94 }

◆ covarianceFromPrecision()

auto covarianceFromPrecision ( const PrecisionMatrix & prec)
staticinherited

Convert the precision matrix to the corresponding covariance matrix.

Definition at line 64 of file UncertainParameters.icc.h.

78 {
79 return CovarianceMatrixUtil::fromPrecision(prec);
80 }

◆ defaultPerigeeAmbiguity()

HelixUtil::PerigeeAmbiguity defaultPerigeeAmbiguity ( )
static

Initialise a default covariance matrix to zero.

Definition at line 65 of file HelixParameters.cc.

66{
68}
static PlainMatrix< T, M, N > Zero()
Construct a matrix initialized with zeros.
Definition PlainMatrix.h:67

◆ getPerigeeCovariance()

PerigeeUtil::CovarianceMatrix getPerigeeCovariance ( const CovarianceMatrix & helixCov)
static

Get perigee covariance matrix related to the xy space.

Definition at line 46 of file HelixParameters.cc.

47{
48 using namespace NHelixParameterIndices;
50}
static ACovarianceMatrix getSubCovarianceMatrix(const CovarianceMatrix &cov)

◆ getPerigeeParameters()

PerigeeUtil::ParameterVector getPerigeeParameters ( const ParameterVector & helixPar)
static

Get helix parameters related to the xy space.

Definition at line 27 of file HelixParameters.cc.

28{
29 using namespace NHelixParameterIndices;
31}

◆ getSubCovarianceMatrix()

ACovarianceMatrix getSubCovarianceMatrix ( const CovarianceMatrix & cov)
staticinherited

Getter for a sub part of the covariance matrix.

Definition at line 87 of file UncertainParameters.icc.h.

71 {
72 return CovarianceMatrixUtil::getSub<ACovarianceMatrix, I>(cov);
73 }

◆ getSubParameterVector()

AParameterVector getSubParameterVector ( const ParameterVector & par)
staticinherited

Getter for a sub part of the covariance matrix.

Definition at line 83 of file UncertainParameters.icc.h.

63 {
64 return ParameterVectorUtil::getSub<AParameterVector, I>(par);
65 }

◆ getSZCovariance()

SZUtil::CovarianceMatrix getSZCovariance ( const CovarianceMatrix & helixCov)
static

Get sz covariance matrix.

Definition at line 52 of file HelixParameters.cc.

53{
54 using namespace NHelixParameterIndices;
56}

◆ getSZParameters()

SZUtil::ParameterVector getSZParameters ( const ParameterVector & helixPar)
static

Get sz parameters.

Definition at line 33 of file HelixParameters.cc.

34{
35 using namespace NHelixParameterIndices;
37}

◆ identity()

auto identity ( )
staticinherited

Returns an identity matrix.

Definition at line 61 of file UncertainParameters.icc.h.

55 {
56 return CovarianceMatrixUtil::identity<c_N>();
57 }

◆ precisionFromCovariance()

auto precisionFromCovariance ( const CovarianceMatrix & cov)
staticinherited

Convert the covariance matrix to the corresponding precision matrix.

Definition at line 67 of file UncertainParameters.icc.h.

85 {
86 return CovarianceMatrixUtil::toPrecision(cov);
87 }

◆ precisionFromFullCovariance()

auto precisionFromFullCovariance ( const CovarianceMatrix & cov)
staticinherited

Convert the covariance matrix to the corresponding precision matrix.

Faster version with foreknowledge that the precision is of full rank.

Definition at line 79 of file UncertainParameters.icc.h.

99 {
100 return CovarianceMatrixUtil::fullToPrecision(cov);
101 }

◆ reversalJacobian()

auto reversalJacobian ( )
staticinherited

Jacobian matrix needed in the reversal operation of the parameter vector.

Definition at line 52 of file UncertainParameters.icc.h.

38 {
39 return JacobianMatrixUtil::scale(T::reversalSigns());
40 }

◆ reversalSigns()

HelixUtil::ParameterVector reversalSigns ( )
static

Getter for the signs which have to be applied to reverse the parameters.

Definition at line 22 of file HelixParameters.cc.

23{
25}
static ParameterVector< N1+N2 > stack(const ParameterVector< N1 > &upperPar, const ParameterVector< N2 > &lowerPar)
Combines two parameter vectors by stacking them over each other.
static ParameterVector reversalSigns()
Getter for the signs which have to be applied to reverse the traversal direction.
static ParameterVector reversalSigns()
Getter for the signs which have to be applied to reverse the parameters.

◆ reverse()

void reverse ( CovarianceMatrix & cov)
staticinherited

Reverse the covariance matrix inplace.

Definition at line 55 of file UncertainParameters.icc.h.

44 {
45 return transport(reversalJacobian(), cov);
46 }

◆ reversed()

auto reversed ( const CovarianceMatrix & cov)
staticinherited

Return a copy of the reversed covariance matrix.

Definition at line 58 of file UncertainParameters.icc.h.

50 {
51 return transported(reversalJacobian(), cov);
52 }

◆ stack()

HelixUtil::ParameterVector stack ( const PerigeeUtil::ParameterVector & perigeePar,
const SZUtil::ParameterVector & szPar )
static

Combine parameters from the xy space and the sz space.

Definition at line 39 of file HelixParameters.cc.

41{
42 ParameterVector result = ParameterVectorUtil::stack(perigeePar, szPar);
43 return result;
44}

◆ stackBlocks()

HelixUtil::CovarianceMatrix stackBlocks ( const PerigeeUtil::CovarianceMatrix & perigeeCov,
const SZUtil::CovarianceMatrix & szCov )
static

Combine covariance matrices from the xy space and the sz space in their respective blocks.

Definition at line 58 of file HelixParameters.cc.

60{
61 CovarianceMatrix result = CovarianceMatrixUtil::stackBlocks(perigeeCov, szCov);
62 return result;
63}
static CovarianceMatrix< N1+N2 > stackBlocks(const CovarianceMatrix< N1 > &block1, const CovarianceMatrix< N2 > &block2)
Combines two covariance matrices by putting them in two blocks on the diagonal of a larger matrix.

◆ transport()

void transport ( const JacobianMatrix & jacobian,
CovarianceMatrix & cov )
staticinherited

Transport the covariance matrix inplace with the given jacobian matrix.

Definition at line 45 of file UncertainParameters.icc.h.

26 {
27 CovarianceMatrixUtil::transport(jacobian, cov);
28 }

◆ transported()

auto transported ( const JacobianMatrix & jacobian,
const CovarianceMatrix & cov )
staticinherited

Return a copy of the covariance matrix transported with the given jacobian matrix.

Definition at line 48 of file UncertainParameters.icc.h.

33 {
34 return CovarianceMatrixUtil::transported(jacobian, cov);
35 }

Member Data Documentation

◆ c_N

const size_t c_N
staticinherited

Number of elements.

Definition at line 30 of file UncertainParameters.h.


The documentation for this struct was generated from the following files: