Belle II Software development
TMatrixConversion.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8#pragma once
9
10#include <tracking/trackFindingCDC/numerics/CovarianceMatrix.h>
11
12#include <TMatrixDSymfwd.h>
13
16namespace Belle2 {
21 namespace TrackFindingCDC {
22
25
27 template <int N>
28 static CovarianceMatrix<N> fromTMatrix(const TMatrixDSym& tCov);
29
31 template <int N>
32 static TMatrixDSym toTMatrix(const CovarianceMatrix<N>& cov);
33 };
34 }
36}
37
40#include <TMatrixDSym.h>
41
42namespace Belle2 {
47 namespace TrackFindingCDC {
48
49 template <int N>
51 {
52 assert(tCov.GetNrows() == N);
53 assert(tCov.GetNcols() == N);
54 assert(tCov.GetRowLwb() == 0);
55 assert(tCov.GetColLwb() == 0);
56
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 }
65
66 template <int N>
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 }
77 }
79}
A matrix implementation to be used as an interface typ through out the track finder.
Definition: PlainMatrix.h:40
Abstract base class for different kinds of events.
Convert between TMatrix and CovarianceMatrix representations.
static CovarianceMatrix< N > fromTMatrix(const TMatrixDSym &tCov)
Create a covariance matrix from a TMatrix representation.
static TMatrixDSym toTMatrix(const CovarianceMatrix< N > &cov)
Translate the covariance matrix to the TMatrix representation.