|
11 | 11 |
|
12 | 12 | #include "ITS3Align/AlignmentDOF.h" |
13 | 13 |
|
| 14 | +#include <array> |
14 | 15 | #include <cmath> |
15 | 16 | #include <stdexcept> |
16 | 17 |
|
17 | 18 | #include "ITS3Align/AlignmentMath.h" |
18 | 19 | #include "ITS3Base/SpecsV2.h" |
| 20 | +#include "CommonConstants/MathConstants.h" |
19 | 21 |
|
20 | 22 | namespace |
21 | 23 | { |
@@ -64,12 +66,34 @@ void LegendreDOFSet::fillDerivatives(const DerivativeContext& ctx, Eigen::Ref<Ei |
64 | 66 | const auto [u, v] = o2::its3::align::computeUV(gloX, gloY, ctx.measZ, ctx.sensorID, o2::its3::constants::radii[ctx.layerID]); |
65 | 67 | const auto pu = o2::its3::align::legendrePols(mOrder, u); |
66 | 68 | const auto pv = o2::its3::align::legendrePols(mOrder, v); |
| 69 | + const double phiWidth = o2::its3::align::getSensorPhiWidth(ctx.sensorID, o2::its3::constants::radii[ctx.layerID]); |
| 70 | + |
| 71 | + // same intergration as `evaluateLegendreShift' but now for each order separateley |
| 72 | + Eigen::VectorXd arcMismatch = Eigen::VectorXd::Zero(nDOFs()); |
| 73 | + if (std::abs(u) > o2::constants::math::Almost0) { |
| 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]); |
| 80 | + const auto puQ = o2::its3::align::legendrePols(mOrder, up); |
| 81 | + int idx = 0; |
| 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]; |
| 85 | + ++idx; |
| 86 | + } |
| 87 | + } |
| 88 | + } |
| 89 | + arcMismatch *= 0.5 * phiWidth * half; |
| 90 | + } |
67 | 91 |
|
68 | 92 | int idx = 0; |
69 | 93 | for (int i = 0; i <= mOrder; ++i) { |
70 | 94 | for (int j = 0; j <= i; ++j) { |
71 | 95 | const double basis = pu[j] * pv[i - j]; |
72 | | - out(0, idx) = ctx.dydx * basis; |
| 96 | + out(0, idx) = (ctx.dydx * basis) + arcMismatch[idx]; |
73 | 97 | out(1, idx) = ctx.dzdx * basis; |
74 | 98 | ++idx; |
75 | 99 | } |
|
0 commit comments