98 const T*
a =
A.fArray;
100 const Tv*
b =
B.fArray;
105 #include "RecoTracker/MkFitCore/standalone/CFMatrix33Vector3.ah" 126 for (
int n = 0;
n <
N; ++
n) {
127 x.At(
n, 0, 0) = msPar0.constAt(
n, 0, 0);
128 x.At(
n, 1, 0) = msPar1.constAt(
n, 0, 0);
129 x.At(
n, 2, 0) = msPar2.constAt(
n, 0, 0);
131 y.At(
n, 0, 0) = msPar0.constAt(
n, 1, 0);
132 y.At(
n, 1, 0) = msPar1.constAt(
n, 1, 0);
133 y.At(
n, 2, 0) = msPar2.constAt(
n, 1, 0);
135 z.At(
n, 0, 0) = msPar0.constAt(
n, 2, 0);
136 z.At(
n, 1, 0) = msPar1.constAt(
n, 2, 0);
137 z.At(
n, 2, 0) = msPar2.constAt(
n, 2, 0);
139 for (
int i = 0;
i < 3; ++
i) {
146 for (
int n = 0;
n <
N; ++
n) {
147 outPar.At(
n, 0, 0) =
x.constAt(
n, 0, 0);
148 outPar.At(
n, 1, 0) = y.constAt(
n, 0, 0);
149 outPar.At(
n, 2, 0) = z.constAt(
n, 0, 0);
155 for (
int n = 0;
n <
N; ++
n) {
160 x.constAt(
n, 0, 0) *
x.constAt(
n, 0, 0) * invvarR2 + y.constAt(
n, 0, 0) * y.constAt(
n, 0, 0) * varPhi;
161 outErr.At(
n, 0, 1) =
x.constAt(
n, 0, 0) * y.constAt(
n, 0, 0) * (invvarR2 - varPhi);
163 outErr.At(
n, 1, 0) = outErr.constAt(
n, 0, 1);
165 y.constAt(
n, 0, 0) * y.constAt(
n, 0, 0) * invvarR2 +
x.constAt(
n, 0, 0) *
x.constAt(
n, 0, 0) * varPhi;
173 for (
int n = 0;
n <
N; ++
n) {
181 for (
int n = 0;
n <
N; ++
n) {
182 if (xtou.At(
n, 0, 0))
184 for (
int i = 0;
i < 3; ++
i) {
185 u.At(
n,
i, 0) =
x.constAt(
n,
i, 0) /
r2.constAt(
n,
i, 0);
186 v.At(
n,
i, 0) = y.constAt(
n,
i, 0) /
r2.constAt(
n,
i, 0);
190 for (
int i = 0;
i < 3; ++
i) {
191 u.At(
n,
i, 0) = y.constAt(
n,
i, 0) /
r2.constAt(
n,
i, 0);
192 v.At(
n,
i, 0) =
x.constAt(
n,
i, 0) /
r2.constAt(
n,
i, 0);
199 for (
int n = 0;
n <
N; ++
n) {
200 for (
int i = 0;
i < 3; ++
i) {
201 A.At(
n,
i, 0) = 1.0f;
202 A.At(
n,
i, 1) = -u.constAt(
n,
i, 0);
203 A.At(
n,
i, 2) = -u.constAt(
n,
i, 0) * u.constAt(
n,
i, 0);
212 for (
int n = 0;
n <
N; ++
n) {
213 b.At(
n, 0, 0) = 1.0f / (2.0f *
C.constAt(
n, 0, 0));
214 a.At(
n, 0, 0) =
b.constAt(
n, 0, 0) *
C.constAt(
n, 1, 0);
222 for (
int n = 0;
n <
N; ++
n) {
224 (xtou.constAt(
n, 0, 0) ?
x.constAt(
n, 0, 0) -
a.constAt(
n, 0, 0) :
x.constAt(
n, 0, 0) -
b.constAt(
n, 0, 0));
226 (xtou.constAt(
n, 0, 0) ? y.constAt(
n, 0, 0) -
b.constAt(
n, 0, 0) : y.constAt(
n, 0, 0) -
a.constAt(
n, 0, 0));
227 pT.At(
n, 0, 0) =
k *
hipo(vrx.constAt(
n, 0, 0), vry.constAt(
n, 0, 0));
228 px.At(
n, 0, 0) = std::copysign(
k * vry.constAt(
n, 0, 0),
x.constAt(
n, 2, 0) -
x.constAt(
n, 0, 0));
229 py.At(
n, 0, 0) = std::copysign(
k * vrx.constAt(
n, 0, 0), y.constAt(
n, 2, 0) - y.constAt(
n, 0, 0));
230 pz.At(
n, 0, 0) = (
pT.constAt(
n, 0, 0) * (z.constAt(
n, 2, 0) - z.constAt(
n, 0, 0))) /
231 hipo((
x.constAt(
n, 2, 0) -
x.constAt(
n, 0, 0)), (y.constAt(
n, 2, 0) - y.constAt(
n, 0, 0)));
235 for (
int n = 0;
n <
N; ++
n) {
236 outPar.At(
n, 3, 0) = 1.0f /
pT.constAt(
n, 0, 0);
237 outPar.At(
n, 4, 0) =
getPhi(
px.constAt(
n, 0, 0),
py.constAt(
n, 0, 0));
238 outPar.At(
n, 5, 0) =
getTheta(
pT.constAt(
n, 0, 0), pz.constAt(
n, 0, 0));
239 #ifdef INWARDFIT // arctan is odd, so pz -> -pz means theta -> -theta 241 outPar.At(
n, 5, 0) *= -1.0f;
246 for (
int n = 0;
n <
N; ++
n) {
255 for (
int n = 0;
n <
N; ++
n) {
256 dprintf(
"afterCF seedID: %1u \n", seedID.constAt(
n, 0, 0));
259 for (
int i = 0;
i < 6;
i++) {
261 for (
int j = 0;
j < 6;
j++) {
262 updatedState.errors[
i][
j] = outErr.constAt(
n,
i,
j);
267 updatedState.convertFromCCSToCartesian();
269 dprint(
"--------------------------------");
Matriplex::Matriplex< float, HH, HH, NN > MPlexHH
void conformalFitMPlex(bool fitting, MPlexQI seedID, MPlexLS &outErr, MPlexLV &outPar, const MPlexHV &msPar0, const MPlexHV &msPar1, const MPlexHV &msPar2)
Matriplex::Matriplex< float, HH, 1, NN > MPlexHV
float getTheta(float r, float z)
Matriplex::Matriplex< float, LL, 1, NN > MPlexLV
constexpr float phierr012
constexpr float thetaerr049
constexpr Matriplex::idx_t NN
float getRad2(float x, float y)
Abs< T >::type abs(const T &t)
constexpr float ptinverr049
Matriplex::Matriplex< int, 1, 1, NN > MPlexQI
constexpr float thetaerr012
Matriplex::Matriplex< float, 1, 1, NN > MPlexQF
void invertCramer(MPlex< T, D, D, N > &A, double *determ=nullptr)
float hipo(float x, float y)
void print(std::string_view label, const MeasurementState &s)
float getPhi(float x, float y)
constexpr float phierr049
void CFMap(const MPlexHH &A, const MPlexHV &B, MPlexHV &C)
Matriplex::MatriplexSym< float, LL, NN > MPlexLS
constexpr float ptinverr012
#define ASSUME_ALIGNED(a, b)