Skip to content

Commit

Permalink
fix: DiscTrapezoidBounds vertices (#2541)
Browse files Browse the repository at this point in the history
This PR fixes the vertices calculation of a trapezoid in the local  frame (before the transformation).
  • Loading branch information
XiaocongAi authored Oct 13, 2023
1 parent 16e44c0 commit 43411f1
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions Core/src/Surfaces/DiscTrapezoidBounds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,13 @@ std::vector<Acts::Vector2> Acts::DiscTrapezoidBounds::vertices(
unsigned int /*lseg*/) const {
Vector2 cAxis(std::cos(get(eAveragePhi)), std::sin(get(eAveragePhi)));
Vector2 nAxis(cAxis.y(), -cAxis.x());
return {get(eMinR) * cAxis - get(eHalfLengthXminR) * nAxis,
get(eMinR) * cAxis + get(eHalfLengthXminR) * nAxis,
m_ymax * cAxis + get(eHalfLengthXmaxR) * nAxis,
m_ymax * cAxis - get(eHalfLengthXmaxR) * nAxis};
auto ymin = std::sqrt(get(eMinR) * get(eMinR) -
get(eHalfLengthXminR) * get(eHalfLengthXminR));
auto halfY = (m_ymax - ymin) / 2;
return {-halfY * cAxis - get(eHalfLengthXminR) * nAxis,
-halfY * cAxis + get(eHalfLengthXminR) * nAxis,
halfY * cAxis + get(eHalfLengthXmaxR) * nAxis,
halfY * cAxis - get(eHalfLengthXmaxR) * nAxis};
}

// ostream operator overload
Expand Down

0 comments on commit 43411f1

Please sign in to comment.