Belle II Software development
TMatrixConversion Struct Reference

Convert between TMatrix and CovarianceMatrix representations. More...

#include <TMatrixConversion.h>

Static Public Member Functions

template<int N>
static CovarianceMatrix< N > fromTMatrix (const TMatrixDSym &tCov)
 Create a covariance matrix from a TMatrix representation.
 
template<int N>
static TMatrixDSym toTMatrix (const CovarianceMatrix< N > &cov)
 Translate the covariance matrix to the TMatrix representation.
 

Detailed Description

Convert between TMatrix and CovarianceMatrix representations.

Definition at line 24 of file TMatrixConversion.h.

Member Function Documentation

◆ fromTMatrix()

CovarianceMatrix< N > fromTMatrix ( const TMatrixDSym &  tCov)
static

Create a covariance matrix from a TMatrix representation.

Definition at line 50 of file TMatrixConversion.h.

51 {
52 assert(tCov.GetNrows() == N);
53 assert(tCov.GetNcols() == N);
54 assert(tCov.GetRowLwb() == 0);
55 assert(tCov.GetColLwb() == 0);
56
57 CovarianceMatrix<N> result;
58 for (int i = 0; i < N; ++i) {
59 for (int j = 0; j < N; ++j) {
60 result(i, j) = tCov(i, j);
61 }
62 }
63 return result;
64 }

◆ toTMatrix()

TMatrixDSym toTMatrix ( const CovarianceMatrix< N > &  cov)
static

Translate the covariance matrix to the TMatrix representation.

Definition at line 67 of file TMatrixConversion.h.

68 {
69 TMatrixDSym result(N);
70 for (int i = 0; i < N; ++i) {
71 for (int j = 0; j < N; ++j) {
72 result(i, j) = cov(i, j);
73 }
74 }
75 return result;
76 }

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