Belle II Software development
HMatrixQP.cc
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#include <tracking/trackFitting/measurementCreator/measurements/HMatrixQP.h>
9#include <TMatrixT.h> // for TMatrixT
10#include <TMatrixTSym.h> // for TMatrixTSym
11#include <TVectorT.h> // for TVectorT
12#include <cassert> // for assert
13#include <iostream> // for operator<<, basic_ostream, etc
14
15using namespace genfit;
16
17namespace Belle2 {
23 const TMatrixD& HMatrixQP::getMatrix() const
24 {
25 static const double HMatrixContent[5] = {1, 0, 0, 0, 0};
26
27 static const TMatrixD HMatrix(1, 5, HMatrixContent);
28
29 return HMatrix;
30 }
31
32
33 TVectorD HMatrixQP::Hv(const TVectorD& v) const
34 {
35 assert(v.GetNrows() == 5);
36
37 TVectorD returnValue(1);
38
39 returnValue(0) = v(0);
40
41 return returnValue;
42 }
43
44
45 TMatrixD HMatrixQP::MHt(const TMatrixDSym& M) const
46 {
47 assert(M.GetNcols() == 5);
48
49 TMatrixD returnVector(5, 1);
50
51 for (unsigned int i = 0; i < 5; ++i) {
52 returnVector(i, 0) = M(0, i);
53 }
54
55 return returnVector;
56 }
57
58
59 TMatrixD HMatrixQP::MHt(const TMatrixD& M) const
60 {
61 assert(M.GetNcols() == 5);
62
63 TMatrixD returnMatrix(M.GetNrows(), 1);
64
65 for (int i = 0; i < M.GetNrows(); ++i) {
66 returnMatrix(i, 0) = M(0, i);
67 }
68
69 return returnMatrix;
70 }
71
72
73 void HMatrixQP::HMHt(TMatrixDSym& M) const
74 {
75 assert(M.GetNrows() == 5);
76 // Just use the 0,0 entry
77 M.ResizeTo(1, 1);
78 }
79
80
81 void HMatrixQP::Print(const Option_t*) const
82 {
83 std::cout << "V" << std::endl;
84 }
85
87}
TMatrixD MHt(const TMatrixDSym &M) const override
Calculate M * H^T = first column of M.
Definition: HMatrixQP.cc:45
void HMHt(TMatrixDSym &M) const override
Calculate H * M * H^T = M_00.
Definition: HMatrixQP.cc:73
virtual void Print(const Option_t *="") const override
Print a symbol for the matrix for debugging.
Definition: HMatrixQP.cc:81
const TMatrixD & getMatrix() const override
Return the underlying matrix.
Definition: HMatrixQP.cc:23
TVectorD Hv(const TVectorD &v) const override
Calculate H * v = v_0.
Definition: HMatrixQP.cc:33
Abstract base class for different kinds of events.