Belle II Software  release-08-01-10
PrecisionMatrixUtil Struct Reference

Collection of functions related to precision matrices. More...

#include <PrecisionMatrixUtil.h>

Static Public Member Functions

template<int N>
static PrecisionMatrix< N > identity ()
 Constructs an identity matrix.
 
template<int N>
static void transport (const JacobianMatrix< N, N > &ambiguity, PrecisionMatrix< N > &precision)
 Transport the precision matrix inplace with the given jacobian matrix.
 
template<int M, int N>
static PrecisionMatrix< M > transported (const JacobianMatrix< N, M > &ambiguity, const PrecisionMatrix< N > &precision)
 Return a copy of the precision matrix transported with the given back projection jacobian matrix.
 
template<int N>
static void scale (const ParameterVector< N > &scales, PrecisionMatrix< N > &precision)
 Scale the precision inplace by the given factors in each parameter.
 
template<int N>
static PrecisionMatrix< N > scale (const ParameterVector< N > &scales, const PrecisionMatrix< N > &precision)
 Return a copy of the precision scaled by the given factors in each parameter.
 
template<int N1, int N2>
static PrecisionMatrix< N1+N2 > stackBlocks (const PrecisionMatrix< N1 > &block1, const PrecisionMatrix< N2 > &block2)
 Combines two precision matrices by putting them in two blocks on the diagonal of a larger matrix.
 
template<class APrecisionMatrix , int I = 0, int N = 0>
static APrecisionMatrix getSub (const PrecisionMatrix< N > &precision)
 Gets a subprecision from a precision matrix.
 
template<int N>
static double average (const ParameterVector< N > &parameter1, const PrecisionMatrix< N > &precision1, const ParameterVector< N > &parameter2, const PrecisionMatrix< N > &precision2, ParameterVector< N > &parameter, PrecisionMatrix< N > &precision)
 Averages two parameter vectors taking into account their respective precision. More...
 
template<int M, int N1, int N2>
static double average (const ParameterVector< N1 > &parameter1, const PrecisionMatrix< N1 > &precision1, const JacobianMatrix< N1, M > &ambiguity1, const ParameterVector< N2 > &parameter2, const PrecisionMatrix< N2 > &precision2, const JacobianMatrix< N2, M > &ambiguity2, ParameterVector< M > &parameter, PrecisionMatrix< M > &precision)
 Averages two parameter vectors from a projected space taking into account their respective precisions and ambiguity matrices. More...
 

Detailed Description

Collection of functions related to precision matrices.

Definition at line 30 of file PrecisionMatrixUtil.h.

Member Function Documentation

◆ average() [1/2]

static double average ( const ParameterVector< N > &  parameter1,
const PrecisionMatrix< N > &  precision1,
const ParameterVector< N > &  parameter2,
const PrecisionMatrix< N > &  precision2,
ParameterVector< N > &  parameter,
PrecisionMatrix< N > &  precision 
)
inlinestatic

Averages two parameter vectors taking into account their respective precision.

Parameters
parameter1First parameters
precision1Precision matrix to the first parameters
parameter2Second parameters
precision2Precision matrix to the second parameters
[out]parameterAveraged parameters
[out]precisionAveraged precision matrix
Returns
Chi square deviation of orignal parameters to the average

Definition at line 104 of file PrecisionMatrixUtil.h.

110  {
111  const auto& ePrecision1 = mapToEigen(precision1);
112  const auto& ePrecision2 = mapToEigen(precision2);
113  auto&& ePrecision = mapToEigen(precision);
114 
115  const auto& eParameter1 = mapToEigen(parameter1);
116  const auto& eParameter2 = mapToEigen(parameter2);
117  auto&& eParameter = mapToEigen(parameter);
118 
119  ePrecision = ePrecision1 + ePrecision2;
120  eParameter = ePrecision.colPivHouseholderQr().solve(ePrecision1 * eParameter1 +
121  ePrecision2 * eParameter2);
122 
123  auto eResidual1 = eParameter1 - eParameter;
124  auto eResidual2 = eParameter2 - eParameter;
125 
126  Eigen::Matrix<double, 1, 1> chi2 = (eResidual1.transpose() * ePrecision1 * eResidual1 +
127  eResidual2.transpose() * ePrecision2 * eResidual2);
128  return chi2[0];
129  }

◆ average() [2/2]

static double average ( const ParameterVector< N1 > &  parameter1,
const PrecisionMatrix< N1 > &  precision1,
const JacobianMatrix< N1, M > &  ambiguity1,
const ParameterVector< N2 > &  parameter2,
const PrecisionMatrix< N2 > &  precision2,
const JacobianMatrix< N2, M > &  ambiguity2,
ParameterVector< M > &  parameter,
PrecisionMatrix< M > &  precision 
)
inlinestatic

Averages two parameter vectors from a projected space taking into account their respective precisions and ambiguity matrices.

Parameters
parameter1First parameters
precision1Precision matrix to the first parameters
ambiguity1Projection ambiguity of the first parameters
parameter2Second parameters
precision2Precision matrix to the second parameters
ambiguity2Projection ambiguity of the second parameters
[out]parameterAveraged parameters
[out]precisionAveraged precision matrix
Returns
Chi square deviation of original parameters to the average

Definition at line 146 of file PrecisionMatrixUtil.h.


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