Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: use std::atan2 instead of atan2f #3695

Merged
merged 4 commits into from
Oct 6, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions Core/include/Acts/EventData/SpacePointContainer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
#include <any>
#include <vector>

#include <math.h>

namespace Acts {

struct SpacePointContainerConfig {
Expand Down
7 changes: 3 additions & 4 deletions Core/include/Acts/EventData/SpacePointContainer.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.

#include <math.h>
CarloVarni marked this conversation as resolved.
Show resolved Hide resolved
#include <cmath>

namespace Acts {

Expand Down Expand Up @@ -42,9 +42,8 @@ void SpacePointContainer<container_t, holder_t>::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.setPhi(i, atan2f(m_data.y(i), m_data.x(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));

Expand Down
Loading