-
Notifications
You must be signed in to change notification settings - Fork 3
/
SoLKalMatrix.cxx
125 lines (111 loc) · 3.42 KB
/
SoLKalMatrix.cxx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
//c++
#include <iostream>
#include <iomanip>
//ROOT
#include "TString.h"
//SoLIDTracking
#include "SoLKalMatrix.h"
ClassImp(SoLKalMatrix)
//___________________________________________________________
SoLKalMatrix::SoLKalMatrix(Int_t rowdim, Int_t coldim)
:TMatrixD(rowdim, coldim)
{
}
//___________________________________________________________
SoLKalMatrix::SoLKalMatrix(const SoLKalMatrix &orig)
:TMatrixD(orig)
{
}
//___________________________________________________________
SoLKalMatrix::SoLKalMatrix(const TMatrixD &orig)
:TMatrixD(orig)
{
}
//___________________________________________________________
SoLKalMatrix::SoLKalMatrix(TMatrixD::EMatrixCreatorsOp1 op,
const SoLKalMatrix &prototype)
:TMatrixD(op, prototype)
{
}
//___________________________________________________________
SoLKalMatrix::SoLKalMatrix(TMatrixD::EMatrixCreatorsOp1 op,
const TMatrixD &prototype)
:TMatrixD(op, prototype)
{
}
//___________________________________________________________
SoLKalMatrix::SoLKalMatrix(const SoLKalMatrix &a,
TMatrixD::EMatrixCreatorsOp2 op,
const SoLKalMatrix &b)
:TMatrixD(a, op, b)
{
}
//___________________________________________________________
SoLKalMatrix::SoLKalMatrix(const TMatrixD &a,
TMatrixD::EMatrixCreatorsOp2 op,
const TMatrixD &b)
:TMatrixD(a, op, b)
{
}
//___________________________________________________________
SoLKalMatrix::SoLKalMatrix(const TVector3 &v)
:TMatrixD(SoLKalMatrix::ToKalMat(v))
{
}
//___________________________________________________________
void SoLKalMatrix::DebugPrint(Option_t *opt, Int_t ncolsps) const
{
using namespace std;
Int_t ncols = GetNcols();
Int_t nrows = GetNrows();
Int_t nsheets = (ncols-1)/ncolsps + 1;
Int_t lastcw = ncols - ncolsps*(nsheets-1);
Int_t ns = 0;
TString title(opt);
TString off(title.Length());
for (Int_t c=0; c<title.Length(); c++) off += " ";
for (Int_t sc = 1; sc <= ncols; sc += ncolsps) {
ns++;
if (ns == 1) cerr << title << "+-";
if (ns == nsheets) {
for (Int_t ib = 1; ib <= 11*lastcw; ib++) cerr << " ";
cerr << "-+" << endl;
} else {
cerr << endl;
}
for (Int_t i = 1; i <= nrows; i++) {
if (ns == 1) cerr << off << "| ";
for (Int_t j = sc; j < sc+ncolsps && j <= ncols; j++) {
cerr // << setiosflags(ios::scientific)
<< setw(11) << setprecision(4)
<< (*this)(i-1,j-1);
if (j == ncols) cerr << " |";
}
cerr << endl;
}
if (ns == 1) cerr << off << "+-";
if (ns == nsheets) {
for (Int_t ib = 1; ib <= 11*lastcw; ib++) cerr << " ";
cerr << "-+" << endl;
} else {
cerr << endl;
}
}
}
//___________________________________________________________
SoLKalMatrix SoLKalMatrix::ToKalMat(const TVector3 &a)
{
SoLKalMatrix md(3,1);
md(0,0) = a.x();
md(1,0) = a.y();
md(2,0) = a.z();
return md;
}
//___________________________________________________________
TVector3 SoLKalMatrix::ToThreeVec(const TMatrixD &a)
{
TVector3 v;
v.SetXYZ(a(0,0), a(1,0),a(2,0));
return v;
}
//___________________________________________________________