From b9577c3cbcf3b8355bf3e73a3171888932a6a6f0 Mon Sep 17 00:00:00 2001 From: cvarni Date: Sun, 6 Oct 2024 13:13:38 +0200 Subject: [PATCH] hypot as well --- Core/include/Acts/EventData/SpacePointContainer.ipp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Core/include/Acts/EventData/SpacePointContainer.ipp b/Core/include/Acts/EventData/SpacePointContainer.ipp index e0c381e4a50..65d9111a3cd 100644 --- a/Core/include/Acts/EventData/SpacePointContainer.ipp +++ b/Core/include/Acts/EventData/SpacePointContainer.ipp @@ -42,8 +42,7 @@ void SpacePointContainer::initialize() { m_data.setX(i, external_container.x_impl(i) - m_options.beamPos[0]); m_data.setY(i, external_container.y_impl(i) - m_options.beamPos[1]); m_data.setZ(i, external_container.z_impl(i)); - m_data.setRadius( - i, std::sqrt(m_data.x(i) * m_data.x(i) + m_data.y(i) * m_data.y(i))); + m_data.setRadius(i, std::hypot(m_data.x(i), m_data.y(i))); m_data.setPhi(i, std::atan2(m_data.y(i), m_data.x(i))); m_data.setVarianceR(i, external_container.varianceR_impl(i)); m_data.setVarianceZ(i, external_container.varianceZ_impl(i));