Skip to content

Commit

Permalink
std::numbers::pi
Browse files Browse the repository at this point in the history
  • Loading branch information
cvarni authored and cvarni committed Oct 7, 2024
1 parent a4f1f64 commit c1b9897
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions Core/include/Acts/Seeding/detail/CylindricalSpacePointGrid.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "Acts/Seeding/SeedFinderConfig.hpp"
#include "Acts/Utilities/Grid.hpp"

#include <numbers>
#include <vector>

namespace Acts {
Expand Down Expand Up @@ -56,9 +57,9 @@ struct CylindricalSpacePointGridConfig {
// maximum impact parameter in mm
double impactMax = 0 * Acts::UnitConstants::mm;
// minimum phi value for phiAxis construction
double phiMin = -M_PI;
double phiMin = -std::numbers::pi;
// maximum phi value for phiAxis construction
double phiMax = M_PI;
double phiMax = std::numbers::pi;
// Multiplicator for the number of phi-bins. The minimum number of phi-bins
// depends on min_pt, magnetic field: 2*M_PI/(minPT particle phi-deflection).
// phiBinDeflectionCoverage is a multiplier for this number. If
Expand Down Expand Up @@ -89,13 +90,14 @@ struct CylindricalSpacePointGridConfig {
config.zMin /= 1_mm;
config.deltaRMax /= 1_mm;

if (config.phiMin < -M_PI || config.phiMax > M_PI) {
throw std::runtime_error(
"CylindricalSpacePointGridConfig: phiMin (" +
std::to_string(config.phiMin) + ") and/or phiMax (" +
std::to_string(config.phiMax) +
") are outside "
"the allowed phi range, defined as [-M_PI, M_PI]");
if (config.phiMin < -std::numbers::pi || config.phiMax > std::numbers::pi) {
throw std::runtime_error("CylindricalSpacePointGridConfig: phiMin (" +
std::to_string(config.phiMin) +
") and/or phiMax (" +
std::to_string(config.phiMax) +
") are outside "
"the allowed phi range, defined as "
"[-std::numbers::pi, std::numbers::pi]");
}
if (config.phiMin > config.phiMax) {
throw std::runtime_error(
Expand All @@ -116,7 +118,7 @@ struct CylindricalSpacePointGridConfig {

struct CylindricalSpacePointGridOptions {
// magnetic field
float bFieldInZ = 0;
double bFieldInZ = 0.;
bool isInInternalUnits = false;
CylindricalSpacePointGridOptions toInternalUnits() const {
if (isInInternalUnits) {
Expand Down

0 comments on commit c1b9897

Please sign in to comment.