19 const std::array<double, eSize>&
values) noexcept(
false)
24 Eigen::Translation<double, 2>(
Vector2D(0, -
get(eAveragePhi)));
45 double m = std::tan(
phi);
47 double x1 = (O_x + O_y * m -
48 std::sqrt(-std::pow(O_x, 2) * std::pow(m, 2) +
49 2 * O_x * O_y * m - std::pow(O_y, 2) +
50 std::pow(m, 2) * std::pow(r, 2) + std::pow(r, 2))) /
52 double x2 = (O_x + O_y * m +
53 std::sqrt(-std::pow(O_x, 2) * std::pow(m, 2) +
54 2 * O_x * O_y * m - std::pow(O_y, 2) +
55 std::pow(m, 2) * std::pow(r, 2) + std::pow(r, 2))) /
66 get(eMaxR),
get(eMaxPhiRel));
68 get(eMinR),
get(eMaxPhiRel));
70 get(eMaxR),
get(eMinPhiRel));
72 get(eMinR),
get(eMinPhiRel));
97 unsigned int lseg)
const {
99 std::vector<Acts::Vector2D> rvertices;
106 std::vector<double> phisInner =
108 std::vector<double> phisOuter =
112 for (
unsigned int iseg = 0; iseg < phisInner.size() - 1; ++iseg) {
113 int addon = (iseg == phisInner.size() - 2) ? 1 : 0;
114 detail::VerticesHelper::createSegment<Vector2D, Eigen::Affine2d>(
115 rvertices, {
get(eMinR),
get(eMinR)}, phisInner[iseg],
116 phisInner[iseg + 1], lseg, addon);
119 for (
unsigned int iseg = 0; iseg < phisOuter.size() - 1; ++iseg) {
120 int addon = (iseg == phisOuter.size() - 2) ? 1 : 0;
121 detail::VerticesHelper::createSegment<Vector2D, Eigen::Affine2d>(
122 rvertices, {
get(eMaxR),
get(eMaxR)}, phisOuter[iseg],
123 phisOuter[iseg + 1], lseg, addon);
130 double tolPhi)
const {
134 double phiLoc = locpo_rotated[
eLOC_PHI];
135 double rLoc = locpo_rotated[
eLOC_R];
137 if (phiLoc < (
get(eMinPhiRel) - tolPhi) ||
138 phiLoc > (
get(eMaxPhiRel) + tolPhi)) {
149 if (r_mod2 <
get(eMinR) *
get(eMinR) || r_mod2 >
get(eMaxR) *
get(eMaxR)) {
158 if (r_mod < (
get(eMinR) - tolR) || r_mod > (
get(eMaxR) + tolR)) {
168 if (bcheck.
type() == BoundaryCheck::Type::eAbsolute) {
174 if (inside(lposition, 0., 0.)) {
186 double dphi = m_phiAvg;
187 double phi_strip = locpo_rotated[
eLOC_PHI];
188 double r_strip = locpo_rotated[
eLOC_R];
247 double cosDPhiPhiStrip = std::cos(dphi - phi_strip);
248 double sinDPhiPhiStrip = std::sin(dphi - phi_strip);
250 double A = O_x * O_x + 2 * O_x * r_strip * cosDPhiPhiStrip + O_y * O_y -
251 2 * O_y * r_strip * sinDPhiPhiStrip + r_strip * r_strip;
252 double sqrtA = std::sqrt(A);
254 double B = cosDPhiPhiStrip;
255 double C = -sinDPhiPhiStrip;
256 Eigen::Matrix<double, 2, 2> jacobianStripPCToModulePC;
257 jacobianStripPCToModulePC(0, 0) = (B * O_x + C * O_y + r_strip) / sqrtA;
258 jacobianStripPCToModulePC(0, 1) =
259 r_strip * (B * O_y + O_x * sinDPhiPhiStrip) / sqrtA;
260 jacobianStripPCToModulePC(1, 0) = -(B * O_y - C * O_x) / A;
261 jacobianStripPCToModulePC(1, 1) =
262 r_strip * (B * O_x + C * O_y + r_strip) / A;
267 auto covModulePC = jacobianStripPCToModulePC * covStripPC *
268 jacobianStripPCToModulePC.transpose();
271 auto weightStripPC = covStripPC.inverse();
272 auto weightModulePC = covModulePC.inverse();
283 locpo_rotated, weightStripPC);
284 currentDist = squaredNorm(locpo_rotated - currentClosest, weightStripPC);
285 minDist = currentDist;
288 locpo_rotated, weightStripPC);
289 currentDist = squaredNorm(locpo_rotated - currentClosest, weightStripPC);
290 if (currentDist < minDist) {
291 minDist = currentDist;
298 locpo_rotated[
eLOC_R] * std::sin(locpo_rotated[eLOC_PHI]));
299 Vector2D locpoModulePC = stripXYToModulePC(locpoStripXY);
305 locpoModulePC, weightModulePC);
306 currentDist = squaredNorm(locpoModulePC - currentClosest, weightModulePC);
307 if (currentDist < minDist) {
308 minDist = currentDist;
312 locpoModulePC, weightModulePC);
313 currentDist = squaredNorm(locpoModulePC - currentClosest, weightModulePC);
314 if (currentDist < minDist) {
315 minDist = currentDist;
334 double rStrip = locpo_rotated[
eLOC_R];
335 double phiStrip = locpo_rotated[
eLOC_PHI];
336 Vector2D locpoStripXY(rStrip * std::cos(phiStrip),
337 rStrip * std::sin(phiStrip));
339 double rMod = locpoModuleXY.norm();
351 curDist =
std::abs(
get(eMinR) - rMod);
352 if (curDist < minDist) {
360 if (curDist < minDist) {
366 if (curDist < minDist) {
371 if (
get(eMinPhiRel) <= phiStrip && phiStrip <
get(eMaxPhiRel)) {
373 curDist =
std::abs(
get(eMaxR) - rMod);
374 if (curDist < minDist) {
380 if (curDist < minDist) {
386 if (curDist < minDist) {
396 curDist = (closestLeft - locpoStripXY).
norm();
397 if (curDist < minDist) {
403 locpoStripXY, weight);
404 curDist = (closestRight - locpoStripXY).
norm();
405 if (curDist < minDist) {
420 const Eigen::Matrix<double, 2, 2>&
weight)
const {
424 auto f = (
n.transpose() * weight *
n).
value();
426 auto u = ((p -
a).transpose() * weight *
n).
value() /
f;
433 return (v.transpose() * weight *
v).
value();
437 return Eigen::Rotation2D<double>(m_phiAvg) * m_moduleOrigin;
442 sl << std::setiosflags(std::ios::fixed);
443 sl << std::setprecision(7);
444 sl <<
"Acts::AnnulusBounds: (innerRadius, outerRadius, minPhi, maxPhi) = ";
445 sl <<
"(" <<
get(eMinR) <<
", " <<
get(eMaxR) <<
", " <<
phiMin() <<
", "
446 << phiMax() <<
")" <<
'\n';
451 sl << std::setprecision(-1);