Belle II Software  release-05-02-19
UncertainParameters.icc.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2016 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Oliver Frost *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 #pragma once
11 
12 #include <tracking/trackFindingCDC/geometry/UncertainParameters.h>
13 
14 #include <tracking/trackFindingCDC/numerics/CovarianceMatrixUtil.h>
15 #include <tracking/trackFindingCDC/numerics/JacobianMatrixUtil.h>
16 #include <tracking/trackFindingCDC/numerics/ParameterVectorUtil.h>
17 
18 namespace Belle2 {
23  namespace TrackFindingCDC {
24 
25  template <class T, class AEParameters>
26  void UncertainParametersUtil<T, AEParameters>::transport(const JacobianMatrix& jacobian,
27  CovarianceMatrix& cov)
28  {
29  CovarianceMatrixUtil::transport(jacobian, cov);
30  }
31 
32  template <class T, class AEParameters>
33  auto UncertainParametersUtil<T, AEParameters>::transported(const JacobianMatrix& jacobian,
34  const CovarianceMatrix& cov)
35  -> CovarianceMatrix {
36  return CovarianceMatrixUtil::transported(jacobian, cov);
37  }
38 
39  template <class T, class AEParameters>
41  return JacobianMatrixUtil::scale(T::reversalSigns());
42  }
43 
44  template <class T, class AEParameters>
46  {
47  return transport(reversalJacobian(), cov);
48  }
49 
50  template <class T, class AEParameters>
52  -> CovarianceMatrix {
53  return transported(reversalJacobian(), cov);
54  }
55 
56  template <class T, class AEParameters>
58  return CovarianceMatrixUtil::identity<c_N>();
59  }
60 
61  template <class T, class AEParameters>
62  template <class AParameterVector, int I>
63  AParameterVector
65  {
66  return ParameterVectorUtil::getSub<AParameterVector, I>(par);
67  }
68 
69  template <class T, class AEParameters>
70  template <class ACovarianceMatrix, int I>
71  ACovarianceMatrix
73  {
74  return CovarianceMatrixUtil::getSub<ACovarianceMatrix, I>(cov);
75  }
76 
77  template <class T, class AEParameters>
78  auto
82  }
83 
84  template <class T, class AEParameters>
85  auto
89  }
90 
91  template <class T, class AEParameters>
92  auto
96  }
97 
98  template <class T, class AEParameters>
99  auto
103  }
104  }
106 }
Belle2::TrackFindingCDC::UncertainParametersUtil::reversalJacobian
static JacobianMatrix reversalJacobian()
Jacobian matrix needed in the reversal operation of the parameter vector.
Definition: UncertainParameters.icc.h:48
Belle2::TrackFindingCDC::CovarianceMatrixUtil::transported
static CovarianceMatrix< M > transported(const JacobianMatrix< M, N > &jacobian, const CovarianceMatrix< N > &cov)
Return a copy of the covariance matrix transported with the given jacobian matrix.
Definition: CovarianceMatrixUtil.h:64
Belle2::TrackFindingCDC::JacobianMatrixUtil::scale
static JacobianMatrix< N > scale(const ParameterVector< N > &scales)
Calculates the jacobian matrix for a scaling in each parameter.
Definition: JacobianMatrixUtil.h:76
Belle2::TrackFindingCDC::CovarianceMatrixUtil::toPrecision
static PrecisionMatrix< N > toPrecision(const CovarianceMatrix< N > &cov)
Convert covariance matrix to precision matrix - allows for reduced rank.
Definition: CovarianceMatrixUtil.h:119
Belle2::TrackFindingCDC::UncertainParametersUtil::transport
static void transport(const JacobianMatrix &jacobian, CovarianceMatrix &cov)
Transport the covariance matrix inplace with the given jacobian matrix.
Definition: UncertainParameters.icc.h:34
Belle2::TrackFindingCDC::UncertainParametersUtil::identity
static CovarianceMatrix identity()
Returns an identity matrix.
Definition: UncertainParameters.icc.h:65
Belle2::TrackFindingCDC::UncertainParametersUtil::precisionFromCovariance
static PrecisionMatrix precisionFromCovariance(const CovarianceMatrix &cov)
Convert the covariance matrix to the corresponding precision matrix.
Definition: UncertainParameters.icc.h:94
Belle2::TrackFindingCDC::UncertainParametersUtil::getSubCovarianceMatrix
static ACovarianceMatrix getSubCovarianceMatrix(const CovarianceMatrix &cov)
Getter for a sub part of the covariance matrix.
Definition: UncertainParameters.icc.h:80
Belle2::TrackFindingCDC::UncertainParametersUtil::transported
static CovarianceMatrix transported(const JacobianMatrix &jacobian, const CovarianceMatrix &cov)
Return a copy of the covariance matrix transported with the given jacobian matrix.
Definition: UncertainParameters.icc.h:41
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::TrackFindingCDC::CovarianceMatrixUtil::fullToPrecision
static PrecisionMatrix< N > fullToPrecision(const CovarianceMatrix< N > &cov)
Convert precision matrix to covariance matrix - assumes full rank.
Definition: CovarianceMatrixUtil.h:137
Belle2::TrackFindingCDC::UncertainParametersUtil::getSubParameterVector
static AParameterVector getSubParameterVector(const ParameterVector &par)
Getter for a sub part of the covariance matrix.
Definition: UncertainParameters.icc.h:72
Belle2::TrackFindingCDC::UncertainParametersUtil::covarianceFromPrecision
static CovarianceMatrix covarianceFromPrecision(const PrecisionMatrix &prec)
Convert the precision matrix to the corresponding covariance matrix.
Definition: UncertainParameters.icc.h:87
Belle2::TrackFindingCDC::CovarianceMatrixUtil::transport
static void transport(const JacobianMatrix< N, N > &jacobian, CovarianceMatrix< N > &cov)
Transport the covariance matrix inplace with the given jacobian matrix.
Definition: CovarianceMatrixUtil.h:57
Belle2::TrackFindingCDC::CovarianceMatrixUtil::fromPrecision
static CovarianceMatrix< N > fromPrecision(const PrecisionMatrix< N > &prec)
Convert precision matrix to covariance matrix - allows for reduced rank.
Definition: CovarianceMatrixUtil.h:110
Belle2::TrackFindingCDC::UncertainParametersUtil::covarianceFromFullPrecision
static CovarianceMatrix covarianceFromFullPrecision(const PrecisionMatrix &prec)
Convert the precision matrix to the corresponding covariance matrix.
Definition: UncertainParameters.icc.h:101
Belle2::TrackFindingCDC::CovarianceMatrixUtil::fromFullPrecision
static CovarianceMatrix< N > fromFullPrecision(const PrecisionMatrix< N > &prec)
Convert covariance matrix to precision matrix - assumes full rank.
Definition: CovarianceMatrixUtil.h:128
Belle2::TrackFindingCDC::PlainMatrix
A matrix implementation to be used as an interface typ through out the track finder.
Definition: PlainMatrix.h:50
Belle2::TrackFindingCDC::UncertainParametersUtil::reversed
static CovarianceMatrix reversed(const CovarianceMatrix &cov)
Return a copy of the reversed covariance matrix.
Definition: UncertainParameters.icc.h:59
Belle2::TrackFindingCDC::UncertainParametersUtil::reverse
static void reverse(CovarianceMatrix &cov)
Reverse the covariance matrix inplace.
Definition: UncertainParameters.icc.h:53
Belle2::TrackFindingCDC::UncertainParametersUtil::precisionFromFullCovariance
static PrecisionMatrix precisionFromFullCovariance(const CovarianceMatrix &cov)
Convert the covariance matrix to the corresponding precision matrix.
Definition: UncertainParameters.icc.h:108