3 #include <Math/SMatrix.h>
4 #include <Math/MatrixFunctions.h>
27 typedef SVector<double, 3> Vector3;
29 typedef SMatrix<double, 3, 3, MatRepSym<double, 3> > Matrix3S;
30 typedef SMatrix<double, 6, 6, MatRepSym<double, 6> > Matrix6S;
31 typedef SMatrix<double, 3, 3> Matrix33;
32 typedef SMatrix<double, 3, 6> Matrix36;
82 bool withMeasurementError)
const {
91 double rho2 = pred.
rho2();
97 double mom = momentum.
mag();
99 Vector3
b =
conv(direction) / rho;
100 Vector3
d =
conv(momentum) / mom;
101 double l = Dot(
b,
d);
102 double g = 1. / (1. -
sqr(
l));
105 Vector3
bd =
b -
l *
d;
108 Matrix33 pA = TensorProd(
b,
bd);
109 Matrix33 pB = TensorProd(
b, ca);
112 jacobian.Place_at(-pA + Matrix33(SMatrixIdentity()), 0, 0);
113 jacobian.Place_at(pB / rho, 0, 3);
116 if (withMeasurementError) {
117 jacobian.Place_at(pA, 0, 0);
118 jacobian.Place_at(-pB / mom, 0, 3);
126 bool withGhostTrackError)
const {
135 double rho2 = pred.
rho2();
141 double mom = momentum.
mag();
143 Vector3
b =
conv(direction) / rho;
144 Vector3
d =
conv(momentum) / mom;
145 double l = Dot(
b,
d);
146 double g = 1. / (1. -
sqr(
l));
149 Vector3
bd =
l *
b -
d;
152 Matrix33 pC = TensorProd(
d,
bd);
153 Matrix33 pD = TensorProd(
d, ca);
156 jacobian.Place_at(pC + Matrix33(SMatrixIdentity()), 0, 0);
157 jacobian.Place_at(pD / mom, 0, 3);
160 if (withGhostTrackError) {
161 jacobian.Place_at(-pC, 0, 0);
162 jacobian.Place_at(-pD / rho, 0, 3);