59 validateDerivativeOutput(*
this, out);
60 if (ctx.sensorID < 0 || ctx.layerID < 0) {
61 throw std::invalid_argument(
"LegendreDOFSet requires an ITS3 measurement context");
64 const double gloX = ctx.measX * std::cos(ctx.measAlpha);
65 const double gloY = ctx.measX * std::sin(ctx.measAlpha);
72 Eigen::VectorXd arcMismatch = Eigen::VectorXd::Zero(
nDOFs());
74 constexpr std::array<double, 8>
x = {-0.9602898564975363, -0.7966664774136267, -0.5255324099163290, -0.1834346424956498, 0.1834346424956498, 0.5255324099163290, 0.7966664774136267, 0.9602898564975363};
75 constexpr std::array<double, 8>
w = {0.1012285362903763, 0.2223810344533745, 0.3137066458778873, 0.3626837833783620, 0.3626837833783620, 0.3137066458778873, 0.2223810344533745, 0.1012285362903763};
76 const double mid = 0.5 * u;
77 const double half = 0.5 * u;
78 for (
int iq = 0; iq < 8; ++iq) {
79 const double up = mid + (
half *
x[iq]);
82 for (
int i = 0;
i <= mOrder; ++
i) {
83 for (
int j = 0;
j <=
i; ++
j) {
84 arcMismatch[idx] +=
w[iq] * puQ[
j] * pv[
i -
j];
89 arcMismatch *= 0.5 * phiWidth *
half;
93 for (
int i = 0;
i <= mOrder; ++
i) {
94 for (
int j = 0;
j <=
i; ++
j) {
95 const double basis = pu[
j] * pv[
i -
j];
96 out(0, idx) = (ctx.dydx * basis) + arcMismatch[idx];
97 out(1, idx) = ctx.dzdx * basis;
105 validateDerivativeOutput(*
this, out);
106 if (ctx.layerID < 0) {
107 throw std::invalid_argument(
"InextensionalDOFSet requires an ITS3 measurement context");
111 const double phi = std::atan2(
r * std::sin(ctx.measAlpha),
r * std::cos(ctx.measAlpha));
112 const double z = ctx.measZ;
114 for (
int n = 2;
n <= mMaxOrder; ++
n) {
115 const double sn = std::sin(
n * phi);
116 const double cn = std::cos(
n * phi);
117 const double n2 =
static_cast<double>(
n *
n);
120 out(0, off + 0) = -(
z /
r) * (
n * sn + ctx.dydx * n2 * cn);
121 out(1, off + 0) = -cn - ctx.dzdx * (
z /
r) * n2 * cn;
123 out(0, off + 1) = (
z /
r) * (
n * cn - ctx.dydx * n2 * sn);
124 out(1, off + 1) = -sn * (1. + ctx.dzdx * (
z /
r) * n2);
126 out(0, off + 2) = -cn + ctx.dydx *
n * sn;
127 out(1, off + 2) = ctx.dzdx *
n * sn;
129 out(0, off + 3) = -sn - ctx.dydx *
n * cn;
130 out(1, off + 3) = -ctx.dzdx *
n * cn;
136 out(0,
betaIdx()) = -phi - ctx.dydx;
void fillDerivatives(const DerivativeContext &ctx, Eigen::Ref< Eigen::MatrixXd > out) const override