diff --git a/Core/include/Acts/Clusterization/TimedClusterization.hpp b/Core/include/Acts/Clusterization/TimedClusterization.hpp index e92ebce44e2..a53e7793f56 100644 --- a/Core/include/Acts/Clusterization/TimedClusterization.hpp +++ b/Core/include/Acts/Clusterization/TimedClusterization.hpp @@ -17,16 +17,16 @@ namespace Acts::Ccl { template concept HasRetrievableTimeInfo = requires(Cell cell) { - { getCellTime(cell) } -> std::same_as; + { getCellTime(cell) } -> std::same_as; }; template struct TimedConnect : public Acts::Ccl::DefaultConnect { - Acts::ActsScalar timeTolerance{std::numeric_limits::max()}; + double timeTolerance{std::numeric_limits::max()}; TimedConnect() = default; - TimedConnect(Acts::ActsScalar time); - TimedConnect(Acts::ActsScalar time, bool commonCorner) + TimedConnect(double time); + TimedConnect(double time, bool commonCorner) requires(N == 2); ~TimedConnect() override = default; diff --git a/Core/include/Acts/Clusterization/TimedClusterization.ipp b/Core/include/Acts/Clusterization/TimedClusterization.ipp index 0e7b3e5bda8..556d02ccce1 100644 --- a/Core/include/Acts/Clusterization/TimedClusterization.ipp +++ b/Core/include/Acts/Clusterization/TimedClusterization.ipp @@ -9,11 +9,10 @@ namespace Acts::Ccl { template -TimedConnect::TimedConnect(Acts::ActsScalar time) - : timeTolerance(time) {} +TimedConnect::TimedConnect(double time) : timeTolerance(time) {} template -TimedConnect::TimedConnect(Acts::ActsScalar time, bool commonCorner) +TimedConnect::TimedConnect(double time, bool commonCorner) requires(N == 2) : Acts::Ccl::DefaultConnect(commonCorner), timeTolerance(time) {} diff --git a/Core/include/Acts/Definitions/Algebra.hpp b/Core/include/Acts/Definitions/Algebra.hpp index 843958a3282..70070625161 100644 --- a/Core/include/Acts/Definitions/Algebra.hpp +++ b/Core/include/Acts/Definitions/Algebra.hpp @@ -47,24 +47,23 @@ namespace Acts { /// /// Defaults to `double` but can be customized by the user. #ifdef ACTS_CUSTOM_SCALARTYPE -using ActsScalar = ACTS_CUSTOM_SCALARTYPE; +using double = ACTS_CUSTOM_SCALARTYPE; #else -using ActsScalar = double; +using double = double; #endif template -using ActsVector = Eigen::Matrix; +using ActsVector = Eigen::Matrix; template -using ActsMatrix = Eigen::Matrix; +using ActsMatrix = Eigen::Matrix; template -using ActsSquareMatrix = Eigen::Matrix; +using ActsSquareMatrix = Eigen::Matrix; -using ActsDynamicVector = Eigen::Matrix; +using ActsDynamicVector = Eigen::Matrix; -using ActsDynamicMatrix = - Eigen::Matrix; +using ActsDynamicMatrix = Eigen::Matrix; /// @defgroup coordinates-types Fixed-size vector/matrix types for coordinates /// @@ -84,22 +83,22 @@ using SquareMatrix3 = ActsSquareMatrix<3>; using SquareMatrix4 = ActsSquareMatrix<4>; // pure translation transformations -using Translation2 = Eigen::Translation; -using Translation3 = Eigen::Translation; +using Translation2 = Eigen::Translation; +using Translation3 = Eigen::Translation; // linear (rotation) matrices using RotationMatrix2 = ActsMatrix<2, 2>; using RotationMatrix3 = ActsMatrix<3, 3>; // pure rotation defined by a rotation angle around a rotation axis -using AngleAxis3 = Eigen::AngleAxis; +using AngleAxis3 = Eigen::AngleAxis; // combined affine transformations. types are chosen for better data alignment: // - 2d affine compact stored as 2x3 matrix // - 3d affine stored as 4x4 matrix -using Transform2 = Eigen::Transform; -using Transform3 = Eigen::Transform; +using Transform2 = Eigen::Transform; +using Transform3 = Eigen::Transform; -constexpr ActsScalar s_transformEquivalentTolerance = 1e-9; +constexpr double s_transformEquivalentTolerance = 1e-9; } // namespace Acts diff --git a/Core/include/Acts/Definitions/Direction.hpp b/Core/include/Acts/Definitions/Direction.hpp index d07646bab26..985caac0e6c 100644 --- a/Core/include/Acts/Definitions/Direction.hpp +++ b/Core/include/Acts/Definitions/Direction.hpp @@ -41,7 +41,7 @@ class Direction final { /// @param scalar is the signed value /// /// @return a direction enum - static constexpr Direction fromScalar(ActsScalar scalar) { + static constexpr Direction fromScalar(double scalar) { assert(scalar != 0); return scalar >= 0 ? Value::Positive : Value::Negative; } @@ -53,7 +53,7 @@ class Direction final { /// @param scalar is the signed value /// /// @return a direction enum - static constexpr Direction fromScalarZeroAsPositive(ActsScalar scalar) { + static constexpr Direction fromScalarZeroAsPositive(double scalar) { return scalar >= 0 ? Value::Positive : Value::Negative; } diff --git a/Core/include/Acts/Definitions/Tolerance.hpp b/Core/include/Acts/Definitions/Tolerance.hpp index 0b8ef36e55f..3c6fb1e76c0 100644 --- a/Core/include/Acts/Definitions/Tolerance.hpp +++ b/Core/include/Acts/Definitions/Tolerance.hpp @@ -15,19 +15,18 @@ namespace Acts { /// Tolerance for being numerical equal for geometry building -static constexpr ActsScalar s_epsilon = - 3 * std::numeric_limits::epsilon(); +static constexpr double s_epsilon = 3 * std::numeric_limits::epsilon(); /// Tolerance for being on Surface /// /// @note This is intentionally given w/o an explicit unit to avoid having /// to include the units header unnecessarily. With the native length /// unit of mm this corresponds to 0.1um. -static constexpr ActsScalar s_onSurfaceTolerance = 1e-4; +static constexpr double s_onSurfaceTolerance = 1e-4; /// Tolerance for not being within curvilinear projection /// this allows using the same curvilinear frame to eta = 6, /// validity tested with IntegrationTests/PropagationTest -static constexpr ActsScalar s_curvilinearProjTolerance = 0.999995; +static constexpr double s_curvilinearProjTolerance = 0.999995; } // namespace Acts diff --git a/Core/include/Acts/Detector/Blueprint.hpp b/Core/include/Acts/Detector/Blueprint.hpp index 3be0d6353db..1e3ec527674 100644 --- a/Core/include/Acts/Detector/Blueprint.hpp +++ b/Core/include/Acts/Detector/Blueprint.hpp @@ -51,7 +51,7 @@ struct Node final { /// @param cs the children of the node /// @param e the estimated extent of the node (optional) Node(const std::string& n, const Transform3& t, VolumeBounds::BoundsType bt, - const std::vector& bv, const std::vector& bss, + const std::vector& bv, const std::vector& bss, std::vector> cs = {}, const Extent& e = Extent()) : name(n), transform(t), @@ -73,7 +73,7 @@ struct Node final { /// @param isb the internal structure builder (optional) /// @param e the estimated extent of the node (optional) Node(const std::string& n, const Transform3& t, VolumeBounds::BoundsType bt, - const std::vector& bv, + const std::vector& bv, std::shared_ptr isb = nullptr, const Extent& e = Extent()) : name(n), @@ -90,7 +90,7 @@ struct Node final { /// The boundary type VolumeBounds::BoundsType boundsType = VolumeBounds::eOther; /// The associated values - std::vector boundaryValues = {}; + std::vector boundaryValues = {}; /// Parent node - nullptr for root only const Node* parent = nullptr; /// Branch definitions: children diff --git a/Core/include/Acts/Detector/DetectorVolume.hpp b/Core/include/Acts/Detector/DetectorVolume.hpp index 1617721d62f..903532361f7 100644 --- a/Core/include/Acts/Detector/DetectorVolume.hpp +++ b/Core/include/Acts/Detector/DetectorVolume.hpp @@ -61,8 +61,8 @@ class Detector; class DetectorVolume : public std::enable_shared_from_this { public: using BoundingBox = - Acts::AxisAlignedBoundingBox; + Acts::AxisAlignedBoundingBox; friend class DetectorVolumeFactory; diff --git a/Core/include/Acts/Detector/KdtSurfacesProvider.hpp b/Core/include/Acts/Detector/KdtSurfacesProvider.hpp index fd7086e01df..72bea84737f 100644 --- a/Core/include/Acts/Detector/KdtSurfacesProvider.hpp +++ b/Core/include/Acts/Detector/KdtSurfacesProvider.hpp @@ -34,10 +34,10 @@ class KdtSurfaces { public: /// Broadcast the surface KDT type using KDTS = - KDTree, ActsScalar, std::array, bSize>; + KDTree, double, std::array, bSize>; /// Broadcast the query definition - using Query = std::array; + using Query = std::array; /// Broadcast the entry using Entry = std::pair>; @@ -86,7 +86,7 @@ class KdtSurfaces { /// /// @return the matching surfaces from the KDT structure std::vector> surfaces( - const RangeXD& range) const { + const RangeXD& range) const { // Strip the surfaces std::vector> surfacePtrs; auto surfaceQuery = m_kdt->rangeSearchWithKey(range); @@ -101,7 +101,7 @@ class KdtSurfaces { /// /// @return the matching surfaces fpulled from the KDT structure std::vector> surfaces(const Extent& extent) const { - RangeXD qRange; + RangeXD qRange; for (auto [ibv, v] : enumerate(m_casts)) { qRange[ibv] = extent.range(v); } @@ -148,7 +148,7 @@ class KdtSurfaces { float weight = 1. / cQueries.size(); for (auto& q : cQueries) { std::transform(c.begin(), c.end(), q.begin(), c.begin(), - std::plus()); + std::plus()); } std::for_each(c.begin(), c.end(), [&](auto& v) { v *= weight; }); return c; diff --git a/Core/include/Acts/Detector/MultiWireStructureBuilder.hpp b/Core/include/Acts/Detector/MultiWireStructureBuilder.hpp index 939388c223a..48159bf806c 100644 --- a/Core/include/Acts/Detector/MultiWireStructureBuilder.hpp +++ b/Core/include/Acts/Detector/MultiWireStructureBuilder.hpp @@ -38,7 +38,7 @@ class MultiWireStructureBuilder { Transform3 transform = Transform3::Identity(); /// The bounds of the multi-wire volume - std::vector mlBounds = {}; + std::vector mlBounds = {}; // The binning of the multi wire structure std::vector mlBinning = {}; diff --git a/Core/include/Acts/Detector/ProtoBinning.hpp b/Core/include/Acts/Detector/ProtoBinning.hpp index 371bfe60bd2..3700dfc4d6f 100644 --- a/Core/include/Acts/Detector/ProtoBinning.hpp +++ b/Core/include/Acts/Detector/ProtoBinning.hpp @@ -34,7 +34,7 @@ struct ProtoBinning { /// The axis boundary type: Open, Bound or Closed Acts::AxisBoundaryType boundaryType = Acts::AxisBoundaryType::Bound; /// The binning edges - std::vector edges = {}; + std::vector edges = {}; /// An expansion for the filling (in bins) std::size_t expansion = 0u; /// Indication if this is an auto-range binning @@ -47,7 +47,7 @@ struct ProtoBinning { /// @param e the bin edges (variable binning) /// @param exp the expansion (in bins) ProtoBinning(BinningValue bValue, Acts::AxisBoundaryType bType, - const std::vector& e, std::size_t exp = 0u) + const std::vector& e, std::size_t exp = 0u) : binValue(bValue), axisType(Acts::AxisType::Variable), boundaryType(bType), @@ -67,9 +67,8 @@ struct ProtoBinning { /// @param maxE the highest edge of the binning /// @param nbins the number of bins /// @param exp the expansion (in bins) - ProtoBinning(BinningValue bValue, Acts::AxisBoundaryType bType, - ActsScalar minE, ActsScalar maxE, std::size_t nbins, - std::size_t exp = 0u) + ProtoBinning(BinningValue bValue, Acts::AxisBoundaryType bType, double minE, + double maxE, std::size_t nbins, std::size_t exp = 0u) : binValue(bValue), boundaryType(bType), expansion(exp) { if (minE >= maxE) { std::string msg = "ProtoBinning: Invalid binning for value '"; @@ -84,7 +83,7 @@ struct ProtoBinning { "ProtoBinning: Invalid binning, at least one bin is needed."); } - ActsScalar stepE = (maxE - minE) / nbins; + double stepE = (maxE - minE) / nbins; edges.reserve(nbins + 1); for (std::size_t i = 0; i <= nbins; i++) { edges.push_back(minE + i * stepE); @@ -140,7 +139,7 @@ struct BinningDescription { Acts::AxisBoundaryType boundaryType = bData.option == open ? Acts::AxisBoundaryType::Bound : Acts::AxisBoundaryType::Closed; - std::vector edges; + std::vector edges; if (bData.type == equidistant) { bDesc.binning.push_back(ProtoBinning(bData.binvalue, boundaryType, bData.min, bData.max, bData.bins(), @@ -148,7 +147,7 @@ struct BinningDescription { } else { std::for_each(bData.boundaries().begin(), bData.boundaries().end(), - [&](ActsScalar edge) { edges.push_back(edge); }); + [&](double edge) { edges.push_back(edge); }); bDesc.binning.push_back( ProtoBinning(bData.binvalue, boundaryType, edges, 0u)); } @@ -170,7 +169,7 @@ struct BinningDescription { } else { std::vector edges; std::for_each(b.edges.begin(), b.edges.end(), - [&](ActsScalar edge) { edges.push_back(edge); }); + [&](double edge) { edges.push_back(edge); }); binUtility += BinUtility(edges, bOption, b.binValue); } } diff --git a/Core/include/Acts/Detector/ProtoSupport.hpp b/Core/include/Acts/Detector/ProtoSupport.hpp index 8f1e2581e77..abde3a71539 100644 --- a/Core/include/Acts/Detector/ProtoSupport.hpp +++ b/Core/include/Acts/Detector/ProtoSupport.hpp @@ -38,7 +38,7 @@ struct ProtoSupport { Surface::SurfaceType type = Surface::SurfaceType::Other; /// The offset of the support to an estimated position (e.g. from an extent) - ActsScalar offset = 0.; + double offset = 0.; /// A given extent from the volume, this allows to set support surfaces /// to fit into given volume extensions (flagged by the binning value diff --git a/Core/include/Acts/Detector/VolumeStructureBuilder.hpp b/Core/include/Acts/Detector/VolumeStructureBuilder.hpp index aede963c78c..bf236349b31 100644 --- a/Core/include/Acts/Detector/VolumeStructureBuilder.hpp +++ b/Core/include/Acts/Detector/VolumeStructureBuilder.hpp @@ -42,7 +42,7 @@ class VolumeStructureBuilder : public IExternalStructureBuilder { /// The starting transform Transform3 transform = Transform3::Identity(); /// The values (if already defined) - std::vector boundValues = {}; + std::vector boundValues = {}; /// The optional extent to feed into the values std::optional extent = std::nullopt; /// Some auxiliary information diff --git a/Core/include/Acts/Detector/detail/CuboidalDetectorHelper.hpp b/Core/include/Acts/Detector/detail/CuboidalDetectorHelper.hpp index c9ad46744d3..eda1da8452b 100644 --- a/Core/include/Acts/Detector/detail/CuboidalDetectorHelper.hpp +++ b/Core/include/Acts/Detector/detail/CuboidalDetectorHelper.hpp @@ -73,7 +73,7 @@ DetectorComponent::PortalContainer connect( /// @param logLevel is the screen logging level /// /// @return extracted boundary values -std::array, 3u> xyzBoundaries( +std::array, 3u> xyzBoundaries( const GeometryContext& gctx, const std::vector& volumes, Acts::Logging::Level logLevel = Acts::Logging::INFO); diff --git a/Core/include/Acts/Detector/detail/CylindricalDetectorHelper.hpp b/Core/include/Acts/Detector/detail/CylindricalDetectorHelper.hpp index 05815b1325f..d7cf4cb7831 100644 --- a/Core/include/Acts/Detector/detail/CylindricalDetectorHelper.hpp +++ b/Core/include/Acts/Detector/detail/CylindricalDetectorHelper.hpp @@ -174,7 +174,7 @@ DetectorComponent::PortalContainer wrapInZR( /// /// @return extracted boundary values template -std::array, 3u> rzphiBoundaries( +std::array, 3u> rzphiBoundaries( const GeometryContext& gctx, const volume_container_t& volumes, double precision = 0., Acts::Logging::Level logLevel = Acts::Logging::INFO) { @@ -185,8 +185,8 @@ std::array, 3u> rzphiBoundaries( << " volumes."); // The return boundaries - std::array, 3u> uniqueBoundaries; - auto insertWithPrecision = [&](std::size_t is, ActsScalar value) -> void { + std::array, 3u> uniqueBoundaries; + auto insertWithPrecision = [&](std::size_t is, double value) -> void { if (precision == 0.) { uniqueBoundaries[is].insert(value); return; @@ -199,19 +199,19 @@ std::array, 3u> rzphiBoundaries( if (v->volumeBounds().type() == VolumeBounds::BoundsType::eCylinder) { const auto& bValues = v->volumeBounds().values(); // The min/max values - ActsScalar rMin = bValues[CylinderVolumeBounds::BoundValues::eMinR]; - ActsScalar rMax = bValues[CylinderVolumeBounds::BoundValues::eMaxR]; - ActsScalar zCenter = v->transform(gctx).translation().z(); - ActsScalar zHalfLength = + double rMin = bValues[CylinderVolumeBounds::BoundValues::eMinR]; + double rMax = bValues[CylinderVolumeBounds::BoundValues::eMaxR]; + double zCenter = v->transform(gctx).translation().z(); + double zHalfLength = bValues[CylinderVolumeBounds::BoundValues::eHalfLengthZ]; - ActsScalar zMin = zCenter - zHalfLength; - ActsScalar zMax = zCenter + zHalfLength; - ActsScalar phiCenter = + double zMin = zCenter - zHalfLength; + double zMax = zCenter + zHalfLength; + double phiCenter = bValues[CylinderVolumeBounds::BoundValues::eAveragePhi]; - ActsScalar phiSector = + double phiSector = bValues[CylinderVolumeBounds::BoundValues::eHalfPhiSector]; - ActsScalar phiMin = phiCenter - phiSector; - ActsScalar phiMax = phiCenter + phiSector; + double phiMin = phiCenter - phiSector; + double phiMax = phiCenter + phiSector; // Fill the sets insertWithPrecision(0u, rMin); insertWithPrecision(0u, rMax); @@ -229,12 +229,12 @@ std::array, 3u> rzphiBoundaries( ACTS_VERBOSE("- did yield " << uniqueBoundaries[2u].size() << " boundaries in phi."); - return {{std::vector(uniqueBoundaries[0].begin(), - uniqueBoundaries[0].end()), - std::vector(uniqueBoundaries[1].begin(), - uniqueBoundaries[1].end()), - std::vector(uniqueBoundaries[2].begin(), - uniqueBoundaries[2].end())}}; + return {{std::vector(uniqueBoundaries[0].begin(), + uniqueBoundaries[0].end()), + std::vector(uniqueBoundaries[1].begin(), + uniqueBoundaries[1].end()), + std::vector(uniqueBoundaries[2].begin(), + uniqueBoundaries[2].end())}}; } } // namespace detail::CylindricalDetectorHelper diff --git a/Core/include/Acts/Detector/detail/DetectorVolumeConsistency.hpp b/Core/include/Acts/Detector/detail/DetectorVolumeConsistency.hpp index ebea6a7a4d6..f4de79980f3 100644 --- a/Core/include/Acts/Detector/detail/DetectorVolumeConsistency.hpp +++ b/Core/include/Acts/Detector/detail/DetectorVolumeConsistency.hpp @@ -45,7 +45,7 @@ void checkRotationAlignment( /// @note throws exception if the volumes are not ordered /// /// @return a vector with position differences (ordered) -std::vector checkCenterAlignment( +std::vector checkCenterAlignment( const GeometryContext& gctx, const std::vector>& volumes, BinningValue axisValue); diff --git a/Core/include/Acts/Detector/detail/PortalHelper.hpp b/Core/include/Acts/Detector/detail/PortalHelper.hpp index ec17c487098..ba54513976b 100644 --- a/Core/include/Acts/Detector/detail/PortalHelper.hpp +++ b/Core/include/Acts/Detector/detail/PortalHelper.hpp @@ -34,7 +34,7 @@ class Portal; /// gathered from the sub volumes, the binning description using PortalReplacement = std::tuple, unsigned int, Direction, - std::vector, BinningValue>; + std::vector, BinningValue>; namespace detail::PortalHelper { @@ -62,7 +62,7 @@ void attachExternalNavigationDelegate( void attachDetectorVolumesUpdater( const GeometryContext& gctx, Portal& portal, const std::vector>& volumes, - const Direction& direction, const std::vector& boundaries, + const Direction& direction, const std::vector& boundaries, const BinningValue& binning); /// @brief Create and attach the multi link updator, the portal will get diff --git a/Core/include/Acts/Detector/detail/SupportSurfacesHelper.hpp b/Core/include/Acts/Detector/detail/SupportSurfacesHelper.hpp index e956e215e4f..9c52e961498 100644 --- a/Core/include/Acts/Detector/detail/SupportSurfacesHelper.hpp +++ b/Core/include/Acts/Detector/detail/SupportSurfacesHelper.hpp @@ -32,7 +32,7 @@ using namespace UnitLiterals; namespace Experimental::detail::SupportSurfacesHelper { using SupportSurfaceComponents = - std::tuple, Acts::Transform3>; + std::tuple, Acts::Transform3>; /// @brief A support creator turns an extend into a vector of bound values using SurfaceComponentsCreator = @@ -44,15 +44,15 @@ struct CylindricalSupport { /// - negative indicates inner support /// - zero is centered (not recommended) /// - positive indicates outer support - ActsScalar rOffset = 0.; + double rOffset = 0.; /// Clearance in z in order to make the support surfaces /// not touch the volume boundaries - std::array zClearance = {1_mm, 1_mm}; + std::array zClearance = {1_mm, 1_mm}; /// Clearance in phi if a sectoral support is chosen /// not to touch the volume boundaries - std::array phiClearance = {0.0001_rad, 0.0001_rad}; + std::array phiClearance = {0.0001_rad, 0.0001_rad}; // Type is obviously a cylinder static constexpr Surface::SurfaceType type = Surface::SurfaceType::Cylinder; @@ -71,15 +71,15 @@ struct DiscSupport { /// - negative indicates support an z min /// - zero is centered /// - positive indicates support at z max - ActsScalar zOffset = 0.; + double zOffset = 0.; /// Clearance in r in order to make the support surfaces /// not touch the volume boundaries - std::array rClearance = {1_mm, 1_mm}; + std::array rClearance = {1_mm, 1_mm}; /// Clearance in phi if a sectoral support is chosen /// not to touch the volume boundaries - std::array phiClearance = {0.0001_rad, 0.0001_rad}; + std::array phiClearance = {0.0001_rad, 0.0001_rad}; // Type is obviously a disc static constexpr Surface::SurfaceType type = Surface::SurfaceType::Disc; @@ -98,14 +98,14 @@ struct RectangularSupport { BinningValue pPlacement = BinningValue::binZ; /// Offset in position placement - ActsScalar pOffset = 0.; + double pOffset = 0.; /// Clearance in first local direction - cyclic order - std::array loc0Clearance = {1_mm, 1_mm}; + std::array loc0Clearance = {1_mm, 1_mm}; /// Clearance in phi if a sectoral support is chosen /// not to touch the volume boundaries - std::array loc1Clearance = {1_mm, 1_mm}; + std::array loc1Clearance = {1_mm, 1_mm}; // Type is obviously a plane static constexpr Surface::SurfaceType type = Surface::SurfaceType::Plane; diff --git a/Core/include/Acts/EventData/Charge.hpp b/Core/include/Acts/EventData/Charge.hpp index 6ae62b3d963..64073538a3f 100644 --- a/Core/include/Acts/EventData/Charge.hpp +++ b/Core/include/Acts/EventData/Charge.hpp @@ -67,17 +67,16 @@ struct Neutral { constexpr float absQ() const noexcept { return 0; } - constexpr float extractCharge(ActsScalar /*qOverP*/) const noexcept { + constexpr float extractCharge(double /*qOverP*/) const noexcept { return 0.0f; } - constexpr ActsScalar extractMomentum(ActsScalar qOverP) const noexcept { + constexpr double extractMomentum(double qOverP) const noexcept { assert(qOverP >= 0 && "qOverP cannot be negative"); return 1.0f / qOverP; } - constexpr ActsScalar qOverP(ActsScalar momentum, - float signedQ) const noexcept { + constexpr double qOverP(double momentum, float signedQ) const noexcept { assert((signedQ != 0) && "charge must be 0"); (void)signedQ; return 1.0f / momentum; @@ -110,16 +109,15 @@ struct SinglyCharged { constexpr float absQ() const noexcept { return UnitConstants::e; } - constexpr float extractCharge(ActsScalar qOverP) const noexcept { + constexpr float extractCharge(double qOverP) const noexcept { return std::copysign(UnitConstants::e, qOverP); } - constexpr ActsScalar extractMomentum(ActsScalar qOverP) const noexcept { + constexpr double extractMomentum(double qOverP) const noexcept { return extractCharge(qOverP) / qOverP; } - constexpr ActsScalar qOverP(ActsScalar momentum, - float signedQ) const noexcept { + constexpr double qOverP(double momentum, float signedQ) const noexcept { assert((std::abs(signedQ) == UnitConstants::e) && "absolute charge must be e"); return signedQ / momentum; @@ -151,15 +149,14 @@ class NonNeutralCharge { constexpr float absQ() const noexcept { return m_absQ; } - constexpr float extractCharge(ActsScalar qOverP) const noexcept { + constexpr float extractCharge(double qOverP) const noexcept { return std::copysign(m_absQ, qOverP); } - constexpr ActsScalar extractMomentum(ActsScalar qOverP) const noexcept { + constexpr double extractMomentum(double qOverP) const noexcept { return extractCharge(qOverP) / qOverP; } - constexpr ActsScalar qOverP(ActsScalar momentum, - float signedQ) const noexcept { + constexpr double qOverP(double momentum, float signedQ) const noexcept { assert(std::abs(signedQ) == m_absQ && "inconsistent charge"); return signedQ / momentum; } @@ -194,15 +191,14 @@ class AnyCharge { constexpr float absQ() const noexcept { return m_absQ; } - constexpr float extractCharge(ActsScalar qOverP) const noexcept { + constexpr float extractCharge(double qOverP) const noexcept { return std::copysign(m_absQ, qOverP); } - constexpr ActsScalar extractMomentum(ActsScalar qOverP) const noexcept { + constexpr double extractMomentum(double qOverP) const noexcept { return (m_absQ != 0.0f) ? extractCharge(qOverP) / qOverP : 1.0f / qOverP; } - constexpr ActsScalar qOverP(ActsScalar momentum, - float signedQ) const noexcept { + constexpr double qOverP(double momentum, float signedQ) const noexcept { assert(std::abs(signedQ) == m_absQ && "inconsistent charge"); return (m_absQ != 0.0f) ? signedQ / momentum : 1.0f / momentum; } diff --git a/Core/include/Acts/EventData/GenericBoundTrackParameters.hpp b/Core/include/Acts/EventData/GenericBoundTrackParameters.hpp index 38f297764b1..cddafd203ae 100644 --- a/Core/include/Acts/EventData/GenericBoundTrackParameters.hpp +++ b/Core/include/Acts/EventData/GenericBoundTrackParameters.hpp @@ -36,7 +36,7 @@ namespace Acts { template class GenericBoundTrackParameters { public: - using Scalar = ActsScalar; + using Scalar = double; using ParametersVector = BoundVector; using CovarianceMatrix = BoundSquareMatrix; using ParticleHypothesis = particle_hypothesis_t; @@ -95,7 +95,7 @@ class GenericBoundTrackParameters { const Vector4& pos4, const Vector3& dir, Scalar qOverP, std::optional cov, ParticleHypothesis particleHypothesis, - ActsScalar tolerance = s_onSurfaceTolerance) { + double tolerance = s_onSurfaceTolerance) { Result bound = transformFreeToBoundParameters(pos4.segment<3>(ePos0), pos4[eTime], dir, qOverP, *surface, geoCtx, tolerance); diff --git a/Core/include/Acts/EventData/GenericCurvilinearTrackParameters.hpp b/Core/include/Acts/EventData/GenericCurvilinearTrackParameters.hpp index 6e4ed9bae7a..de5542ce7a2 100644 --- a/Core/include/Acts/EventData/GenericCurvilinearTrackParameters.hpp +++ b/Core/include/Acts/EventData/GenericCurvilinearTrackParameters.hpp @@ -30,7 +30,7 @@ class GenericCurvilinearTrackParameters using Base = GenericBoundTrackParameters; public: - using Scalar = ActsScalar; + using Scalar = double; using ParametersVector = BoundVector; using CovarianceMatrix = BoundSquareMatrix; using ParticleHypothesis = particle_hypothesis_t; diff --git a/Core/include/Acts/EventData/GenericFreeTrackParameters.hpp b/Core/include/Acts/EventData/GenericFreeTrackParameters.hpp index 7a2b4b46522..17915188e56 100644 --- a/Core/include/Acts/EventData/GenericFreeTrackParameters.hpp +++ b/Core/include/Acts/EventData/GenericFreeTrackParameters.hpp @@ -33,7 +33,7 @@ namespace Acts { template class GenericFreeTrackParameters { public: - using Scalar = ActsScalar; + using Scalar = double; using ParametersVector = FreeVector; using CovarianceMatrix = FreeSquareMatrix; using ParticleHypothesis = particle_hypothesis_t; diff --git a/Core/include/Acts/EventData/MultiComponentTrackParameters.hpp b/Core/include/Acts/EventData/MultiComponentTrackParameters.hpp index 70ad87f8d77..aebdcae9422 100644 --- a/Core/include/Acts/EventData/MultiComponentTrackParameters.hpp +++ b/Core/include/Acts/EventData/MultiComponentTrackParameters.hpp @@ -238,8 +238,8 @@ class MultiComponentCurvilinearTrackParameters using covariance_t = BoundSquareMatrix; public: - using ConstructionTuple = std::tuple; + using ConstructionTuple = + std::tuple; private: using Base = MultiComponentBoundTrackParameters; diff --git a/Core/include/Acts/EventData/TrackProxy.hpp b/Core/include/Acts/EventData/TrackProxy.hpp index 6ccb0f402b2..077ee8340b0 100644 --- a/Core/include/Acts/EventData/TrackProxy.hpp +++ b/Core/include/Acts/EventData/TrackProxy.hpp @@ -243,27 +243,27 @@ class TrackProxy { /// Access the theta parameter of the track at the reference surface /// @return The theta parameter - ActsScalar theta() const { return parameters()[eBoundTheta]; } + double theta() const { return parameters()[eBoundTheta]; } /// Access the phi parameter of the track at the reference surface /// @return The phi parameter - ActsScalar phi() const { return parameters()[eBoundPhi]; } + double phi() const { return parameters()[eBoundPhi]; } /// Access the loc0 parameter of the track at the reference surface /// @return The loc0 parameter - ActsScalar loc0() const { return parameters()[eBoundLoc0]; } + double loc0() const { return parameters()[eBoundLoc0]; } /// Access the loc1 parameter of the track at the reference surface /// @return The loc1 parameter - ActsScalar loc1() const { return parameters()[eBoundLoc1]; } + double loc1() const { return parameters()[eBoundLoc1]; } /// Access the time parameter of the track at the reference surface /// @return The time parameter - ActsScalar time() const { return parameters()[eBoundTime]; } + double time() const { return parameters()[eBoundTime]; } /// Access the q/p (curvature) parameter of the track at the reference surface /// @return The q/p parameter - ActsScalar qOverP() const { return parameters()[eBoundQOverP]; } + double qOverP() const { return parameters()[eBoundQOverP]; } /// Get the particle hypothesis /// @return the particle hypothesis @@ -284,17 +284,17 @@ class TrackProxy { /// Get the charge of the tack /// @note this depends on the charge hypothesis /// @return The absolute track momentum - ActsScalar charge() const { return particleHypothesis().qFromQOP(qOverP()); } + double charge() const { return particleHypothesis().qFromQOP(qOverP()); } /// Get the absolute momentum of the tack /// @return The absolute track momentum - ActsScalar absoluteMomentum() const { + double absoluteMomentum() const { return particleHypothesis().extractMomentum(qOverP()); } /// Get the transverse momentum of the track /// @return The track transverse momentum value - ActsScalar transverseMomentum() const { + double transverseMomentum() const { return std::sin(theta()) * absoluteMomentum(); } diff --git a/Core/include/Acts/EventData/TrackStateProxy.hpp b/Core/include/Acts/EventData/TrackStateProxy.hpp index 741bfa5b511..38565b95fcc 100644 --- a/Core/include/Acts/EventData/TrackStateProxy.hpp +++ b/Core/include/Acts/EventData/TrackStateProxy.hpp @@ -82,7 +82,7 @@ template struct FixedSizeTypes { constexpr static auto Flags = Eigen::ColMajor | Eigen::AutoAlign; - using Scalar = ActsScalar; + using Scalar = double; // single items using Coefficients = Eigen::Matrix; @@ -105,7 +105,7 @@ template struct DynamicSizeTypes { constexpr static auto Flags = Eigen::ColMajor | Eigen::AutoAlign; - using Scalar = ActsScalar; + using Scalar = double; using Coefficients = Eigen::Matrix; using Covariance = @@ -119,7 +119,7 @@ struct DynamicSizeTypes { // This is public template struct TrackStateTraits { - using Scalar = ActsScalar; + using Scalar = double; using Parameters = typename detail_lt::FixedSizeTypes::CoefficientsMap; diff --git a/Core/include/Acts/EventData/TransformationHelpers.hpp b/Core/include/Acts/EventData/TransformationHelpers.hpp index e31e29fd3c0..e5877744c4b 100644 --- a/Core/include/Acts/EventData/TransformationHelpers.hpp +++ b/Core/include/Acts/EventData/TransformationHelpers.hpp @@ -69,7 +69,7 @@ FreeVector transformBoundToFreeParameters(const Surface& surface, /// @return Bound track parameters vector on the given surface Result transformFreeToBoundParameters( const FreeVector& freeParams, const Surface& surface, - const GeometryContext& geoCtx, ActsScalar tolerance = s_onSurfaceTolerance); + const GeometryContext& geoCtx, double tolerance = s_onSurfaceTolerance); /// Convert position and direction to bound track parameters. /// @@ -83,9 +83,9 @@ Result transformFreeToBoundParameters( /// /// @return Equivalent bound parameters vector on the given surface Result transformFreeToBoundParameters( - const Vector3& position, ActsScalar time, const Vector3& direction, - ActsScalar qOverP, const Surface& surface, const GeometryContext& geoCtx, - ActsScalar tolerance = s_onSurfaceTolerance); + const Vector3& position, double time, const Vector3& direction, + double qOverP, const Surface& surface, const GeometryContext& geoCtx, + double tolerance = s_onSurfaceTolerance); /// Convert direction to curvilinear track parameters. /// @@ -97,9 +97,9 @@ Result transformFreeToBoundParameters( /// @note The parameters are assumed to be defined at the origin of the /// curvilinear frame derived from the direction vector. The local /// coordinates are zero by construction. -BoundVector transformFreeToCurvilinearParameters(ActsScalar time, +BoundVector transformFreeToCurvilinearParameters(double time, const Vector3& direction, - ActsScalar qOverP); + double qOverP); /// Convert direction angles to curvilinear track parameters. /// @@ -112,9 +112,7 @@ BoundVector transformFreeToCurvilinearParameters(ActsScalar time, /// @note The parameters are assumed to be defined at the origin of the /// curvilinear frame derived from the direction angles. The local /// coordinates are zero by construction. -BoundVector transformFreeToCurvilinearParameters(ActsScalar time, - ActsScalar phi, - ActsScalar theta, - ActsScalar qOverP); +BoundVector transformFreeToCurvilinearParameters(double time, double phi, + double theta, double qOverP); } // namespace Acts diff --git a/Core/include/Acts/EventData/detail/CorrectedTransformationFreeToBound.hpp b/Core/include/Acts/EventData/detail/CorrectedTransformationFreeToBound.hpp index 58283dcfebe..72cb0965507 100644 --- a/Core/include/Acts/EventData/detail/CorrectedTransformationFreeToBound.hpp +++ b/Core/include/Acts/EventData/detail/CorrectedTransformationFreeToBound.hpp @@ -27,12 +27,12 @@ struct FreeToBoundCorrection { bool apply = false; /// UKF tuning parameters - ActsScalar alpha = 0.1; - ActsScalar beta = 2; + double alpha = 0.1; + double beta = 2; /// The cutoff of incident angles cosine for correction - ActsScalar cosIncidentAngleMinCutoff = 1e-5; - ActsScalar cosIncidentAngleMaxCutoff = 0.99500417; + double cosIncidentAngleMinCutoff = 1e-5; + double cosIncidentAngleMaxCutoff = 0.99500417; /// Default constructor FreeToBoundCorrection() = default; @@ -42,7 +42,7 @@ struct FreeToBoundCorrection { /// @param apply_ Whether to apply correction /// @param alpha_ The UKF tuning parameter alpha /// @param beta_ The UKF tuning parameter beta - FreeToBoundCorrection(bool apply_, ActsScalar alpha_, ActsScalar beta_); + FreeToBoundCorrection(bool apply_, double alpha_, double beta_); /// Construct from boolean only /// @@ -65,9 +65,9 @@ struct CorrectedFreeToBoundTransformer { /// @param beta The UKF tuning parameter beta /// @param cosIncidentAngleMinCutoff The cosine of max incident angle /// @param cosIncidentAngleMaxCutoff The cosine of min incident angle - CorrectedFreeToBoundTransformer(ActsScalar alpha, ActsScalar beta, - ActsScalar cosIncidentAngleMinCutoff, - ActsScalar cosIncidentAngleMaxCutoff); + CorrectedFreeToBoundTransformer(double alpha, double beta, + double cosIncidentAngleMinCutoff, + double cosIncidentAngleMaxCutoff); /// Construct from a FreeToBoundCorrection /// @@ -101,16 +101,16 @@ struct CorrectedFreeToBoundTransformer { private: /// The parameters to tune the weight in UKF (0 < alpha <=1) - ActsScalar m_alpha = 0.1; - ActsScalar m_beta = 2; + double m_alpha = 0.1; + double m_beta = 2; /// The maximum incident angle (i.e. minimum cos incident angle) cutoff for /// correction - ActsScalar m_cosIncidentAngleMinCutoff = 1e-5; + double m_cosIncidentAngleMinCutoff = 1e-5; /// The minimum incident angle (i.e. maximum cos incident angle) cutoff for /// correction, note cos(0.1) = 0.99500417 - ActsScalar m_cosIncidentAngleMaxCutoff = 0.99500417; + double m_cosIncidentAngleMaxCutoff = 0.99500417; }; } // namespace detail diff --git a/Core/include/Acts/EventData/detail/GenerateParameters.hpp b/Core/include/Acts/EventData/detail/GenerateParameters.hpp index 64e7bc3405b..b06d853faa6 100644 --- a/Core/include/Acts/EventData/detail/GenerateParameters.hpp +++ b/Core/include/Acts/EventData/detail/GenerateParameters.hpp @@ -236,7 +236,7 @@ template inline std::pair generateBoundParametersCovariance( generator_t& rng, const GenerateBoundParametersOptions& options) { auto params = generateBoundParameters(rng, options); - auto cov = generateCovariance(rng); + auto cov = generateCovariance(rng); return {params, cov}; } @@ -293,7 +293,7 @@ template inline std::pair generateFreeParametersCovariance( generator_t& rng, const GenerateFreeParametersOptions& options) { auto params = generateFreeParameters(rng, options); - auto cov = generateCovariance(rng); + auto cov = generateCovariance(rng); return {params, cov}; } diff --git a/Core/include/Acts/EventData/detail/PrintParameters.hpp b/Core/include/Acts/EventData/detail/PrintParameters.hpp index 38670c230e0..de4be653866 100644 --- a/Core/include/Acts/EventData/detail/PrintParameters.hpp +++ b/Core/include/Acts/EventData/detail/PrintParameters.hpp @@ -46,8 +46,8 @@ void printFreeParameters(std::ostream& os, const FreeVector& params, /// @param params Parameters vector data, must contain size elements /// @param cov Optional Covariance matrix data, must contain sizexsize elements void printMeasurement(std::ostream& os, BoundIndices size, - const std::uint8_t* indices, const ActsScalar* params, - const ActsScalar* cov); + const std::uint8_t* indices, const double* params, + const double* cov); /// Print free measurement content to the output stream. /// @@ -57,8 +57,8 @@ void printMeasurement(std::ostream& os, BoundIndices size, /// @param params Parameters vector data, must contain size elements /// @param cov Optional Covariance matrix data, must contain sizexsize elements void printMeasurement(std::ostream& os, FreeIndices size, - const std::uint8_t* indices, const ActsScalar* params, - const ActsScalar* cov); + const std::uint8_t* indices, const double* params, + const double* cov); } // namespace detail } // namespace Acts diff --git a/Core/include/Acts/EventData/detail/TestSourceLink.hpp b/Core/include/Acts/EventData/detail/TestSourceLink.hpp index affec84aafa..4a98b1a28a9 100644 --- a/Core/include/Acts/EventData/detail/TestSourceLink.hpp +++ b/Core/include/Acts/EventData/detail/TestSourceLink.hpp @@ -47,7 +47,7 @@ struct TestSourceLink final { Acts::ActsSquareMatrix<2> covariance; /// Construct a source link for a 1d measurement. - TestSourceLink(BoundIndices idx, ActsScalar val, ActsScalar var, + TestSourceLink(BoundIndices idx, double val, double var, GeometryIdentifier gid = GeometryIdentifier(), std::size_t sid = 0u) : m_geometryId(gid), diff --git a/Core/include/Acts/EventData/detail/TestTrackState.hpp b/Core/include/Acts/EventData/detail/TestTrackState.hpp index 514ae073c2f..26ef78d8084 100644 --- a/Core/include/Acts/EventData/detail/TestTrackState.hpp +++ b/Core/include/Acts/EventData/detail/TestTrackState.hpp @@ -46,7 +46,7 @@ struct TestTrackState { ParticleHypothesis::pion()), jacobian(BoundMatrix::Identity()), chi2(std::chi_squared_distribution(measdim)(rng)), - pathLength(std::uniform_real_distribution( + pathLength(std::uniform_real_distribution( 1 * Acts::UnitConstants::mm, 10 * Acts::UnitConstants::mm)(rng)) { // set a random geometry identifier to uniquely identify each surface auto geoId = @@ -55,10 +55,10 @@ struct TestTrackState { // create source link w/ inline 1d or 2d measurement data if (measdim == 1u) { - auto [par, cov] = generateParametersCovariance(rng); + auto [par, cov] = generateParametersCovariance(rng); sourceLink = TestSourceLink(eBoundLoc0, par[0], cov(0, 0), geoId); } else if (measdim == 2u) { - auto [par, cov] = generateParametersCovariance(rng); + auto [par, cov] = generateParametersCovariance(rng); sourceLink = TestSourceLink(eBoundLoc1, eBoundQOverP, par, cov, geoId); } else { throw std::runtime_error("invalid number of measurement dimensions"); @@ -85,7 +85,7 @@ struct TestTrackState { for (Eigen::Index c = 0; c < jacobian.cols(); ++c) { for (Eigen::Index r = 0; r < jacobian.rows(); ++r) { jacobian(c, r) += - std::uniform_real_distribution(-0.125, 0.125)(rng); + std::uniform_real_distribution(-0.125, 0.125)(rng); } } } diff --git a/Core/include/Acts/Geometry/ConeVolumeBounds.hpp b/Core/include/Acts/Geometry/ConeVolumeBounds.hpp index 23c8d33b26d..e3f0c36a25c 100644 --- a/Core/include/Acts/Geometry/ConeVolumeBounds.hpp +++ b/Core/include/Acts/Geometry/ConeVolumeBounds.hpp @@ -56,10 +56,9 @@ class ConeVolumeBounds : public VolumeBounds { /// @param halflengthZ The minimum z value of the inner and outer cones /// @param averagePhi The phi orientation of the sector /// @param halfPhiSector The opening angle phi sector - ConeVolumeBounds(ActsScalar innerAlpha, ActsScalar innerOffsetZ, - ActsScalar outerAlpha, ActsScalar outerOffsetZ, - ActsScalar halflengthZ, ActsScalar averagePhi, - ActsScalar halfPhiSector) noexcept(false); + ConeVolumeBounds(double innerAlpha, double innerOffsetZ, double outerAlpha, + double outerOffsetZ, double halflengthZ, double averagePhi, + double halfPhiSector) noexcept(false); /// Constructor - for general cylidner-cone setups /// @@ -72,14 +71,14 @@ class ConeVolumeBounds : public VolumeBounds { /// /// @note depending on cylinderR > coneR it is constructing a cone with /// cylindrical cutout or a cylinder with conical cutout - ConeVolumeBounds(ActsScalar cylinderR, ActsScalar alpha, ActsScalar offsetZ, - ActsScalar halflengthZ, ActsScalar averagePhi, - ActsScalar halfPhiSector) noexcept(false); + ConeVolumeBounds(double cylinderR, double alpha, double offsetZ, + double halflengthZ, double averagePhi, + double halfPhiSector) noexcept(false); /// Constructor - from a fixed size array /// /// @param values The bound values - ConeVolumeBounds(const std::array& values) noexcept(false) + ConeVolumeBounds(const std::array& values) noexcept(false) : m_values(values) { checkConsistency(); buildSurfaceBounds(); @@ -94,14 +93,14 @@ class ConeVolumeBounds : public VolumeBounds { /// Return the bound values as dynamically sized vector /// /// @return this returns a copy of the internal values - std::vector values() const final; + std::vector values() const final; /// This method checks if position in the 3D volume /// frame is inside the cylinder /// /// @param pos is the position in volume frame to be checked /// @param tol is the absolute tolerance to be applied - bool inside(const Vector3& pos, ActsScalar tol = 0.) const final; + bool inside(const Vector3& pos, double tol = 0.) const final; /// Oriented surfaces, i.e. the decomposed boundary surfaces and the /// according navigation direction into the volume given the normal @@ -127,25 +126,25 @@ class ConeVolumeBounds : public VolumeBounds { /// Access to the bound values /// @param bValue the class nested enum for the array access - ActsScalar get(BoundValues bValue) const { return m_values[bValue]; } + double get(BoundValues bValue) const { return m_values[bValue]; } // Return the derived innerRmin - ActsScalar innerRmin() const; + double innerRmin() const; // Return the derived innerRmin - ActsScalar innerRmax() const; + double innerRmax() const; // Return the derived inner tan(alpha) - ActsScalar innerTanAlpha() const; + double innerTanAlpha() const; // Return the derived outerRmin - ActsScalar outerRmin() const; + double outerRmin() const; // Return the derived outerRmax - ActsScalar outerRmax() const; + double outerRmax() const; // Return the derived outer tan(alpha) - ActsScalar outerTanAlpha() const; + double outerTanAlpha() const; /// Output Method for std::ostream /// @@ -161,7 +160,7 @@ class ConeVolumeBounds : public VolumeBounds { void buildSurfaceBounds(); /// The bound values - std::array m_values; + std::array m_values; std::shared_ptr m_innerCylinderBounds{nullptr}; std::shared_ptr m_innerConeBounds{nullptr}; std::shared_ptr m_outerConeBounds{nullptr}; @@ -171,12 +170,12 @@ class ConeVolumeBounds : public VolumeBounds { std::shared_ptr m_sectorBounds{nullptr}; /// Derived values - ActsScalar m_innerRmin = 0.; - ActsScalar m_innerRmax = 0.; - ActsScalar m_innerTanAlpha = 0.; - ActsScalar m_outerRmin = 0.; - ActsScalar m_outerRmax = 0.; - ActsScalar m_outerTanAlpha = 0.; + double m_innerRmin = 0.; + double m_innerRmax = 0.; + double m_innerTanAlpha = 0.; + double m_outerRmin = 0.; + double m_outerRmax = 0.; + double m_outerTanAlpha = 0.; }; } // namespace Acts diff --git a/Core/include/Acts/Geometry/CuboidVolumeBounds.hpp b/Core/include/Acts/Geometry/CuboidVolumeBounds.hpp index 8b8437a91a5..bc3c75ac70d 100644 --- a/Core/include/Acts/Geometry/CuboidVolumeBounds.hpp +++ b/Core/include/Acts/Geometry/CuboidVolumeBounds.hpp @@ -63,13 +63,12 @@ class CuboidVolumeBounds : public VolumeBounds { /// @param halex is the half length of the cube in x /// @param haley is the half length of the cube in y /// @param halez is the half length of the cube in z - CuboidVolumeBounds(ActsScalar halex, ActsScalar haley, - ActsScalar halez) noexcept(false); + CuboidVolumeBounds(double halex, double haley, double halez) noexcept(false); /// Constructor - from a fixed size array /// /// @param values iw the bound values - CuboidVolumeBounds(const std::array& values); + CuboidVolumeBounds(const std::array& values); /// Copy Constructor /// @@ -88,14 +87,14 @@ class CuboidVolumeBounds : public VolumeBounds { /// Return the bound values as dynamically sized vector /// /// @return this returns a copy of the internal values - std::vector values() const final; + std::vector values() const final; /// This method checks if position in the 3D volume /// frame is inside the cylinder /// /// @param pos is the position in volume frame to be checked /// @param tol is the absolute tolerance to be applied - bool inside(const Vector3& pos, ActsScalar tol = 0.) const override; + bool inside(const Vector3& pos, double tol = 0.) const override; /// Oriented surfaces, i.e. the decomposed boundary surfaces and the /// according navigation direction into the volume given the normal @@ -128,25 +127,25 @@ class CuboidVolumeBounds : public VolumeBounds { Acts::BinningValue::binZ}; }; - /// Binning borders in ActsScalar + /// Binning borders in double /// /// @param bValue is the binning schema used /// /// @return float offset to be used for the binning - ActsScalar binningBorder(BinningValue bValue) const final; + double binningBorder(BinningValue bValue) const final; /// Access to the bound values /// @param bValue the class nested enum for the array access - ActsScalar get(BoundValues bValue) const { return m_values[bValue]; } + double get(BoundValues bValue) const { return m_values[bValue]; } /// Set a bound value /// @param bValue the bound value identifier /// @param value the value to be set - void set(BoundValues bValue, ActsScalar value); + void set(BoundValues bValue, double value); /// Set a range of bound values /// @param keyValues the initializer list of key value pairs - void set(std::initializer_list> keyValues); + void set(std::initializer_list> keyValues); /// Output Method for std::ostream /// @@ -155,7 +154,7 @@ class CuboidVolumeBounds : public VolumeBounds { private: /// The bound values ordered in a fixed size array - std::array m_values; + std::array m_values; std::shared_ptr m_xyBounds{nullptr}; std::shared_ptr m_yzBounds{nullptr}; diff --git a/Core/include/Acts/Geometry/CuboidVolumeBuilder.hpp b/Core/include/Acts/Geometry/CuboidVolumeBuilder.hpp index 5912b21ed98..185d55f229d 100644 --- a/Core/include/Acts/Geometry/CuboidVolumeBuilder.hpp +++ b/Core/include/Acts/Geometry/CuboidVolumeBuilder.hpp @@ -74,11 +74,11 @@ class CuboidVolumeBuilder : public ITrackingVolumeBuilder { // Bins in Z direction std::size_t binsZ = 1; // Envelope in X - std::array envelopeX{0, 0}; + std::array envelopeX{0, 0}; // Envelope in Y - std::array envelopeY{0, 0}; + std::array envelopeY{0, 0}; // Envelope in Z - std::array envelopeZ{0, 0}; + std::array envelopeZ{0, 0}; // An optional rotation for this std::optional rotation{std::nullopt}; // Dimension for the binning diff --git a/Core/include/Acts/Geometry/CylinderVolumeBounds.hpp b/Core/include/Acts/Geometry/CylinderVolumeBounds.hpp index 7f368442f40..8a743af2ac5 100644 --- a/Core/include/Acts/Geometry/CylinderVolumeBounds.hpp +++ b/Core/include/Acts/Geometry/CylinderVolumeBounds.hpp @@ -105,27 +105,27 @@ class CylinderVolumeBounds : public VolumeBounds { /// @param avgphi The average phi value /// @param bevelMinZ The bevel angle, in radians, for the negative side /// @param bevelMaxZ The bevel angle, in radians, for the positive side - CylinderVolumeBounds(ActsScalar rmin, ActsScalar rmax, ActsScalar halfz, - ActsScalar halfphi = std::numbers::pi_v, - ActsScalar avgphi = 0., ActsScalar bevelMinZ = 0., - ActsScalar bevelMaxZ = 0.); + CylinderVolumeBounds(double rmin, double rmax, double halfz, + double halfphi = std::numbers::pi_v, + double avgphi = 0., double bevelMinZ = 0., + double bevelMaxZ = 0.); /// Constructor - from a fixed size array /// /// @param values The bound values - CylinderVolumeBounds(const std::array& values); + CylinderVolumeBounds(const std::array& values); /// Constructor - extruded from cylinder bounds and thickness /// /// @param cBounds the cylinder bounds /// @param thickness of the extrusion - CylinderVolumeBounds(const CylinderBounds& cBounds, ActsScalar thickness); + CylinderVolumeBounds(const CylinderBounds& cBounds, double thickness); /// Constructor - extruded from radial bounds and thickness /// /// @param rBounds the Radial bounds /// @param thickness - CylinderVolumeBounds(const RadialBounds& rBounds, ActsScalar thickness); + CylinderVolumeBounds(const RadialBounds& rBounds, double thickness); /// Copy Constructor /// @@ -142,14 +142,14 @@ class CylinderVolumeBounds : public VolumeBounds { /// Return the bound values as dynamically sized vector /// /// @return this returns a copy of the internal values - std::vector values() const final; + std::vector values() const final; /// This method checks if position in the 3D volume /// frame is inside the cylinder /// /// @param pos is a global position to be checked /// @param tol is the tolerance for the check - bool inside(const Vector3& pos, ActsScalar tol = 0.) const override; + bool inside(const Vector3& pos, double tol = 0.) const override; /// Oriented surfaces, i.e. the decomposed boundary surfaces and the /// according navigation direction into the volume given the normal @@ -187,10 +187,10 @@ class CylinderVolumeBounds : public VolumeBounds { /// @param bValue is the type used for the binning Vector3 binningOffset(BinningValue bValue) const override; - /// Binning borders in ActsScalar + /// Binning borders in double /// /// @param bValue is the type used for the binning - ActsScalar binningBorder(BinningValue bValue) const override; + double binningBorder(BinningValue bValue) const override; /// Output Method for std::ostream /// @param os is the output stream @@ -198,20 +198,20 @@ class CylinderVolumeBounds : public VolumeBounds { /// Access to the bound values /// @param bValue the class nested enum for the array access - ActsScalar get(BoundValues bValue) const { return m_values[bValue]; } + double get(BoundValues bValue) const { return m_values[bValue]; } /// Set a bound value /// @param bValue the bound value identifier /// @param value the value to be set - void set(BoundValues bValue, ActsScalar value); + void set(BoundValues bValue, double value); /// Set a range of bound values /// @param keyValues the initializer list of key value pairs - void set(std::initializer_list> keyValues); + void set(std::initializer_list> keyValues); private: - /// The internal version of the bounds can be float/ActsScalar - std::array m_values{}; + /// The internal version of the bounds can be float/double + std::array m_values{}; /// Bounds of the inner CylinderBounds std::shared_ptr m_innerCylinderBounds{nullptr}; diff --git a/Core/include/Acts/Geometry/CylinderVolumeStack.hpp b/Core/include/Acts/Geometry/CylinderVolumeStack.hpp index 3fcb8f1039b..06e1e75dd58 100644 --- a/Core/include/Acts/Geometry/CylinderVolumeStack.hpp +++ b/Core/include/Acts/Geometry/CylinderVolumeStack.hpp @@ -149,7 +149,7 @@ class CylinderVolumeStack : public Volume { /// @param volumes is the vector of volumes /// @param logger is the logger /// @return tuple of the minimum and maximum radii - std::pair synchronizeRBounds( + std::pair synchronizeRBounds( std::vector& volumes, const Logger& logger); /// Helper function that checks overlaps and attaches in r direction @@ -165,7 +165,7 @@ class CylinderVolumeStack : public Volume { /// @param volumes is the vector of volumes /// @param logger is the logger /// @return tuple of the minimum and maximum z extent - std::pair synchronizeZBounds( + std::pair synchronizeZBounds( std::vector& volumes, const Logger& logger); /// Helper functions that checks if the cylinder volume bounds diff --git a/Core/include/Acts/Geometry/Extent.hpp b/Core/include/Acts/Geometry/Extent.hpp index 8728728996b..ca4d439e9ba 100644 --- a/Core/include/Acts/Geometry/Extent.hpp +++ b/Core/include/Acts/Geometry/Extent.hpp @@ -24,7 +24,7 @@ namespace Acts { -using Envelope = std::array; +using Envelope = std::array; constexpr Envelope zeroEnvelope = {0, 0}; @@ -182,19 +182,19 @@ class Extent { /// @param bValue the binning identification /// @param min the minimum parameter /// @param max the maximum parameter - void set(BinningValue bValue, ActsScalar min, ActsScalar max); + void set(BinningValue bValue, double min, double max); /// Set a min value for a dedicated binning value /// /// @param bValue the binning identification /// @param min the minimum parameter - void setMin(BinningValue bValue, ActsScalar min); + void setMin(BinningValue bValue, double min); /// Set a max value for a dedicated binning value /// /// @param bValue the binning identification /// @param max the maximum parameter - void setMax(BinningValue bValue, ActsScalar max); + void setMax(BinningValue bValue, double max); /// (re-)Set the envelope /// @@ -213,10 +213,10 @@ class Extent { /// @param bValue is the binning value to be returned /// /// @return a one dimensional arrange - Range1D range(BinningValue bValue) const; + Range1D range(BinningValue bValue) const; /// Return the N-dimension range - const RangeXD& range() const; + const RangeXD& range() const; /// Return an D-dimensional sub range according to the /// the given binvalues @@ -224,9 +224,9 @@ class Extent { /// @param binValues the binning values /// @return the sub range template - RangeXD range( + RangeXD range( const std::array& binValues) const { - RangeXD rRange; + RangeXD rRange; for (auto [i, v] : enumerate(binValues)) { rRange[i] = range(v); } @@ -242,27 +242,27 @@ class Extent { /// Return the histogram store /// /// The histogram store can be used for automated binning detection - const std::array, numBinningValues()>& - valueHistograms() const; + const std::array, numBinningValues()>& valueHistograms() + const; /// Access the minimum parameter /// /// @param bValue the binning identification - ActsScalar min(BinningValue bValue) const { + double min(BinningValue bValue) const { return m_range[toUnderlying(bValue)].min(); } /// Access the maximum parameter /// /// @param bValue the binning identification - ActsScalar max(BinningValue bValue) const { + double max(BinningValue bValue) const { return m_range[toUnderlying(bValue)].max(); } /// Access the midpoint /// /// @param bValue the binning identification - ActsScalar medium(BinningValue bValue) const { + double medium(BinningValue bValue) const { return 0.5 * (m_range[toUnderlying(bValue)].min() + m_range[toUnderlying(bValue)].max()); } @@ -270,7 +270,7 @@ class Extent { /// Access the parameter interval (i.e. the range span) /// /// @param bValue the binning identification - ActsScalar interval(BinningValue bValue) const { + double interval(BinningValue bValue) const { return m_range[toUnderlying(bValue)].size(); } @@ -318,18 +318,18 @@ class Extent { /// A bitset that remembers the constraint values std::bitset m_constrains{0}; /// The actual range store - RangeXD m_range; + RangeXD m_range; /// A potential envelope ExtentEnvelope m_envelope = ExtentEnvelope::Zero(); /// (Optional) Value histograms for bin detection - std::array, numBinningValues()> m_valueHistograms; + std::array, numBinningValues()> m_valueHistograms; }; -inline Range1D Acts::Extent::range(BinningValue bValue) const { +inline Range1D Acts::Extent::range(BinningValue bValue) const { return m_range[toUnderlying(bValue)]; } -inline const RangeXD& Extent::range() const { +inline const RangeXD& Extent::range() const { return m_range; } @@ -341,7 +341,7 @@ inline const ExtentEnvelope& Extent::envelope() const { return m_envelope; } -inline const std::array, numBinningValues()>& +inline const std::array, numBinningValues()>& Extent::valueHistograms() const { return m_valueHistograms; } diff --git a/Core/include/Acts/Geometry/KDTreeTrackingGeometryBuilder.hpp b/Core/include/Acts/Geometry/KDTreeTrackingGeometryBuilder.hpp index 25fc8ebf30b..4a7a01e214d 100644 --- a/Core/include/Acts/Geometry/KDTreeTrackingGeometryBuilder.hpp +++ b/Core/include/Acts/Geometry/KDTreeTrackingGeometryBuilder.hpp @@ -58,7 +58,7 @@ class KDTreeTrackingGeometryBuilder : public ITrackingGeometryBuilder { }; using SurfaceKDT = - KDTree<2u, std::shared_ptr, ActsScalar, std::array, 100>; + KDTree<2u, std::shared_ptr, double, std::array, 100>; /// Constructor /// diff --git a/Core/include/Acts/Geometry/TrapezoidVolumeBounds.hpp b/Core/include/Acts/Geometry/TrapezoidVolumeBounds.hpp index c34234287c8..9ce660e5856 100644 --- a/Core/include/Acts/Geometry/TrapezoidVolumeBounds.hpp +++ b/Core/include/Acts/Geometry/TrapezoidVolumeBounds.hpp @@ -68,8 +68,8 @@ class TrapezoidVolumeBounds : public VolumeBounds { /// @param maxhalex is the half length in x at maximal y /// @param haley is the half length in y /// @param halez is the half length in z - TrapezoidVolumeBounds(ActsScalar minhalex, ActsScalar maxhalex, - ActsScalar haley, ActsScalar halez) noexcept(false); + TrapezoidVolumeBounds(double minhalex, double maxhalex, double haley, + double halez) noexcept(false); /// Constructor - the trapezoid boundaries (arbitrary trapezoid) /// @@ -78,14 +78,13 @@ class TrapezoidVolumeBounds : public VolumeBounds { /// @param halez is the half length in z /// @param alpha is the opening angle at -x,-y /// @param beta is the opening angle at +x,-y - TrapezoidVolumeBounds(ActsScalar minhalex, ActsScalar haley, ActsScalar halez, - ActsScalar alpha, ActsScalar beta) noexcept(false); + TrapezoidVolumeBounds(double minhalex, double haley, double halez, + double alpha, double beta) noexcept(false); /// Constructor - from a fixed size array /// /// @param values The bound values - TrapezoidVolumeBounds(const std::array& values) noexcept( - false) + TrapezoidVolumeBounds(const std::array& values) noexcept(false) : m_values(values) { checkConsistency(); buildSurfaceBounds(); @@ -103,7 +102,7 @@ class TrapezoidVolumeBounds : public VolumeBounds { /// Return the bound values as dynamically sized vector /// /// @return this returns a copy of the internal values - std::vector values() const final; + std::vector values() const final; /// This method checks if position in the 3D volume frame /// is inside the cylinder @@ -112,7 +111,7 @@ class TrapezoidVolumeBounds : public VolumeBounds { /// @param tol is the tolerance applied /// /// @return boolean indicator if position is inside - bool inside(const Vector3& pos, ActsScalar tol = 0.) const override; + bool inside(const Vector3& pos, double tol = 0.) const override; /// Oriented surfaces, i.e. the decomposed boundary surfaces and the /// according navigation direction into the volume given the normal @@ -142,11 +141,11 @@ class TrapezoidVolumeBounds : public VolumeBounds { /// Access to the bound values /// @param bValue the class nested enum for the array access - ActsScalar get(BoundValues bValue) const { return m_values[bValue]; } + double get(BoundValues bValue) const { return m_values[bValue]; } private: - /// The internal version of the bounds can be float/ActsScalar - std::array m_values{}; + /// The internal version of the bounds can be float/double + std::array m_values{}; /// The face PlaneSurface parallel to local xy plane std::shared_ptr m_faceXYTrapezoidBounds{nullptr}; /// Thhe face PlaneSurface attached to alpha (negative local x) diff --git a/Core/include/Acts/Geometry/Volume.hpp b/Core/include/Acts/Geometry/Volume.hpp index da8932b1eab..92085819676 100644 --- a/Core/include/Acts/Geometry/Volume.hpp +++ b/Core/include/Acts/Geometry/Volume.hpp @@ -32,7 +32,7 @@ class VolumeBounds; /// information. class Volume : public GeometryObject { public: - using BoundingBox = AxisAlignedBoundingBox; + using BoundingBox = AxisAlignedBoundingBox; /// Explicit constructor with shared arguments /// @@ -106,7 +106,7 @@ class Volume : public GeometryObject { /// @param tol is the tolerance parameter /// /// @return boolean indicator if the position is inside - bool inside(const Vector3& gpos, ActsScalar tol = 0.) const; + bool inside(const Vector3& gpos, double tol = 0.) const; /// The binning position method /// - as default the center is given, but may be overloaded diff --git a/Core/include/Acts/Material/GridSurfaceMaterial.hpp b/Core/include/Acts/Material/GridSurfaceMaterial.hpp index 6c2d6045ca2..550907afde7 100644 --- a/Core/include/Acts/Material/GridSurfaceMaterial.hpp +++ b/Core/include/Acts/Material/GridSurfaceMaterial.hpp @@ -44,7 +44,7 @@ struct GridMaterialAccessor { /// /// @note this is not particularly fast template - void scale(grid_type& grid, ActsScalar scale) { + void scale(grid_type& grid, double scale) { // Loop through the grid bins, get the indices and scale the material for (std::size_t ib = 0; ib < grid.size(); ++ib) { grid.at(ib).scaleThickness(scale); @@ -74,7 +74,7 @@ struct IndexedMaterialAccessor { /// /// @param scale the amount of the scaling template - void scale(grid_type& /*grid*/, ActsScalar scale) { + void scale(grid_type& /*grid*/, double scale) { for (auto& m : material) { m.scaleThickness(scale); } @@ -118,7 +118,7 @@ struct GloballyIndexedMaterialAccessor { /// outcome is unpredictable. /// template - void scale(grid_type& grid, ActsScalar scale) { + void scale(grid_type& grid, double scale) { if (sharedEntries) { throw std::invalid_argument( "GloballyIndexedMaterialAccessor: shared entry scaling is not " @@ -198,7 +198,7 @@ class GridSurfaceMaterialT : public ISurfaceMaterial { /// Scale operator /// /// @param scale is the scale factor applied - ISurfaceMaterial& operator*=(ActsScalar scale) final { + ISurfaceMaterial& operator*=(double scale) final { m_materialAccessor.scale(m_grid, scale); return (*this); } diff --git a/Core/include/Acts/Navigation/MultiLayerNavigation.hpp b/Core/include/Acts/Navigation/MultiLayerNavigation.hpp index 4434f24e7d4..7a56086971a 100644 --- a/Core/include/Acts/Navigation/MultiLayerNavigation.hpp +++ b/Core/include/Acts/Navigation/MultiLayerNavigation.hpp @@ -92,9 +92,9 @@ class MultiLayerNavigation : public IInternalNavigation { /// Cast into a lookup position /// /// @param position is the position of the update call - std::array castPosition( + std::array castPosition( const Vector3& position) const { - std::array casted{}; + std::array casted{}; fillCasts(position, casted, std::make_integer_sequence{}); return casted; @@ -133,7 +133,7 @@ class MultiLayerNavigation : public IInternalNavigation { /// in the grid struct PathGridSurfacesGenerator { std::vector operator()(Vector3 startPosition, - const Vector3& direction, ActsScalar stepSize, + const Vector3& direction, double stepSize, std::size_t numberOfSteps) const { std::vector pathCoordinates = {}; pathCoordinates.reserve(numberOfSteps); diff --git a/Core/include/Acts/Navigation/NavigationState.hpp b/Core/include/Acts/Navigation/NavigationState.hpp index 6cfc8a17e46..0e0d8e5af9c 100644 --- a/Core/include/Acts/Navigation/NavigationState.hpp +++ b/Core/include/Acts/Navigation/NavigationState.hpp @@ -60,10 +60,10 @@ struct NavigationState { Vector3 direction = Vector3(0., 0., 0.); /// The current absolute momentum - ActsScalar absMomentum = 0.; + double absMomentum = 0.; /// The current absolute charge - ActsScalar absCharge = 0.; + double absCharge = 0.; /// The current magnetic field Vector3 magneticField = Vector3(0., 0., 0.); @@ -88,7 +88,7 @@ struct NavigationState { BoundaryTolerance surfaceBoundaryTolerance = BoundaryTolerance::None(); /// An overstep tolerance - ActsScalar overstepTolerance = -100 * UnitConstants::um; + double overstepTolerance = -100 * UnitConstants::um; /// Auxiliary attached information std::any auxiliary; diff --git a/Core/include/Acts/Navigation/NavigationStateUpdaters.hpp b/Core/include/Acts/Navigation/NavigationStateUpdaters.hpp index df5e750db54..83b7bfd5016 100644 --- a/Core/include/Acts/Navigation/NavigationStateUpdaters.hpp +++ b/Core/include/Acts/Navigation/NavigationStateUpdaters.hpp @@ -50,7 +50,7 @@ inline void intitializeCandidates(const GeometryContext& gctx, const Surface& surface = sc.surface != nullptr ? *sc.surface : sc.portal->surface(); // Only allow overstepping if it's not a portal - ActsScalar overstepTolerance = + double overstepTolerance = sc.portal != nullptr ? s_onSurfaceTolerance : nState.overstepTolerance; // Boundary tolerance is forced to 0 for portals BoundaryTolerance boundaryTolerance = diff --git a/Core/include/Acts/Navigation/NavigationStream.hpp b/Core/include/Acts/Navigation/NavigationStream.hpp index 97e154214d7..e41761fed0b 100644 --- a/Core/include/Acts/Navigation/NavigationStream.hpp +++ b/Core/include/Acts/Navigation/NavigationStream.hpp @@ -63,7 +63,7 @@ class NavigationStream { /// Convenience access to surface const Surface& surface() const { return *intersection.object(); } /// Cinvencience access to the path length - ActsScalar pathLength() const { return intersection.pathLength(); } + double pathLength() const { return intersection.pathLength(); } /// Order along the path length /// @@ -156,7 +156,7 @@ class NavigationStream { bool initialize(const GeometryContext& gctx, const NavigationStream::QueryPoint& queryPoint, const BoundaryTolerance& cTolerance, - ActsScalar onSurfaceTolerance = s_onSurfaceTolerance); + double onSurfaceTolerance = s_onSurfaceTolerance); /// Convenience method to update a stream from a new query point, /// this could be called from navigation delegates that do not require @@ -169,7 +169,7 @@ class NavigationStream { /// @return true if the stream is active, false indicate no valid candidates left bool update(const GeometryContext& gctx, const NavigationStream::QueryPoint& queryPoint, - ActsScalar onSurfaceTolerance = s_onSurfaceTolerance); + double onSurfaceTolerance = s_onSurfaceTolerance); private: /// The candidates of this navigation stream diff --git a/Core/include/Acts/Navigation/PortalNavigation.hpp b/Core/include/Acts/Navigation/PortalNavigation.hpp index 638f2397760..b810e179c69 100644 --- a/Core/include/Acts/Navigation/PortalNavigation.hpp +++ b/Core/include/Acts/Navigation/PortalNavigation.hpp @@ -86,7 +86,7 @@ struct BoundVolumesGrid1Navigation : public IExternalNavigation { /// @param cVolumes the contained volumes /// @param bTransform is the optional transform BoundVolumesGrid1Navigation( - const std::vector& gBoundaries, BinningValue bValue, + const std::vector& gBoundaries, BinningValue bValue, const std::vector& cVolumes, const Transform3& bTransform = Transform3::Identity()) noexcept(false) : indexedUpdater(IndexedUpdater(VariableBoundIndexGrid1(std::make_tuple( diff --git a/Core/include/Acts/Propagator/AtlasStepper.hpp b/Core/include/Acts/Propagator/AtlasStepper.hpp index f31aadbffab..55c07d5b1c7 100644 --- a/Core/include/Acts/Propagator/AtlasStepper.hpp +++ b/Core/include/Acts/Propagator/AtlasStepper.hpp @@ -418,7 +418,7 @@ class AtlasStepper { Intersection3D::Status updateSurfaceStatus( State& state, const Surface& surface, std::uint8_t index, Direction navDir, const BoundaryTolerance& boundaryTolerance, - ActsScalar surfaceTolerance = s_onSurfaceTolerance, + double surfaceTolerance = s_onSurfaceTolerance, const Logger& logger = getDummyLogger()) const { return detail::updateSingleSurfaceStatus( *this, state, surface, index, navDir, boundaryTolerance, diff --git a/Core/include/Acts/Propagator/ConstrainedStep.hpp b/Core/include/Acts/Propagator/ConstrainedStep.hpp index e957b001281..1d4e5009a09 100644 --- a/Core/include/Acts/Propagator/ConstrainedStep.hpp +++ b/Core/include/Acts/Propagator/ConstrainedStep.hpp @@ -43,7 +43,7 @@ namespace Acts { /// - Step into the void with `std::numeric_limits::max()` class ConstrainedStep { public: - using Scalar = ActsScalar; + using Scalar = double; /// the types of constraints /// from actor - this would be a typical navigation step diff --git a/Core/include/Acts/Propagator/EigenStepper.hpp b/Core/include/Acts/Propagator/EigenStepper.hpp index fb1062b0c9b..603725f7096 100644 --- a/Core/include/Acts/Propagator/EigenStepper.hpp +++ b/Core/include/Acts/Propagator/EigenStepper.hpp @@ -270,7 +270,7 @@ class EigenStepper { Intersection3D::Status updateSurfaceStatus( State& state, const Surface& surface, std::uint8_t index, Direction navDir, const BoundaryTolerance& boundaryTolerance, - ActsScalar surfaceTolerance = s_onSurfaceTolerance, + double surfaceTolerance = s_onSurfaceTolerance, const Logger& logger = getDummyLogger()) const { return detail::updateSingleSurfaceStatus( *this, state, surface, index, navDir, boundaryTolerance, diff --git a/Core/include/Acts/Propagator/EigenStepperDefaultExtension.hpp b/Core/include/Acts/Propagator/EigenStepperDefaultExtension.hpp index 2810b11a2a2..b0fa9b0d6dd 100644 --- a/Core/include/Acts/Propagator/EigenStepperDefaultExtension.hpp +++ b/Core/include/Acts/Propagator/EigenStepperDefaultExtension.hpp @@ -19,7 +19,7 @@ namespace Acts { /// @brief Default evaluater of the k_i's and elements of the transport matrix /// D of the RKN4 stepping. This is a pure implementation by textbook. struct EigenStepperDefaultExtension { - using Scalar = ActsScalar; + using Scalar = double; /// @brief Vector3 replacement for the custom scalar type using ThisVector3 = Eigen::Matrix; diff --git a/Core/include/Acts/Propagator/EigenStepperDenseExtension.hpp b/Core/include/Acts/Propagator/EigenStepperDenseExtension.hpp index 70dbb1cb820..336645694af 100644 --- a/Core/include/Acts/Propagator/EigenStepperDenseExtension.hpp +++ b/Core/include/Acts/Propagator/EigenStepperDenseExtension.hpp @@ -27,7 +27,7 @@ namespace Acts { /// in the propagation and the jacobian. These effects will only occur if the /// propagation is in a TrackingVolume with attached material. struct EigenStepperDenseExtension { - using Scalar = ActsScalar; + using Scalar = double; /// @brief Vector3 replacement for the custom scalar type using ThisVector3 = Eigen::Matrix; diff --git a/Core/include/Acts/Propagator/MultiEigenStepperLoop.hpp b/Core/include/Acts/Propagator/MultiEigenStepperLoop.hpp index 1bb4ab8f55a..6eecab2c5ee 100644 --- a/Core/include/Acts/Propagator/MultiEigenStepperLoop.hpp +++ b/Core/include/Acts/Propagator/MultiEigenStepperLoop.hpp @@ -82,13 +82,13 @@ struct SingleComponentReducer { } template - static ActsScalar qOverP(const stepper_state_t& s) { + static double qOverP(const stepper_state_t& s) { const auto cmp = component_chooser_t{}(s.components); return cmp->state.pars[eFreeQOverP]; } template - static ActsScalar absoluteMomentum(const stepper_state_t& s) { + static double absoluteMomentum(const stepper_state_t& s) { const auto cmp = component_chooser_t{}(s.components); return s.particleHypothesis.extractMomentum(cmp->state.pars[eFreeQOverP]); } @@ -101,13 +101,13 @@ struct SingleComponentReducer { } template - static ActsScalar charge(const stepper_state_t& s) { + static double charge(const stepper_state_t& s) { const auto cmp = component_chooser_t{}(s.components); return s.particleHypothesis.extractCharge(cmp->state.pars[eFreeQOverP]); } template - static ActsScalar time(const stepper_state_t& s) { + static double time(const stepper_state_t& s) { return component_chooser_t{}(s.components)->state.pars[eFreeTime]; } @@ -169,11 +169,11 @@ class MultiEigenStepperLoop : public EigenStepper { /// @brief Define an own bound state using BoundState = - std::tuple; + std::tuple; /// @brief Define an own curvilinear state - using CurvilinearState = std::tuple; + using CurvilinearState = + std::tuple; /// @brief The reducer type using Reducer = component_reducer_t; @@ -195,7 +195,7 @@ class MultiEigenStepperLoop : public EigenStepper { /// The struct that stores the individual components struct Component { SingleState state; - ActsScalar weight; + double weight; Intersection3D::Status status; }; @@ -404,7 +404,7 @@ class MultiEigenStepperLoop : public EigenStepper { /// /// @param [in,out] state The stepping state (thread-local cache) void reweightComponents(State& state) const { - ActsScalar sumOfWeights = 0.0; + double sumOfWeights = 0.0; for (const auto& cmp : state.components) { sumOfWeights += cmp.weight; } @@ -519,7 +519,7 @@ class MultiEigenStepperLoop : public EigenStepper { Intersection3D::Status updateSurfaceStatus( State& state, const Surface& surface, std::uint8_t index, Direction navDir, const BoundaryTolerance& boundaryTolerance, - ActsScalar surfaceTolerance = s_onSurfaceTolerance, + double surfaceTolerance = s_onSurfaceTolerance, const Logger& logger = getDummyLogger()) const { using Status = Intersection3D::Status; diff --git a/Core/include/Acts/Propagator/MultiEigenStepperLoop.ipp b/Core/include/Acts/Propagator/MultiEigenStepperLoop.ipp index fab3e3f0779..64482450a0a 100644 --- a/Core/include/Acts/Propagator/MultiEigenStepperLoop.ipp +++ b/Core/include/Acts/Propagator/MultiEigenStepperLoop.ipp @@ -67,8 +67,7 @@ auto MultiEigenStepperLoop::curvilinearState( State& state, bool transportCov) const -> CurvilinearState { assert(!state.components.empty()); - std::vector< - std::tuple> + std::vector> cmps; cmps.reserve(numberComponents(state)); double accumulatedPathLength = 0.0; diff --git a/Core/include/Acts/Propagator/StepperConcept.hpp b/Core/include/Acts/Propagator/StepperConcept.hpp index d869b90b301..fb4ea187bcd 100644 --- a/Core/include/Acts/Propagator/StepperConcept.hpp +++ b/Core/include/Acts/Propagator/StepperConcept.hpp @@ -54,8 +54,7 @@ concept CommonStepper = requires { }; requires requires(const Surface& sf, std::uint8_t ui, Direction d, - const BoundaryTolerance& bt, ActsScalar sc, - const Logger& l) { + const BoundaryTolerance& bt, double sc, const Logger& l) { { s.updateSurfaceStatus(t, sf, ui, d, bt, sc, l) }; }; diff --git a/Core/include/Acts/Propagator/StraightLineStepper.hpp b/Core/include/Acts/Propagator/StraightLineStepper.hpp index 8ba0d72fe81..3281defa74e 100644 --- a/Core/include/Acts/Propagator/StraightLineStepper.hpp +++ b/Core/include/Acts/Propagator/StraightLineStepper.hpp @@ -241,7 +241,7 @@ class StraightLineStepper { Intersection3D::Status updateSurfaceStatus( State& state, const Surface& surface, std::uint8_t index, Direction navDir, const BoundaryTolerance& boundaryTolerance, - ActsScalar surfaceTolerance = s_onSurfaceTolerance, + double surfaceTolerance = s_onSurfaceTolerance, const Logger& logger = getDummyLogger()) const { return detail::updateSingleSurfaceStatus( *this, state, surface, index, navDir, boundaryTolerance, diff --git a/Core/include/Acts/Propagator/SympyStepper.hpp b/Core/include/Acts/Propagator/SympyStepper.hpp index 1e771a53ba7..d544687ff21 100644 --- a/Core/include/Acts/Propagator/SympyStepper.hpp +++ b/Core/include/Acts/Propagator/SympyStepper.hpp @@ -246,7 +246,7 @@ class SympyStepper { Intersection3D::Status updateSurfaceStatus( State& state, const Surface& surface, std::uint8_t index, Direction navDir, const BoundaryTolerance& boundaryTolerance, - ActsScalar surfaceTolerance = s_onSurfaceTolerance, + double surfaceTolerance = s_onSurfaceTolerance, const Logger& logger = getDummyLogger()) const { return detail::updateSingleSurfaceStatus( *this, state, surface, index, navDir, boundaryTolerance, diff --git a/Core/include/Acts/Propagator/detail/NavigationHelpers.hpp b/Core/include/Acts/Propagator/detail/NavigationHelpers.hpp index 16e8c089e4f..8965dacae45 100644 --- a/Core/include/Acts/Propagator/detail/NavigationHelpers.hpp +++ b/Core/include/Acts/Propagator/detail/NavigationHelpers.hpp @@ -36,7 +36,7 @@ struct NavigationObjectCandidate { std::pair intersect( const GeometryContext& gctx, const Vector3& position, - const Vector3& direction, ActsScalar tolerance) const { + const Vector3& direction, double tolerance) const { if (std::holds_alternative(object)) { const auto& surface = std::get(object); auto intersection = representation->intersect( diff --git a/Core/include/Acts/Propagator/detail/SteppingHelper.hpp b/Core/include/Acts/Propagator/detail/SteppingHelper.hpp index c78f0ea1f51..56ce5f1e2a9 100644 --- a/Core/include/Acts/Propagator/detail/SteppingHelper.hpp +++ b/Core/include/Acts/Propagator/detail/SteppingHelper.hpp @@ -35,7 +35,7 @@ template Acts::Intersection3D::Status updateSingleSurfaceStatus( const stepper_t& stepper, typename stepper_t::State& state, const Surface& surface, std::uint8_t index, Direction navDir, - const BoundaryTolerance& boundaryTolerance, ActsScalar surfaceTolerance, + const BoundaryTolerance& boundaryTolerance, double surfaceTolerance, const Logger& logger) { ACTS_VERBOSE("Update single surface status for surface: " << surface.geometryId() << " index " << static_cast(index)); diff --git a/Core/include/Acts/Seeding/EstimateTrackParamsFromSeed.hpp b/Core/include/Acts/Seeding/EstimateTrackParamsFromSeed.hpp index 5d6b4dbb97c..0c6be849f71 100644 --- a/Core/include/Acts/Seeding/EstimateTrackParamsFromSeed.hpp +++ b/Core/include/Acts/Seeding/EstimateTrackParamsFromSeed.hpp @@ -135,7 +135,7 @@ template std::optional estimateTrackParamsFromSeed( const GeometryContext& gctx, spacepoint_iterator_t spBegin, spacepoint_iterator_t spEnd, const Surface& surface, const Vector3& bField, - ActsScalar bFieldMin, const Acts::Logger& logger = getDummyLogger()) { + double bFieldMin, const Acts::Logger& logger = getDummyLogger()) { // Check the number of provided space points std::size_t numSP = std::distance(spBegin, spEnd); if (numSP != 3) { @@ -144,7 +144,7 @@ std::optional estimateTrackParamsFromSeed( } // Convert bField to Tesla - ActsScalar bFieldStrength = bField.norm(); + double bFieldStrength = bField.norm(); // Check if magnetic field is too small if (bFieldStrength < bFieldMin) { // @todo shall we use straight-line estimation and use default q/pt in such @@ -205,27 +205,27 @@ std::optional estimateTrackParamsFromSeed( Vector2 circleCenter; circleCenter(0) = 0.5 * local1(0); - ActsScalar deltaX21 = local2(0) - local1(0); - ActsScalar sumX21 = local2(0) + local1(0); + double deltaX21 = local2(0) - local1(0); + double sumX21 = local2(0) + local1(0); // straight line connecting the two points // y = a * x + c (we don't care about c right now) // we simply need the slope // we compute 1./a since this is what we need for the following computation - ActsScalar ia = deltaX21 / local2(1); + double ia = deltaX21 / local2(1); // Perpendicular line is then y = -1/a *x + b // we can evaluate b given we know a already by imposing // the line passes through P = (0.5 * (x2 + x1), 0.5 * y2) - ActsScalar b = 0.5 * (local2(1) + ia * sumX21); + double b = 0.5 * (local2(1) + ia * sumX21); circleCenter(1) = -ia * circleCenter(0) + b; // Radius is a signed distance between circleCenter and first sp, which is at // (0, 0) in the new frame. Sign depends on the slope a (positive vs negative) int sign = ia > 0 ? -1 : 1; - const ActsScalar R = circleCenter.norm(); - ActsScalar invTanTheta = + const double R = circleCenter.norm(); + double invTanTheta = local2.z() / (2 * R * std::asin(local2.head<2>().norm() / (2 * R))); // The momentum direction in the new frame (the center of the circle has the // coordinate (-1.*A/(2*B), 1./(2*B))) - ActsScalar A = -circleCenter(0) / circleCenter(1); + double A = -circleCenter(0) / circleCenter(1); Vector3 transDirection(1., A, fastHypot(1, A) * invTanTheta); // Transform it back to the original frame Vector3 direction = rotation * transDirection.normalized(); @@ -254,7 +254,7 @@ std::optional estimateTrackParamsFromSeed( // The estimated q/pt in [GeV/c]^-1 (note that the pt is the projection of // momentum on the transverse plane of the new frame) - ActsScalar qOverPt = sign / (bFieldStrength * R); + double qOverPt = sign / (bFieldStrength * R); // The estimated q/p in [GeV/c]^-1 params[eBoundQOverP] = qOverPt / fastHypot(1., invTanTheta); diff --git a/Core/include/Acts/Seeding/PathSeeder.hpp b/Core/include/Acts/Seeding/PathSeeder.hpp index d4475c022df..87ceda365c8 100644 --- a/Core/include/Acts/Seeding/PathSeeder.hpp +++ b/Core/include/Acts/Seeding/PathSeeder.hpp @@ -81,7 +81,7 @@ class PathSeeder { /// /// @return The path width in the bin0 and bin1 direction /// defined with respect to the surface normal - using PathWidthLookup = Delegate( + using PathWidthLookup = Delegate( const GeometryContext&, const GeometryIdentifier&)>; /// @brief The nested configuration struct @@ -146,10 +146,10 @@ class PathSeeder { m_cfg.pathWidthProvider(gctx, geoId); // Get the bounds of the path - ActsScalar top0 = refPoint[0] + pathWidth0; - ActsScalar bot0 = refPoint[0] - pathWidth0; - ActsScalar top1 = refPoint[1] + pathWidth1; - ActsScalar bot1 = refPoint[1] - pathWidth1; + double top0 = refPoint[0] + pathWidth0; + double bot0 = refPoint[0] - pathWidth0; + double top1 = refPoint[1] + pathWidth1; + double bot1 = refPoint[1] - pathWidth1; // Get the lookup table for the source links auto grid = sourceLinkGridLookup.at(geoId); diff --git a/Core/include/Acts/Seeding/SeedFinderOrthogonal.hpp b/Core/include/Acts/Seeding/SeedFinderOrthogonal.hpp index a4129fad556..29405f0e222 100644 --- a/Core/include/Acts/Seeding/SeedFinderOrthogonal.hpp +++ b/Core/include/Acts/Seeding/SeedFinderOrthogonal.hpp @@ -48,7 +48,7 @@ class SeedFinderOrthogonal { * has leaf size 4. */ using tree_t = - KDTree; + KDTree; /** * @brief Construct a new orthogonal seed finder. diff --git a/Core/include/Acts/SpacePointFormation/detail/SpacePointBuilder.ipp b/Core/include/Acts/SpacePointFormation/detail/SpacePointBuilder.ipp index 532d2c90ec7..557b005fe6d 100644 --- a/Core/include/Acts/SpacePointFormation/detail/SpacePointBuilder.ipp +++ b/Core/include/Acts/SpacePointFormation/detail/SpacePointBuilder.ipp @@ -27,9 +27,9 @@ void SpacePointBuilder::buildSpacePoint( const unsigned int num_slinks = sourceLinks.size(); Acts::Vector3 gPos = Acts::Vector3::Zero(); - std::optional gTime = std::nullopt; + std::optional gTime = std::nullopt; Acts::Vector2 gCov = Acts::Vector2::Zero(); - std::optional gCovT = std::nullopt; + std::optional gCovT = std::nullopt; if (num_slinks == 1) { // pixel SP formation auto slink = sourceLinks.at(0); diff --git a/Core/include/Acts/Surfaces/CylinderSurface.hpp b/Core/include/Acts/Surfaces/CylinderSurface.hpp index 53c52f13f50..971ff7039f7 100644 --- a/Core/include/Acts/Surfaces/CylinderSurface.hpp +++ b/Core/include/Acts/Surfaces/CylinderSurface.hpp @@ -198,7 +198,7 @@ class CylinderSurface : public RegularSurface { const Vector3& direction, const BoundaryTolerance& boundaryTolerance = BoundaryTolerance::Infinite(), - ActsScalar tolerance = s_onSurfaceTolerance) const final; + double tolerance = s_onSurfaceTolerance) const final; /// Path correction due to incident of the track /// diff --git a/Core/include/Acts/Surfaces/DiscSurface.hpp b/Core/include/Acts/Surfaces/DiscSurface.hpp index d2db14fc566..6a3144a00aa 100644 --- a/Core/include/Acts/Surfaces/DiscSurface.hpp +++ b/Core/include/Acts/Surfaces/DiscSurface.hpp @@ -294,7 +294,7 @@ class DiscSurface : public RegularSurface { const Vector3& direction, const BoundaryTolerance& boundaryTolerance = BoundaryTolerance::Infinite(), - ActsScalar tolerance = s_onSurfaceTolerance) const final; + double tolerance = s_onSurfaceTolerance) const final; /// Implement the binningValue /// diff --git a/Core/include/Acts/Surfaces/LineSurface.hpp b/Core/include/Acts/Surfaces/LineSurface.hpp index d07e9f6dc37..15af6aa6be8 100644 --- a/Core/include/Acts/Surfaces/LineSurface.hpp +++ b/Core/include/Acts/Surfaces/LineSurface.hpp @@ -248,7 +248,7 @@ class LineSurface : public Surface { const Vector3& direction, const BoundaryTolerance& boundaryTolerance = BoundaryTolerance::Infinite(), - ActsScalar tolerance = s_onSurfaceTolerance) const final; + double tolerance = s_onSurfaceTolerance) const final; /// the pathCorrection for derived classes with thickness /// is by definition 1 for LineSurfaces diff --git a/Core/include/Acts/Surfaces/PlaneSurface.hpp b/Core/include/Acts/Surfaces/PlaneSurface.hpp index 2bc65398f8d..e4fda361828 100644 --- a/Core/include/Acts/Surfaces/PlaneSurface.hpp +++ b/Core/include/Acts/Surfaces/PlaneSurface.hpp @@ -193,7 +193,7 @@ class PlaneSurface : public RegularSurface { const Vector3& direction, const BoundaryTolerance& boundaryTolerance = BoundaryTolerance::Infinite(), - ActsScalar tolerance = s_onSurfaceTolerance) const final; + double tolerance = s_onSurfaceTolerance) const final; /// Return a Polyhedron for the surfaces /// diff --git a/Core/include/Acts/Surfaces/Surface.hpp b/Core/include/Acts/Surfaces/Surface.hpp index 79153e8c98e..43d8161aa8c 100644 --- a/Core/include/Acts/Surfaces/Surface.hpp +++ b/Core/include/Acts/Surfaces/Surface.hpp @@ -399,7 +399,7 @@ class Surface : public virtual GeometryObject, const Vector3& direction, const BoundaryTolerance& boundaryTolerance = BoundaryTolerance::Infinite(), - ActsScalar tolerance = s_onSurfaceTolerance) const = 0; + double tolerance = s_onSurfaceTolerance) const = 0; /// Helper method for printing: the returned object captures the /// surface and the geometry context and will print the surface diff --git a/Core/include/Acts/Surfaces/detail/AnnulusBoundsHelper.hpp b/Core/include/Acts/Surfaces/detail/AnnulusBoundsHelper.hpp index 84f2d4ec61a..7f7db63086e 100644 --- a/Core/include/Acts/Surfaces/detail/AnnulusBoundsHelper.hpp +++ b/Core/include/Acts/Surfaces/detail/AnnulusBoundsHelper.hpp @@ -33,7 +33,7 @@ namespace detail::AnnulusBoundsHelper { /// /// @return AnnulusBounds std::tuple, Transform3> create( - const Transform3& transform, ActsScalar rMin, ActsScalar rMax, + const Transform3& transform, double rMin, double rMax, std::vector vertices); } // namespace detail::AnnulusBoundsHelper diff --git a/Core/include/Acts/Surfaces/detail/IntersectionHelper2D.hpp b/Core/include/Acts/Surfaces/detail/IntersectionHelper2D.hpp index db6860006a3..cafa4349740 100644 --- a/Core/include/Acts/Surfaces/detail/IntersectionHelper2D.hpp +++ b/Core/include/Acts/Surfaces/detail/IntersectionHelper2D.hpp @@ -37,8 +37,7 @@ struct IntersectionHelper2D { /// @param dir The Direction of intersection line /// /// @return the intersection points - static std::array intersectEllipse(ActsScalar Rx, - ActsScalar Ry, + static std::array intersectEllipse(double Rx, double Ry, const Vector2& origin, const Vector2& dir); @@ -50,7 +49,7 @@ struct IntersectionHelper2D { /// /// @return the intersection points static inline std::array intersectCircle( - ActsScalar R, const Vector2& origin, const Vector2& dir) { + double R, const Vector2& origin, const Vector2& dir) { return intersectEllipse(R, R, origin, dir); } @@ -65,8 +64,8 @@ struct IntersectionHelper2D { /// @param dir The Direction of intersection line /// /// @return the intersection points - static Intersection2D intersectCircleSegment(ActsScalar R, ActsScalar phiMin, - ActsScalar phiMax, + static Intersection2D intersectCircleSegment(double R, double phiMin, + double phiMax, const Vector2& origin, const Vector2& dir); diff --git a/Core/include/Acts/Surfaces/detail/MergeHelper.hpp b/Core/include/Acts/Surfaces/detail/MergeHelper.hpp index a0121173591..ed396c9e6ad 100644 --- a/Core/include/Acts/Surfaces/detail/MergeHelper.hpp +++ b/Core/include/Acts/Surfaces/detail/MergeHelper.hpp @@ -23,9 +23,9 @@ namespace Acts::detail { /// a half phi sector in the range [0,pi). The two /// ranges need to line up, i.e. that one of the sector /// ends exactly where the other one starts. -std::tuple mergedPhiSector( - ActsScalar hlPhi1, ActsScalar avgPhi1, ActsScalar hlPhi2, - ActsScalar avgPhi2, const Logger& logger = getDummyLogger(), - ActsScalar tolerance = s_onSurfaceTolerance); +std::tuple mergedPhiSector( + double hlPhi1, double avgPhi1, double hlPhi2, double avgPhi2, + const Logger& logger = getDummyLogger(), + double tolerance = s_onSurfaceTolerance); } // namespace Acts::detail diff --git a/Core/include/Acts/Surfaces/detail/PlanarHelper.hpp b/Core/include/Acts/Surfaces/detail/PlanarHelper.hpp index f7b21a960aa..0bdb59ec243 100644 --- a/Core/include/Acts/Surfaces/detail/PlanarHelper.hpp +++ b/Core/include/Acts/Surfaces/detail/PlanarHelper.hpp @@ -23,17 +23,16 @@ namespace Acts::PlanarHelper { /// @return The intersection inline Intersection3D intersect(const Transform3& transform, const Vector3& position, - const Vector3& direction, - ActsScalar tolerance) { + const Vector3& direction, double tolerance) { // Get the matrix from the transform (faster access) const auto& tMatrix = transform.matrix(); const Vector3 pnormal = tMatrix.block<3, 1>(0, 2).transpose(); const Vector3 pcenter = tMatrix.block<3, 1>(0, 3).transpose(); // It is solvable, so go on - ActsScalar denom = direction.dot(pnormal); + double denom = direction.dot(pnormal); if (denom != 0.0) { // Translate that into a path - ActsScalar path = (pnormal.dot((pcenter - position))) / (denom); + double path = (pnormal.dot((pcenter - position))) / (denom); // Is valid hence either on surface or reachable Intersection3D::Status status = std::abs(path) < std::abs(tolerance) ? Intersection3D::Status::onSurface diff --git a/Core/include/Acts/Surfaces/detail/VerticesHelper.hpp b/Core/include/Acts/Surfaces/detail/VerticesHelper.hpp index 4384c17139c..8fd568c3c36 100644 --- a/Core/include/Acts/Surfaces/detail/VerticesHelper.hpp +++ b/Core/include/Acts/Surfaces/detail/VerticesHelper.hpp @@ -30,11 +30,10 @@ namespace Acts::detail::VerticesHelper { /// @param quarterSegments number of segments used to approximate a segment quarter /// /// @return a vector of generated phi values -std::vector phiSegments( - ActsScalar phiMin = -std::numbers::pi_v, - ActsScalar phiMax = std::numbers::pi_v, - const std::vector& phiRefs = {}, - unsigned int quarterSegments = 2u); +std::vector phiSegments(double phiMin = -std::numbers::pi_v, + double phiMax = std::numbers::pi_v, + const std::vector& phiRefs = {}, + unsigned int quarterSegments = 2u); /// Helper method to create a regular 2 or 3 D segment /// between two phi values with a given number of segments @@ -56,15 +55,14 @@ std::vector phiSegments( /// @return a vector of vertices template std::vector segmentVertices( - std::pair rXY, ActsScalar phiMin, ActsScalar phiMax, - const std::vector& phiRefs = {}, - unsigned int quarterSegments = 2u, + std::pair rXY, double phiMin, double phiMax, + const std::vector& phiRefs = {}, unsigned int quarterSegments = 2u, const vertex_t& offset = vertex_t::Zero(), const transform_t& transform = transform_t::Identity()) { std::vector vertices; - std::vector phis = + std::vector phis = phiSegments(phiMin, phiMax, phiRefs, quarterSegments); - for (ActsScalar phi : phis) { + for (double phi : phis) { vertex_t vertex = vertex_t::Zero(); vertex(0) = rXY.first * std::cos(phi); vertex(1) = rXY.second * std::sin(phi); @@ -86,9 +84,8 @@ std::vector segmentVertices( /// /// @return a vector of 2d-vectors std::vector ellipsoidVertices( - ActsScalar innerRx, ActsScalar innerRy, ActsScalar outerRx, - ActsScalar outerRy, ActsScalar avgPhi = 0., - ActsScalar halfPhi = std::numbers::pi_v, + double innerRx, double innerRy, double outerRx, double outerRy, + double avgPhi = 0., double halfPhi = std::numbers::pi_v, unsigned int quarterSegments = 2u); /// Construct vertices on an disc/wheel-like bound object. @@ -101,8 +98,8 @@ std::vector ellipsoidVertices( /// /// @return a vector of 2d-vectors std::vector circularVertices( - ActsScalar innerR, ActsScalar outerR, ActsScalar avgPhi = 0., - ActsScalar halfPhi = std::numbers::pi_v, + double innerR, double outerR, double avgPhi = 0., + double halfPhi = std::numbers::pi_v, unsigned int quarterSegments = 2u); /// Check if the point is inside the polygon w/o any tolerances. @@ -174,7 +171,7 @@ bool isInsideRectangle(const vertex_t& point, const vertex_t& lowerLeft, /// @param tolerance The allowed out of plane tolerance /// @return boolean to indicate if all points are inside/outside bool onHyperPlane(const std::vector& vertices, - ActsScalar tolerance = s_onSurfaceTolerance); + double tolerance = s_onSurfaceTolerance); /// Calculate the closest point on the polygon. inline Vector2 computeClosestPointOnPolygon(const Vector2& point, diff --git a/Core/include/Acts/TrackFitting/BetheHeitlerApprox.hpp b/Core/include/Acts/TrackFitting/BetheHeitlerApprox.hpp index 5d0c5601bea..543ac3e4376 100644 --- a/Core/include/Acts/TrackFitting/BetheHeitlerApprox.hpp +++ b/Core/include/Acts/TrackFitting/BetheHeitlerApprox.hpp @@ -31,9 +31,9 @@ namespace Acts { namespace detail { struct GaussianComponent { - ActsScalar weight = 0.0; - ActsScalar mean = 0.0; - ActsScalar var = 0.0; + double weight = 0.0; + double mean = 0.0; + double var = 0.0; }; /// Transform a gaussian component to a space where all values are defined from @@ -73,7 +73,7 @@ struct BetheHeitlerApproxSingleCmp { /// Checks if an input is valid for the parameterization. The threshold for /// x/x0 is 0.002 and orientates on the values used in ATLAS - constexpr bool validXOverX0(ActsScalar x) const { + constexpr bool validXOverX0(double x) const { return x < 0.002; ; } @@ -82,7 +82,7 @@ struct BetheHeitlerApproxSingleCmp { /// Bethe-Heitler-Distribution /// /// @param x pathlength in terms of the radiation length - static auto mixture(const ActsScalar x) { + static auto mixture(const double x) { std::array ret{}; ret[0].weight = 1.0; @@ -109,9 +109,9 @@ class AtlasBetheHeitlerApprox { public: struct PolyData { - std::array weightCoeffs; - std::array meanCoeffs; - std::array varCoeffs; + std::array weightCoeffs; + std::array meanCoeffs; + std::array varCoeffs; }; using Data = std::array; @@ -160,7 +160,7 @@ class AtlasBetheHeitlerApprox { /// Checks if an input is valid for the parameterization /// /// @param x pathlength in terms of the radiation length - constexpr bool validXOverX0(ActsScalar x) const { + constexpr bool validXOverX0(double x) const { if (m_clampToRange) { return true; } else { @@ -172,7 +172,7 @@ class AtlasBetheHeitlerApprox { /// that the sum of all weights is 1 /// /// @param x pathlength in terms of the radiation length - auto mixture(ActsScalar x) const { + auto mixture(double x) const { using Array = boost::container::static_vector; @@ -181,9 +181,9 @@ class AtlasBetheHeitlerApprox { } // Build a polynom - auto poly = [](ActsScalar xx, - const std::array &coeffs) { - ActsScalar sum{0.}; + auto poly = [](double xx, + const std::array &coeffs) { + double sum{0.}; for (const auto c : coeffs) { sum = xx * sum + c; } @@ -195,7 +195,7 @@ class AtlasBetheHeitlerApprox { auto make_mixture = [&](const Data &data, double xx, bool transform) { // Value initialization should garanuee that all is initialized to zero Array ret(NComponents); - ActsScalar weight_sum = 0; + double weight_sum = 0; for (int i = 0; i < NComponents; ++i) { // These transformations must be applied to the data according to ATHENA // (TrkGaussianSumFilter/src/GsfCombinedMaterialEffects.cxx:79) diff --git a/Core/include/Acts/TrackFitting/GlobalChiSquareFitter.hpp b/Core/include/Acts/TrackFitting/GlobalChiSquareFitter.hpp index 8442071a23f..85a041f2d92 100644 --- a/Core/include/Acts/TrackFitting/GlobalChiSquareFitter.hpp +++ b/Core/include/Acts/TrackFitting/GlobalChiSquareFitter.hpp @@ -251,7 +251,7 @@ struct ScatteringProperties { /// @param invCovarianceMaterial_ The inverse covariance of the material. /// @param materialIsValid_ A boolean flag indicating whether the material is valid. ScatteringProperties(const BoundVector& scatteringAngles_, - const ActsScalar invCovarianceMaterial_, + const double invCovarianceMaterial_, const bool materialIsValid_) : m_scatteringAngles(scatteringAngles_), m_invCovarianceMaterial(invCovarianceMaterial_), @@ -264,7 +264,7 @@ struct ScatteringProperties { BoundVector& scatteringAngles() { return m_scatteringAngles; } // Accessor for the inverse covariance of the material. - ActsScalar invCovarianceMaterial() const { return m_invCovarianceMaterial; } + double invCovarianceMaterial() const { return m_invCovarianceMaterial; } // Accessor for the material validity flag. bool materialIsValid() const { return m_materialIsValid; } @@ -276,7 +276,7 @@ struct ScatteringProperties { /// Inverse covariance of the material. Compute with e.g. the Highland /// formula. - ActsScalar m_invCovarianceMaterial; + double m_invCovarianceMaterial; /// Flag indicating whether the material is valid. Commonly vacuum and zero /// thickness material will be ignored. @@ -503,7 +503,7 @@ void addMaterialToGx2fSums( "No scattering angles found for material surface."); } - const ActsScalar sinThetaLoc = std::sin(trackState.smoothed()[eBoundTheta]); + const double sinThetaLoc = std::sin(trackState.smoothed()[eBoundTheta]); // The position, where we need to insert the values in aMatrix and bVector const std::size_t deltaPosition = eBoundSize + 2 * nMaterialsHandled; @@ -511,7 +511,7 @@ void addMaterialToGx2fSums( const BoundVector& scatteringAngles = scatteringMapId->second.scatteringAngles(); - const ActsScalar invCov = scatteringMapId->second.invCovarianceMaterial(); + const double invCov = scatteringMapId->second.invCovarianceMaterial(); // Phi contribution extendedSystem.aMatrix()(deltaPosition, deltaPosition) += diff --git a/Core/include/Acts/TrackFitting/GsfOptions.hpp b/Core/include/Acts/TrackFitting/GsfOptions.hpp index 4840b6b6184..88fb902daff 100644 --- a/Core/include/Acts/TrackFitting/GsfOptions.hpp +++ b/Core/include/Acts/TrackFitting/GsfOptions.hpp @@ -29,7 +29,7 @@ enum class ComponentMergeMethod { eMean, eMaxWeight }; /// /// Encapsulates a component of a Gaussian mixture as used by the GSF struct GsfComponent { - ActsScalar weight = 0; + double weight = 0; BoundVector boundPars = BoundVector::Zero(); BoundSquareMatrix boundCov = BoundSquareMatrix::Identity(); }; diff --git a/Core/include/Acts/TrackFitting/detail/GsfUtils.hpp b/Core/include/Acts/TrackFitting/detail/GsfUtils.hpp index 501208b7e09..98605052bf6 100644 --- a/Core/include/Acts/TrackFitting/detail/GsfUtils.hpp +++ b/Core/include/Acts/TrackFitting/detail/GsfUtils.hpp @@ -150,7 +150,7 @@ class ScopedGsfInfoPrinterAndChecker { } }; -ActsScalar calculateDeterminant( +double calculateDeterminant( const double *fullCalibratedCovariance, TrackStateTraits::Covariance predictedCovariance, diff --git a/Core/include/Acts/TrackFitting/detail/SymmetricKlDistanceMatrix.hpp b/Core/include/Acts/TrackFitting/detail/SymmetricKlDistanceMatrix.hpp index f7fcfbd871e..e243840f5b9 100644 --- a/Core/include/Acts/TrackFitting/detail/SymmetricKlDistanceMatrix.hpp +++ b/Core/include/Acts/TrackFitting/detail/SymmetricKlDistanceMatrix.hpp @@ -66,7 +66,7 @@ auto mergeComponents(const component_t &a, const component_t &b, /// @brief Class representing a symmetric distance matrix class SymmetricKLDistanceMatrix { - using Array = Eigen::Array; + using Array = Eigen::Array; using Mask = Eigen::Array; Array m_distances; @@ -127,7 +127,7 @@ class SymmetricKLDistanceMatrix { } auto minDistancePair() const { - auto min = std::numeric_limits::max(); + auto min = std::numeric_limits::max(); std::size_t idx = 0; for (auto i = 0l; i < m_distances.size(); ++i) { diff --git a/Core/include/Acts/Utilities/Axis.hpp b/Core/include/Acts/Utilities/Axis.hpp index f843d0e7f92..5b55d27cd77 100644 --- a/Core/include/Acts/Utilities/Axis.hpp +++ b/Core/include/Acts/Utilities/Axis.hpp @@ -109,7 +109,7 @@ class Axis final : public IAxis { /// /// Divide the range \f$[\text{xmin},\text{xmax})\f$ into \f$\text{nBins}\f$ /// equidistant bins. - Axis(ActsScalar xmin, ActsScalar xmax, std::size_t nBins) + Axis(double xmin, double xmax, std::size_t nBins) : m_min(xmin), m_max(xmax), m_width((xmax - xmin) / nBins), @@ -124,7 +124,7 @@ class Axis final : public IAxis { /// /// Divide the range \f$[\text{xmin},\text{xmax})\f$ into \f$\text{nBins}\f$ /// equidistant bins. - Axis(AxisBoundaryTypeTag typeTag, ActsScalar xmin, ActsScalar xmax, + Axis(AxisBoundaryTypeTag typeTag, double xmin, double xmax, std::size_t nBins) : Axis(xmin, xmax, nBins) { static_cast(typeTag); @@ -306,7 +306,7 @@ class Axis final : public IAxis { /// bin with lower bound @c l and upper bound @c u. /// @note Bin indices start at @c 1. The underflow bin has the index @c 0 /// while the index nBins + 1 indicates the overflow bin . - std::size_t getBin(ActsScalar x) const { + std::size_t getBin(double x) const { return wrapBin( static_cast(std::floor((x - getMin()) / getBinWidth()) + 1)); } @@ -314,7 +314,7 @@ class Axis final : public IAxis { /// @brief get bin width /// /// @return constant width for all bins - ActsScalar getBinWidth(std::size_t /*bin*/ = 0) const { return m_width; } + double getBinWidth(std::size_t /*bin*/ = 0) const { return m_width; } /// @brief get lower bound of bin /// @@ -326,7 +326,7 @@ class Axis final : public IAxis { /// /// @note Bin intervals have a closed lower bound, i.e. the lower boundary /// belongs to the bin with the given bin index. - ActsScalar getBinLowerBound(std::size_t bin) const { + double getBinLowerBound(std::size_t bin) const { return getMin() + (bin - 1) * getBinWidth(); } @@ -340,7 +340,7 @@ class Axis final : public IAxis { /// /// @note Bin intervals have an open upper bound, i.e. the upper boundary /// does @b not belong to the bin with the given bin index. - ActsScalar getBinUpperBound(std::size_t bin) const { + double getBinUpperBound(std::size_t bin) const { return getMin() + bin * getBinWidth(); } @@ -351,19 +351,19 @@ class Axis final : public IAxis { /// /// @pre @c bin must be a valid bin index (excluding under-/overflow bins), /// i.e. \f$1 \le \text{bin} \le \text{nBins}\f$ - ActsScalar getBinCenter(std::size_t bin) const { + double getBinCenter(std::size_t bin) const { return getMin() + (bin - 0.5) * getBinWidth(); } /// @brief get maximum of binning range /// /// @return maximum of binning range - ActsScalar getMax() const override { return m_max; } + double getMax() const override { return m_max; } /// @brief get minimum of binning range /// /// @return minimum of binning range - ActsScalar getMin() const override { return m_min; } + double getMin() const override { return m_min; } /// @brief get total number of bins /// @@ -377,12 +377,12 @@ class Axis final : public IAxis { /// /// @post If @c true is returned, the bin containing the given value is a /// valid bin, i.e. it is neither the underflow nor the overflow bin. - bool isInside(ActsScalar x) const { return (m_min <= x) && (x < m_max); } + bool isInside(double x) const { return (m_min <= x) && (x < m_max); } /// @brief Return a vector of bin edges /// @return Vector which contains the bin edges - std::vector getBinEdges() const override { - std::vector binEdges; + std::vector getBinEdges() const override { + std::vector binEdges; for (std::size_t i = 1; i <= m_bins; i++) { binEdges.push_back(getBinLowerBound(i)); } @@ -403,11 +403,11 @@ class Axis final : public IAxis { private: /// minimum of binning range - ActsScalar m_min{}; + double m_min{}; /// maximum of binning range - ActsScalar m_max{}; + double m_max{}; /// constant bin width - ActsScalar m_width{}; + double m_width{}; /// number of bins (excluding under-/overflow bins) std::size_t m_bins{}; }; @@ -428,7 +428,7 @@ class Axis final : public IAxis { /// Create a binning structure with @c nBins variable-sized bins from the /// given bin boundaries. @c nBins is given by the number of bin edges /// reduced by one. - explicit Axis(std::vector binEdges) + explicit Axis(std::vector binEdges) : m_binEdges(std::move(binEdges)) {} /// @param [in] typeTag boundary type tag @@ -439,7 +439,7 @@ class Axis final : public IAxis { /// Create a binning structure with @c nBins variable-sized bins from the /// given bin boundaries. @c nBins is given by the number of bin edges /// reduced by one. - Axis(AxisBoundaryTypeTag typeTag, std::vector binEdges) + Axis(AxisBoundaryTypeTag typeTag, std::vector binEdges) : Axis(std::move(binEdges)) { static_cast(typeTag); } @@ -618,7 +618,7 @@ class Axis final : public IAxis { /// bin with lower bound @c l and upper bound @c u. /// @note Bin indices start at @c 1. The underflow bin has the index @c 0 /// while the index nBins + 1 indicates the overflow bin . - std::size_t getBin(ActsScalar x) const { + std::size_t getBin(double x) const { const auto it = std::upper_bound(std::begin(m_binEdges), std::end(m_binEdges), x); return wrapBin(std::distance(std::begin(m_binEdges), it)); @@ -631,7 +631,7 @@ class Axis final : public IAxis { /// /// @pre @c bin must be a valid bin index (excluding under-/overflow bins), /// i.e. \f$1 \le \text{bin} \le \text{nBins}\f$ - ActsScalar getBinWidth(std::size_t bin) const { + double getBinWidth(std::size_t bin) const { return m_binEdges.at(bin) - m_binEdges.at(bin - 1); } @@ -645,7 +645,7 @@ class Axis final : public IAxis { /// /// @note Bin intervals have a closed lower bound, i.e. the lower boundary /// belongs to the bin with the given bin index. - ActsScalar getBinLowerBound(std::size_t bin) const { + double getBinLowerBound(std::size_t bin) const { return m_binEdges.at(bin - 1); } @@ -659,9 +659,7 @@ class Axis final : public IAxis { /// /// @note Bin intervals have an open upper bound, i.e. the upper boundary /// does @b not belong to the bin with the given bin index. - ActsScalar getBinUpperBound(std::size_t bin) const { - return m_binEdges.at(bin); - } + double getBinUpperBound(std::size_t bin) const { return m_binEdges.at(bin); } /// @brief get bin center /// @@ -670,19 +668,19 @@ class Axis final : public IAxis { /// /// @pre @c bin must be a valid bin index (excluding under-/overflow bins), /// i.e. \f$1 \le \text{bin} \le \text{nBins}\f$ - ActsScalar getBinCenter(std::size_t bin) const { + double getBinCenter(std::size_t bin) const { return 0.5 * (getBinLowerBound(bin) + getBinUpperBound(bin)); } /// @brief get maximum of binning range /// /// @return maximum of binning range - ActsScalar getMax() const override { return m_binEdges.back(); } + double getMax() const override { return m_binEdges.back(); } /// @brief get minimum of binning range /// /// @return minimum of binning range - ActsScalar getMin() const override { return m_binEdges.front(); } + double getMin() const override { return m_binEdges.front(); } /// @brief get total number of bins /// @@ -696,13 +694,13 @@ class Axis final : public IAxis { /// /// @post If @c true is returned, the bin containing the given value is a /// valid bin, i.e. it is neither the underflow nor the overflow bin. - bool isInside(ActsScalar x) const { + bool isInside(double x) const { return (m_binEdges.front() <= x) && (x < m_binEdges.back()); } /// @brief Return a vector of bin edges /// @return Vector which contains the bin edges - std::vector getBinEdges() const override { return m_binEdges; } + std::vector getBinEdges() const override { return m_binEdges; } friend std::ostream& operator<<(std::ostream& os, const Axis& axis) { os << "Axis("; @@ -719,6 +717,6 @@ class Axis final : public IAxis { private: /// vector of bin edges (sorted in ascending order) - std::vector m_binEdges; + std::vector m_binEdges; }; } // namespace Acts diff --git a/Core/include/Acts/Utilities/AxisFwd.hpp b/Core/include/Acts/Utilities/AxisFwd.hpp index fefa980cbfd..ce31ff3f7b6 100644 --- a/Core/include/Acts/Utilities/AxisFwd.hpp +++ b/Core/include/Acts/Utilities/AxisFwd.hpp @@ -86,18 +86,18 @@ inline std::ostream& operator<<(std::ostream& os, AxisType type) { template class Axis; -Axis(ActsScalar min, ActsScalar max, +Axis(double min, double max, std::size_t bins) -> Axis; template -Axis(AxisBoundaryTypeTag /*bdt*/, ActsScalar min, ActsScalar max, +Axis(AxisBoundaryTypeTag /*bdt*/, double min, double max, std::size_t bins) -> Axis; -Axis(std::vector bins) +Axis(std::vector bins) -> Axis; template Axis(AxisBoundaryTypeTag /*bdt*/, - std::vector bins) -> Axis; + std::vector bins) -> Axis; } // namespace Acts diff --git a/Core/include/Acts/Utilities/Grid.hpp b/Core/include/Acts/Utilities/Grid.hpp index f6c5f9ddaf9..317fb3b123e 100644 --- a/Core/include/Acts/Utilities/Grid.hpp +++ b/Core/include/Acts/Utilities/Grid.hpp @@ -85,7 +85,7 @@ class Grid final : public IGrid { /// constant reference type to values stored using const_reference = const value_type&; /// type for points in d-dimensional grid space - using point_t = std::array; + using point_t = std::array; /// index type using local bin indices along each axis using index_t = std::array; /// global iterator type @@ -240,7 +240,7 @@ class Grid final : public IGrid { /// /// @pre All local bin indices must be a valid index for the corresponding /// axis (excluding the under-/overflow bins for each axis). - std::array binCenter(const index_t& localBins) const { + std::array binCenter(const index_t& localBins) const { return detail::grid_helper::getBinCenter(localBins, m_axes); } @@ -411,19 +411,19 @@ class Grid final : public IGrid { /// /// @note This function is available only if the following conditions are /// fulfilled: - /// - Given @c U and @c V of value type @c T as well as two @c ActsScalar + /// - Given @c U and @c V of value type @c T as well as two @c double /// @c a and @c b, then the following must be a valid expression a * U + b /// * V yielding an object which is (implicitly) convertible to @c T. /// - @c Point must represent a d-dimensional position and support /// coordinate access using @c operator[] which should return a @c - /// ActsScalar (or a value which is implicitly convertible). Coordinate + /// double (or a value which is implicitly convertible). Coordinate /// indices must start at 0. /// @note Bin values are interpreted as being the field values at the /// lower-left corner of the corresponding hyper-box. template T interpolate(const Point& point) const - requires(Concepts::interpolatable, - std::array>) + requires(Concepts::interpolatable, + std::array>) { // there are 2^DIM corner points used during the interpolation constexpr std::size_t nCorners = 1 << DIM; diff --git a/Core/include/Acts/Utilities/GridAccessHelpers.hpp b/Core/include/Acts/Utilities/GridAccessHelpers.hpp index 20755d01ff6..085ea318f26 100644 --- a/Core/include/Acts/Utilities/GridAccessHelpers.hpp +++ b/Core/include/Acts/Utilities/GridAccessHelpers.hpp @@ -144,7 +144,7 @@ class Affine3Transformed final : public IGlobalToGridLocal { template class GlobalSubspace final : public IGlobalToGridLocal { public: - using grid_local_t = std::array; + using grid_local_t = std::array; /// Assert that size has to be bigger than 0 static_assert(sizeof...(Args) > 0, @@ -181,7 +181,7 @@ class GlobalSubspace final : public IGlobalToGridLocal { template class LocalSubspace final : public IBoundToGridLocal { public: - using grid_local_t = std::array; + using grid_local_t = std::array; /// Assert that the accessors are unique static_assert(sizeof...(Args) == 1 || sizeof...(Args) == 2, @@ -214,15 +214,15 @@ class LocalSubspace final : public IBoundToGridLocal { class BoundCylinderToZPhi final : public IBoundToGridLocal { public: - ActsScalar radius = 1.; - ActsScalar shift = 0.; + double radius = 1.; + double shift = 0.; /// Constructor with arguments /// @param r the radius /// @param z the shift - BoundCylinderToZPhi(ActsScalar r, ActsScalar z) : radius(r), shift(z) {} + BoundCylinderToZPhi(double r, double z) : radius(r), shift(z) {} - std::array toGridLocal(const Vector2& local) const { + std::array toGridLocal(const Vector2& local) const { return {local[1u] + shift, local[0u] / radius}; } @@ -232,25 +232,25 @@ class BoundCylinderToZPhi final : public IBoundToGridLocal { // Definition of bound (on surface) to grid local representation delegate // 1 dimensional local grid using BoundToGridLocal1DimDelegate = - OwningDelegate(const Vector2&), + OwningDelegate(const Vector2&), GridAccess::IBoundToGridLocal>; // Definition of global to grid local representation delegate // 1 dimensional local grid using GlobalToGridLocal1DimDelegate = - OwningDelegate(const Vector3&), + OwningDelegate(const Vector3&), GridAccess::IGlobalToGridLocal>; // Definition of bound (on surface) to grid local representation delegate // 2 dimensional local grid using BoundToGridLocal2DimDelegate = - OwningDelegate(const Vector2&), + OwningDelegate(const Vector2&), GridAccess::IBoundToGridLocal>; // Definition of global to grid local representation delegate // 2 dimensional local grid using GlobalToGridLocal2DimDelegate = - OwningDelegate(const Vector3&), + OwningDelegate(const Vector3&), GridAccess::IGlobalToGridLocal>; } // namespace GridAccess diff --git a/Core/include/Acts/Utilities/GridAxisGenerators.hpp b/Core/include/Acts/Utilities/GridAxisGenerators.hpp index 18e6a1cdd2e..170108d2316 100644 --- a/Core/include/Acts/Utilities/GridAxisGenerators.hpp +++ b/Core/include/Acts/Utilities/GridAxisGenerators.hpp @@ -38,7 +38,7 @@ struct Eq { using grid_type = Acts::Grid>; - std::array range = {}; + std::array range = {}; std::size_t nBins = 0u; /// Call operator that generates the Axis @@ -66,7 +66,7 @@ struct Var { template using grid_type = Acts::Grid>; - std::vector edges = {}; + std::vector edges = {}; /// Call operator that generates the Axis return_type operator()() const { @@ -98,9 +98,9 @@ struct EqEq { Acts::Grid, Acts::Axis>; - std::array range0 = {}; + std::array range0 = {}; std::size_t nBins0 = 0u; - std::array range1 = {}; + std::array range1 = {}; std::size_t nBins1 = 1u; /// Call operator that generates the Axis @@ -151,9 +151,9 @@ struct EqVar { Acts::Grid, Acts::Axis>; - std::array range = {}; + std::array range = {}; std::size_t nBins = 0u; - std::vector edges = {}; + std::vector edges = {}; /// Call operator that generates the Axis return_type operator()() const { @@ -201,8 +201,8 @@ struct VarEq { using grid_type = Acts::Grid, Acts::Axis>; - std::vector edges = {}; - std::array range = {}; + std::vector edges = {}; + std::array range = {}; std::size_t nBins = 0u; /// Call operator that generates the Axis @@ -250,8 +250,8 @@ struct VarVar { using grid_type = Acts::Grid, Acts::Axis>; - std::vector edges0 = {}; - std::vector edges1 = {}; + std::vector edges0 = {}; + std::vector edges1 = {}; /// Call operator that generates the Axis return_type operator()() const { diff --git a/Core/include/Acts/Utilities/Helpers.hpp b/Core/include/Acts/Utilities/Helpers.hpp index 4bf9d1c89c3..16949698bb8 100644 --- a/Core/include/Acts/Utilities/Helpers.hpp +++ b/Core/include/Acts/Utilities/Helpers.hpp @@ -175,10 +175,10 @@ T clampValue(U value) { /// /// @return [ range, medium ] in an tuple template -std::tuple range_medium(const T& tseries) { +std::tuple range_medium(const T& tseries) { auto [minIt, maxIt] = std::ranges::minmax_element(tseries); typename T::value_type range = (*maxIt - *minIt); - ActsScalar medium = static_cast((*maxIt + *minIt) * 0.5); + double medium = static_cast((*maxIt + *minIt) * 0.5); return {range, medium}; } diff --git a/Core/include/Acts/Utilities/IAxis.hpp b/Core/include/Acts/Utilities/IAxis.hpp index e279b83ed1a..09c9fbd3a56 100644 --- a/Core/include/Acts/Utilities/IAxis.hpp +++ b/Core/include/Acts/Utilities/IAxis.hpp @@ -41,17 +41,17 @@ class IAxis { /// @brief Return a vector of bin edges /// @return Vector which contains the bin edges - virtual std::vector getBinEdges() const = 0; + virtual std::vector getBinEdges() const = 0; /// @brief get minimum of binning range /// /// @return minimum of binning range - virtual ActsScalar getMin() const = 0; + virtual double getMin() const = 0; /// @brief get maximum of binning range /// /// @return maximum of binning range - virtual ActsScalar getMax() const = 0; + virtual double getMax() const = 0; /// @brief get total number of bins /// diff --git a/Core/include/Acts/Utilities/Intersection.hpp b/Core/include/Acts/Utilities/Intersection.hpp index 6276538ed5e..a63d312412e 100644 --- a/Core/include/Acts/Utilities/Intersection.hpp +++ b/Core/include/Acts/Utilities/Intersection.hpp @@ -66,7 +66,7 @@ class Intersection { constexpr const Position& position() const { return m_position; } /// Returns the path length to the interseciton - constexpr ActsScalar pathLength() const { return m_pathLength; } + constexpr double pathLength() const { return m_pathLength; } /// Returns the intersection status enum constexpr Status status() const { return m_status; } @@ -115,7 +115,7 @@ class Intersection { /// Position of the intersection Position m_position = Position::Zero(); /// Signed path length to the intersection (if valid) - ActsScalar m_pathLength = std::numeric_limits::infinity(); + double m_pathLength = std::numeric_limits::infinity(); /// The Status of the intersection Status m_status = Status::unreachable; @@ -156,9 +156,7 @@ class ObjectIntersection { } /// Returns the path length to the interseciton - constexpr ActsScalar pathLength() const { - return m_intersection.pathLength(); - } + constexpr double pathLength() const { return m_intersection.pathLength(); } /// Returns the status of the interseciton constexpr Intersection3D::Status status() const { diff --git a/Core/include/Acts/Utilities/JacobianHelpers.hpp b/Core/include/Acts/Utilities/JacobianHelpers.hpp index b3b51b510fa..eace94fd096 100644 --- a/Core/include/Acts/Utilities/JacobianHelpers.hpp +++ b/Core/include/Acts/Utilities/JacobianHelpers.hpp @@ -53,7 +53,7 @@ inline ActsMatrix<2, 3> freeToSphericalDirectionJacobian( const Vector3& direction) { auto [cosPhi, sinPhi, cosTheta, sinTheta] = VectorHelpers::evaluateTrigonomics(direction); - ActsScalar invSinTheta = 1. / sinTheta; + double invSinTheta = 1. / sinTheta; // clang-format off ActsMatrix<2, 3> jacobian; diff --git a/Core/include/Acts/Utilities/Ray.hpp b/Core/include/Acts/Utilities/Ray.hpp index 3ec972847ff..6b6ad1940ae 100644 --- a/Core/include/Acts/Utilities/Ray.hpp +++ b/Core/include/Acts/Utilities/Ray.hpp @@ -78,7 +78,7 @@ std::ostream& operator<<(std::ostream& os, const Ray& ray) { return os; } -using Ray3D = Ray; +using Ray3D = Ray; } // namespace Acts diff --git a/Core/include/Acts/Utilities/SpacePointUtility.hpp b/Core/include/Acts/Utilities/SpacePointUtility.hpp index c995bfd3c36..f95ca4521f7 100644 --- a/Core/include/Acts/Utilities/SpacePointUtility.hpp +++ b/Core/include/Acts/Utilities/SpacePointUtility.hpp @@ -75,8 +75,7 @@ class SpacePointUtility { /// @param par local position /// @param cov local covariance /// @return vectors of the global coordinates and covariance of the SourceLink - std::tuple, Vector2, - std::optional> + std::tuple, Vector2, std::optional> globalCoords(const GeometryContext& gctx, const SourceLink& slink, const SourceLinkSurfaceAccessor& surfaceAccessor, const BoundVector& par, const BoundSquareMatrix& cov) const; diff --git a/Core/include/Acts/Utilities/StringHelpers.hpp b/Core/include/Acts/Utilities/StringHelpers.hpp index e77b317eb0d..16c4965e937 100644 --- a/Core/include/Acts/Utilities/StringHelpers.hpp +++ b/Core/include/Acts/Utilities/StringHelpers.hpp @@ -104,10 +104,10 @@ inline std::string toString(const Acts::Transform3& transform, return sout.str(); } -/// Print out a vector of ActsScalar +/// Print out a vector of double /// @param pVector The vector to print /// @param precision Numeric output precision -inline std::string toString(const std::vector& pVector, +inline std::string toString(const std::vector& pVector, int precision = 4) { std::ostringstream sout; sout << std::setiosflags(std::ios::fixed) << std::setprecision(precision); diff --git a/Core/include/Acts/Utilities/VectorHelpers.hpp b/Core/include/Acts/Utilities/VectorHelpers.hpp index 8f09a6d0591..bec3e874cf9 100644 --- a/Core/include/Acts/Utilities/VectorHelpers.hpp +++ b/Core/include/Acts/Utilities/VectorHelpers.hpp @@ -125,19 +125,19 @@ double eta(const Eigen::MatrixBase& v) noexcept { /// @param direction for this evaluatoin /// /// @return cos(phi), sin(phi), cos(theta), sin(theta), 1/sin(theta) -inline std::array evaluateTrigonomics(const Vector3& direction) { - const ActsScalar x = direction(0); // == cos(phi) * sin(theta) - const ActsScalar y = direction(1); // == sin(phi) * sin(theta) - const ActsScalar z = direction(2); // == cos(theta) +inline std::array evaluateTrigonomics(const Vector3& direction) { + const double x = direction(0); // == cos(phi) * sin(theta) + const double y = direction(1); // == sin(phi) * sin(theta) + const double z = direction(2); // == cos(theta) // can be turned into cosine/sine - const ActsScalar cosTheta = z; - const ActsScalar sinTheta = std::sqrt(1 - z * z); + const double cosTheta = z; + const double sinTheta = std::sqrt(1 - z * z); assert(sinTheta != 0 && "VectorHelpers: Vector is parallel to the z-axis " "which leads to division by zero"); - const ActsScalar invSinTheta = 1. / sinTheta; - const ActsScalar cosPhi = x * invSinTheta; - const ActsScalar sinPhi = y * invSinTheta; + const double invSinTheta = 1. / sinTheta; + const double cosPhi = x * invSinTheta; + const double sinPhi = y * invSinTheta; return {cosPhi, sinPhi, cosTheta, sinTheta}; } diff --git a/Core/include/Acts/Utilities/detail/grid_helper.hpp b/Core/include/Acts/Utilities/detail/grid_helper.hpp index efc0f0a70cf..287a9f69a08 100644 --- a/Core/include/Acts/Utilities/detail/grid_helper.hpp +++ b/Core/include/Acts/Utilities/detail/grid_helper.hpp @@ -162,7 +162,7 @@ template struct grid_helper_impl { template static void getBinCenter( - std::array& center, + std::array& center, const std::array& localIndices, const std::tuple& axes) { center.at(N) = std::get(axes).getBinCenter(localIndices.at(N)); @@ -203,7 +203,7 @@ struct grid_helper_impl { template static void getLowerLeftBinEdge( - std::array& llEdge, + std::array& llEdge, const std::array& localIndices, const std::tuple& axes) { llEdge.at(N) = std::get(axes).getBinLowerBound(localIndices.at(N)); @@ -235,7 +235,7 @@ struct grid_helper_impl { template static void getUpperRightBinEdge( - std::array& urEdge, + std::array& urEdge, const std::array& localIndices, const std::tuple& axes) { urEdge.at(N) = std::get(axes).getBinUpperBound(localIndices.at(N)); @@ -252,21 +252,21 @@ struct grid_helper_impl { template static void getMin(const std::tuple& axes, - std::array& minArray) { + std::array& minArray) { minArray[N] = std::get(axes).getMin(); grid_helper_impl::getMin(axes, minArray); } template static void getMax(const std::tuple& axes, - std::array& maxArray) { + std::array& maxArray) { maxArray[N] = std::get(axes).getMax(); grid_helper_impl::getMax(axes, maxArray); } template static void getWidth(const std::tuple& axes, - std::array& widthArray) { + std::array& widthArray) { widthArray[N] = std::get(axes).getBinWidth(); grid_helper_impl::getWidth(axes, widthArray); } @@ -328,7 +328,7 @@ template <> struct grid_helper_impl<0u> { template static void getBinCenter( - std::array& center, + std::array& center, const std::array& localIndices, const std::tuple& axes) { center.at(0u) = std::get<0u>(axes).getBinCenter(localIndices.at(0u)); @@ -361,7 +361,7 @@ struct grid_helper_impl<0u> { template static void getLowerLeftBinEdge( - std::array& llEdge, + std::array& llEdge, const std::array& localIndices, const std::tuple& axes) { llEdge.at(0u) = std::get<0u>(axes).getBinLowerBound(localIndices.at(0u)); @@ -389,7 +389,7 @@ struct grid_helper_impl<0u> { template static void getUpperRightBinEdge( - std::array& urEdge, + std::array& urEdge, const std::array& localIndices, const std::tuple& axes) { urEdge.at(0u) = std::get<0u>(axes).getBinUpperBound(localIndices.at(0u)); @@ -404,19 +404,19 @@ struct grid_helper_impl<0u> { template static void getMin(const std::tuple& axes, - std::array& minArray) { + std::array& minArray) { minArray[0u] = std::get<0u>(axes).getMin(); } template static void getMax(const std::tuple& axes, - std::array& maxArray) { + std::array& maxArray) { maxArray[0u] = std::get<0u>(axes).getMax(); } template static void getWidth(const std::tuple& axes, - std::array& widthArray) { + std::array& widthArray) { widthArray[0u] = std::get<0u>(axes).getBinWidth(); } @@ -518,10 +518,10 @@ struct grid_helper { /// @pre @c localIndices must only contain valid bin indices (i.e. excluding /// under-/overflow bins). template - static std::array getBinCenter( + static std::array getBinCenter( const std::array& localIndices, const std::tuple& axes) { - std::array center{}; + std::array center{}; constexpr std::size_t MAX = sizeof...(Axes) - 1; grid_helper_impl::getBinCenter(center, localIndices, axes); @@ -608,10 +608,10 @@ struct grid_helper { /// @pre @c localIndices must only contain valid bin indices (excluding /// underflow bins). template - static std::array getLowerLeftBinEdge( + static std::array getLowerLeftBinEdge( const std::array& localIndices, const std::tuple& axes) { - std::array llEdge{}; + std::array llEdge{}; constexpr std::size_t MAX = sizeof...(Axes) - 1; grid_helper_impl::getLowerLeftBinEdge(llEdge, localIndices, axes); @@ -682,10 +682,10 @@ struct grid_helper { /// @pre @c localIndices must only contain valid bin indices (excluding /// overflow bins). template - static std::array getUpperRightBinEdge( + static std::array getUpperRightBinEdge( const std::array& localIndices, const std::tuple& axes) { - std::array urEdge{}; + std::array urEdge{}; constexpr std::size_t MAX = sizeof...(Axes) - 1; grid_helper_impl::getUpperRightBinEdge(urEdge, localIndices, axes); @@ -722,9 +722,9 @@ struct grid_helper { /// @param [in] axes actual axis objects spanning the grid /// @return array returning the minima of all given axes template - static std::array getMin( + static std::array getMin( const std::tuple& axes) { - std::array minArray{}; + std::array minArray{}; grid_helper_impl::getMin(axes, minArray); return minArray; } @@ -735,9 +735,9 @@ struct grid_helper { /// @param [in] axes actual axis objects spanning the grid /// @return array returning the maxima of all given axes template - static std::array getMax( + static std::array getMax( const std::tuple& axes) { - std::array maxArray{}; + std::array maxArray{}; grid_helper_impl::getMax(axes, maxArray); return maxArray; } @@ -748,9 +748,9 @@ struct grid_helper { /// @param [in] axes actual axis objects spanning the grid /// @return array returning the maxima of all given axes template - static std::array getWidth( + static std::array getWidth( const std::tuple& axes) { - std::array widthArray{}; + std::array widthArray{}; grid_helper_impl::getWidth(axes, widthArray); return widthArray; } diff --git a/Core/include/Acts/Vertexing/HelicalTrackLinearizer.hpp b/Core/include/Acts/Vertexing/HelicalTrackLinearizer.hpp index fa1eef6d50a..0257d8ec730 100644 --- a/Core/include/Acts/Vertexing/HelicalTrackLinearizer.hpp +++ b/Core/include/Acts/Vertexing/HelicalTrackLinearizer.hpp @@ -53,7 +53,7 @@ class HelicalTrackLinearizer { /// Tolerance determining how close we need to get to the Perigee surface to /// reach it during propagation - ActsScalar targetTolerance = 1e-12; + double targetTolerance = 1e-12; }; /// @brief Constructor diff --git a/Core/include/Acts/Vertexing/NumericalTrackLinearizer.hpp b/Core/include/Acts/Vertexing/NumericalTrackLinearizer.hpp index 00d5cddf989..e9beca46f36 100644 --- a/Core/include/Acts/Vertexing/NumericalTrackLinearizer.hpp +++ b/Core/include/Acts/Vertexing/NumericalTrackLinearizer.hpp @@ -79,11 +79,11 @@ class NumericalTrackLinearizer { /// Tolerance determining how close we need to get to a surface to /// reach it during propagation - ActsScalar targetTolerance = 1e-12; + double targetTolerance = 1e-12; /// Setting size of the perturbation delta for calculation of numerical /// derivatives (i.e., f'(x) ~ (f(x+delta) - f(x)) / delta) - ActsScalar delta = 1e-8; + double delta = 1e-8; }; /// @brief Constructor diff --git a/Core/include/Acts/Vertexing/SingleSeedVertexFinder.hpp b/Core/include/Acts/Vertexing/SingleSeedVertexFinder.hpp index cc5bdf20289..cd05eb4eb0a 100644 --- a/Core/include/Acts/Vertexing/SingleSeedVertexFinder.hpp +++ b/Core/include/Acts/Vertexing/SingleSeedVertexFinder.hpp @@ -39,47 +39,47 @@ class SingleSeedVertexFinder { struct Config { /// maximum deviation in phi between the near and middle spacepoints or /// middle and far spacepoints - Acts::ActsScalar maxPhideviation = 0.08; + double maxPhideviation = 0.08; /// maximum deviation in X-Y between the first 2 spacepoints and the last 2 /// spacepoints - Acts::ActsScalar maxXYdeviation = 0.08; + double maxXYdeviation = 0.08; /// maximum deviation in 3D between the first 2 spacepoints and the last 2 /// spacepoints - Acts::ActsScalar maxXYZdeviation = 0.08; + double maxXYZdeviation = 0.08; /// minimum angle between Z axis and a triplet, effectively removing /// triplets with large |eta| - Acts::ActsScalar minTheta = 1.; + double minTheta = 1.; /// thresholds for near, middle, and far spacepoints - Acts::ActsScalar rMinNear = 20.f * Acts::UnitConstants::mm; - Acts::ActsScalar rMaxNear = 60.f * Acts::UnitConstants::mm; - Acts::ActsScalar rMinMiddle = 150.f * Acts::UnitConstants::mm; - Acts::ActsScalar rMaxMiddle = 190.f * Acts::UnitConstants::mm; - Acts::ActsScalar rMinFar = 280.f * Acts::UnitConstants::mm; - Acts::ActsScalar rMaxFar = 320.f * Acts::UnitConstants::mm; + double rMinNear = 20.f * Acts::UnitConstants::mm; + double rMaxNear = 60.f * Acts::UnitConstants::mm; + double rMinMiddle = 150.f * Acts::UnitConstants::mm; + double rMaxMiddle = 190.f * Acts::UnitConstants::mm; + double rMinFar = 280.f * Acts::UnitConstants::mm; + double rMaxFar = 320.f * Acts::UnitConstants::mm; /// number of phi slices, at least 3 to avoid duplicities /// it should be less than 2*pi/maxPhideviation in order not to loop over /// triplets that will be rejected by maxPhideviation anyway std::uint32_t numPhiSlices = 60; /// use only a fraction of available phi slices to speed up calculations; - Acts::ActsScalar useFracPhiSlices = 0.5; + double useFracPhiSlices = 0.5; /// number of z slices std::uint32_t numZSlices = 150; /// use only a fraction of available z slices to speed up calculations; - Acts::ActsScalar useFracZSlices = 0.5; + double useFracZSlices = 0.5; /// maximum |z| to consider, z slices will be done within the range /// (-maxAbsZ,maxAbsZ) /// values of maxAbsZ, maxZPosition, rMaxFar, and minTheta should be /// set reasonably with respect to each other - Acts::ActsScalar maxAbsZ = 450. * Acts::UnitConstants::mm; + double maxAbsZ = 450. * Acts::UnitConstants::mm; /// maximum Z position of the vertex at the point closest to the Z axis - Acts::ActsScalar maxZPosition = 200.f * Acts::UnitConstants::mm; + double maxZPosition = 200.f * Acts::UnitConstants::mm; /// maximum R position of the vertex at the point closest to the Z axis - Acts::ActsScalar maxRPosition = 10.f * Acts::UnitConstants::mm; + double maxRPosition = 10.f * Acts::UnitConstants::mm; /// chi^2 minimalization will happen with respect to "planes" or "rays" std::string minimalizeWRT = "planes"; @@ -88,9 +88,9 @@ class SingleSeedVertexFinder { /// chi^2 std::uint32_t maxIterations = 20; /// each iteration, discard this fraction of triplets with the largest chi^2 - Acts::ActsScalar removeFraction = 0.10; + double removeFraction = 0.10; /// if the vertex estimation moves less than this, stop iterations - Acts::ActsScalar minVtxShift = 0.3f * Acts::UnitConstants::mm; + double minVtxShift = 0.3f * Acts::UnitConstants::mm; }; /// Const access to the config @@ -126,11 +126,11 @@ class SingleSeedVertexFinder { /// @brief Struct to store sorted spacepoints for each layer (near, middle, and far), for each slice of phi, and for each slice of z struct SortedSpacepoints { SortedSpacepoints(const int phiSize, const int zSize) { - std::vector> helper = {}; - std::vector>> - helperZ(zSize, helper); - std::vector>>> + std::vector> helper = {}; + std::vector>> helperZ( + zSize, helper); + std::vector< + std::vector>>> helperPhi(phiSize, helperZ); sortedSP.fill(helperPhi); } @@ -140,8 +140,9 @@ class SingleSeedVertexFinder { /// @param phi Index of the phi slice /// @param z Index of the z slice /// @return Non-const vector of spacepoints - inline std::vector>& addSP( - int layer, int phi, int z) { + inline std::vector>& addSP(int layer, + int phi, + int z) { return sortedSP[layer][phi][z]; } @@ -150,13 +151,13 @@ class SingleSeedVertexFinder { /// @param phi Index of the phi slice /// @param z Index of the z slice /// @return Const vector of spacepoints - inline const std::vector>& - getSP(int layer, int phi, int z) const { + inline const std::vector>& getSP( + int layer, int phi, int z) const { return sortedSP[layer][phi][z]; } - std::array>>>, + std::array>>>, 3> sortedSP; }; @@ -187,7 +188,7 @@ class SingleSeedVertexFinder { /// @brief Calculates equation of the plane (alpha*x + beta*y + gamma*z + delta = 0), given the three points /// @param triplet A single triplet (with 3 spacepoints) /// @return A pair of {{alpha,beta,gamma},delta} - static std::pair makePlaneFromTriplet( + static std::pair makePlaneFromTriplet( const Triplet& triplet); /// @brief Find a point (=the vertex) that has minimum chi^2 with respect to all planes defined by the triplets diff --git a/Core/include/Acts/Vertexing/SingleSeedVertexFinder.ipp b/Core/include/Acts/Vertexing/SingleSeedVertexFinder.ipp index 83b13d37d57..6c4f9edb6ff 100644 --- a/Core/include/Acts/Vertexing/SingleSeedVertexFinder.ipp +++ b/Core/include/Acts/Vertexing/SingleSeedVertexFinder.ipp @@ -85,7 +85,7 @@ Acts::SingleSeedVertexFinder::sortSpacepoints( for (const auto& sp : spacepoints) { // phi will be saved for later - Acts::ActsScalar phi = detail::radian_pos(std::atan2(sp.y(), sp.x())); + double phi = detail::radian_pos(std::atan2(sp.y(), sp.x())); std::uint32_t phislice = static_cast( phi / (2 * std::numbers::pi) * m_cfg.numPhiSlices); if (phislice >= m_cfg.numPhiSlices) { @@ -144,12 +144,12 @@ Acts::SingleSeedVertexFinder::findTriplets( Acts::Vector2 vecB = {vecA[1], -vecA[0]}; vecB /= std::tan(m_cfg.maxXYZdeviation); Acts::Vector2 posR = Acts::Vector2(-m_cfg.maxZPosition, 0.) + vecA + vecB; - Acts::ActsScalar R = vecA.norm() / std::sin(m_cfg.maxXYZdeviation); - Acts::ActsScalar constB = -2. * posR[0]; - Acts::ActsScalar constC = - posR[0] * posR[0] + - (posR[1] - m_cfg.rMaxNear) * (posR[1] - m_cfg.rMaxNear) - R * R; - Acts::ActsScalar maxZMiddle = + double R = vecA.norm() / std::sin(m_cfg.maxXYZdeviation); + double constB = -2. * posR[0]; + double constC = posR[0] * posR[0] + + (posR[1] - m_cfg.rMaxNear) * (posR[1] - m_cfg.rMaxNear) - + R * R; + double maxZMiddle = -1. * (-constB - sqrt(constB * constB - 4. * constC)) / 2.; if (maxZMiddle <= 0) { ACTS_WARNING( @@ -160,14 +160,14 @@ Acts::SingleSeedVertexFinder::findTriplets( } // save some constant values for later - Acts::ActsScalar rNearRatio[2] = {m_cfg.rMinNear / m_cfg.rMaxMiddle, - m_cfg.rMaxNear / m_cfg.rMinMiddle}; - Acts::ActsScalar rMiddle[2] = {m_cfg.rMaxMiddle, m_cfg.rMinMiddle}; - Acts::ActsScalar rFarDelta[2] = { + double rNearRatio[2] = {m_cfg.rMinNear / m_cfg.rMaxMiddle, + m_cfg.rMaxNear / m_cfg.rMinMiddle}; + double rMiddle[2] = {m_cfg.rMaxMiddle, m_cfg.rMinMiddle}; + double rFarDelta[2] = { m_cfg.rMaxFar - m_cfg.rMinMiddle, m_cfg.rMinFar - m_cfg.rMaxMiddle, }; - Acts::ActsScalar zBinLength = 2. * m_cfg.maxAbsZ / m_cfg.numZSlices; + double zBinLength = 2. * m_cfg.maxAbsZ / m_cfg.numZSlices; // limits in terms of slice numbers std::uint32_t limitMiddleSliceFrom = @@ -190,25 +190,24 @@ Acts::SingleSeedVertexFinder::findTriplets( // calculate limits for near spacepoints, assuming the middle spacepoints // are within some boundaries bool isLessFrom = (middleZ <= limitAbsZSliceFrom); - Acts::ActsScalar deltaZfrom = - (middleZ - limitAbsZSliceFrom - 1) * zBinLength; - Acts::ActsScalar angleZfrom = + double deltaZfrom = (middleZ - limitAbsZSliceFrom - 1) * zBinLength; + double angleZfrom = std::atan2(rMiddle[isLessFrom], deltaZfrom) + m_cfg.maxXYZdeviation; std::uint32_t nearZFrom = 0; - if (angleZfrom < std::numbers::pi_v) { - Acts::ActsScalar new_deltaZfrom = + if (angleZfrom < std::numbers::pi_v) { + double new_deltaZfrom = rMiddle[isLessFrom] / std::tan(angleZfrom) / zBinLength; nearZFrom = static_cast(std::max( new_deltaZfrom * rNearRatio[isLessFrom] + limitAbsZSliceFrom, 0.)); } bool isLessTo = (middleZ < limitAbsZSliceTo); - Acts::ActsScalar deltaZto = (middleZ - limitAbsZSliceTo + 1) * zBinLength; - Acts::ActsScalar angleZto = + double deltaZto = (middleZ - limitAbsZSliceTo + 1) * zBinLength; + double angleZto = std::atan2(rMiddle[!isLessTo], deltaZto) - m_cfg.maxXYZdeviation; std::uint32_t nearZTo = m_cfg.numZSlices; if (angleZto > 0) { - Acts::ActsScalar new_deltaZto = + double new_deltaZto = rMiddle[!isLessTo] / std::tan(angleZto) / zBinLength; nearZTo = static_cast(std::max( new_deltaZto * rNearRatio[!isLessTo] + limitAbsZSliceTo, 0.)); @@ -222,12 +221,11 @@ Acts::SingleSeedVertexFinder::findTriplets( // spacepoints are within some boundaries bool isMiddleLess = (middleZ <= nearZ); - Acts::ActsScalar delta2Zfrom = (middleZ - nearZ - 1) * zBinLength; - Acts::ActsScalar angle2Zfrom = - std::atan2(rFarDelta[isMiddleLess], delta2Zfrom) + - m_cfg.maxXYZdeviation; + double delta2Zfrom = (middleZ - nearZ - 1) * zBinLength; + double angle2Zfrom = std::atan2(rFarDelta[isMiddleLess], delta2Zfrom) + + m_cfg.maxXYZdeviation; std::uint32_t farZFrom = 0; - if (angle2Zfrom < std::numbers::pi_v) { + if (angle2Zfrom < std::numbers::pi_v) { farZFrom = static_cast(std::max( (rFarDelta[isMiddleLess] / std::tan(angle2Zfrom) / zBinLength) + middleZ, @@ -238,10 +236,9 @@ Acts::SingleSeedVertexFinder::findTriplets( } isMiddleLess = (middleZ < nearZ); - Acts::ActsScalar delta2Zto = (middleZ - nearZ + 1) * zBinLength; - Acts::ActsScalar angle2Zto = - std::atan2(rFarDelta[!isMiddleLess], delta2Zto) - - m_cfg.maxXYZdeviation; + double delta2Zto = (middleZ - nearZ + 1) * zBinLength; + double angle2Zto = std::atan2(rFarDelta[!isMiddleLess], delta2Zto) - + m_cfg.maxXYZdeviation; std::uint32_t farZTo = m_cfg.numZSlices; if (angle2Zto > 0) { farZTo = static_cast(std::max( @@ -282,13 +279,13 @@ Acts::SingleSeedVertexFinder::findTriplets( // for all near spacepoints in this slice for (const auto& nearSP : sortedSpacepoints.getSP(0, nearPhi, nearZ)) { - Acts::ActsScalar phiA = nearSP.second; + double phiA = nearSP.second; // for all middle spacepoints in this slice for (const auto& middleSP : sortedSpacepoints.getSP(1, middlePhi, middleZ)) { - Acts::ActsScalar phiB = middleSP.second; - Acts::ActsScalar deltaPhiAB = detail::difference_periodic( + double phiB = middleSP.second; + double deltaPhiAB = detail::difference_periodic( phiA, phiB, 2 * std::numbers::pi); if (std::abs(deltaPhiAB) > m_cfg.maxPhideviation) { continue; @@ -297,10 +294,9 @@ Acts::SingleSeedVertexFinder::findTriplets( // for all far spacepoints in this slice for (const auto& farSP : sortedSpacepoints.getSP(2, farPhi, farZ)) { - Acts::ActsScalar phiC = farSP.second; - Acts::ActsScalar deltaPhiBC = detail::difference_periodic( - phiB, phiC, - static_cast(2 * std::numbers::pi)); + double phiC = farSP.second; + double deltaPhiBC = detail::difference_periodic( + phiB, phiC, static_cast(2 * std::numbers::pi)); if (std::abs(deltaPhiBC) > m_cfg.maxPhideviation) { continue; } @@ -328,14 +324,14 @@ template bool Acts::SingleSeedVertexFinder::tripletValidationAndUpdate( Acts::SingleSeedVertexFinder::Triplet& triplet) const { // slope for near+middle spacepoints - Acts::ActsScalar alpha1 = + double alpha1 = std::atan2(triplet.a.y() - triplet.b.y(), triplet.a.x() - triplet.b.x()); // slope for middle+far spacepoints - Acts::ActsScalar alpha2 = + double alpha2 = std::atan2(triplet.b.y() - triplet.c.y(), triplet.b.x() - triplet.c.x()); // these two slopes shouldn't be too different - Acts::ActsScalar deltaAlpha = detail::difference_periodic( - alpha1, alpha2, static_cast(2 * std::numbers::pi)); + double deltaAlpha = detail::difference_periodic( + alpha1, alpha2, static_cast(2 * std::numbers::pi)); if (std::abs(deltaAlpha) > m_cfg.maxXYdeviation) { return false; } @@ -347,8 +343,8 @@ bool Acts::SingleSeedVertexFinder::tripletValidationAndUpdate( Acts::Vector3 bc{triplet.b.x() - triplet.c.x(), triplet.b.y() - triplet.c.y(), triplet.b.z() - triplet.c.z()}; // dot product of these two - Acts::ActsScalar cosTheta = (ab.dot(bc)) / (ab.norm() * bc.norm()); - Acts::ActsScalar theta = std::acos(cosTheta); + double cosTheta = (ab.dot(bc)) / (ab.norm() * bc.norm()); + double theta = std::acos(cosTheta); if (theta > m_cfg.maxXYZdeviation) { return false; } @@ -359,21 +355,21 @@ bool Acts::SingleSeedVertexFinder::tripletValidationAndUpdate( const Acts::Vector3& direction = ray.dir(); // norm to z-axis and to the ray Acts::Vector3 norm{-1. * direction[1], 1. * direction[0], 0}; - Acts::ActsScalar norm_size = norm.norm(); + double norm_size = norm.norm(); - Acts::ActsScalar tanTheta = norm_size / direction[2]; + double tanTheta = norm_size / direction[2]; if (std::abs(tanTheta) < std::tan(m_cfg.minTheta)) { return false; } // nearest distance from the ray to z-axis - Acts::ActsScalar dist = std::abs(startPoint.dot(norm)) / norm_size; + double dist = std::abs(startPoint.dot(norm)) / norm_size; if (dist > m_cfg.maxRPosition) { return false; } // z coordinate of the nearest distance from the ray to z-axis - Acts::ActsScalar zDist = + double zDist = direction.cross(norm).dot(startPoint) / (norm_size * norm_size); if (std::abs(zDist) > m_cfg.maxZPosition) { return false; @@ -388,7 +384,7 @@ bool Acts::SingleSeedVertexFinder::tripletValidationAndUpdate( } template -std::pair +std::pair Acts::SingleSeedVertexFinder::makePlaneFromTriplet( const Acts::SingleSeedVertexFinder::Triplet& triplet) { Acts::Vector3 a{triplet.a.x(), triplet.a.y(), triplet.a.z()}; @@ -399,7 +395,7 @@ Acts::SingleSeedVertexFinder::makePlaneFromTriplet( // vector (alpha,beta,gamma) normalized to unity for convenience Acts::Vector3 abg = ba.cross(ca).normalized(); - Acts::ActsScalar delta = -1. * abg.dot(a); + double delta = -1. * abg.dot(a); // plane (alpha*x + beta*y + gamma*z + delta = 0), split to {{alpha, beta, // gamma}, delta} for convenience @@ -423,8 +419,7 @@ Acts::SingleSeedVertexFinder::findClosestPointFromPlanes( Acts::Vector3 vtxPrev{m_cfg.rMaxFar, m_cfg.rMaxFar, m_cfg.maxAbsZ}; // (alpha-beta-gamma, delta), distance - std::vector< - std::pair, Acts::ActsScalar>> + std::vector, double>> tripletsWithPlanes; tripletsWithPlanes.reserve(triplets.size()); @@ -462,7 +457,7 @@ Acts::SingleSeedVertexFinder::findClosestPointFromPlanes( for (auto& triplet : tripletsWithPlanes) { const auto& abg = triplet.first.first; const auto& delta = triplet.first.second; - Acts::ActsScalar distance = std::abs(abg.dot(vtx) + delta); + double distance = std::abs(abg.dot(vtx) + delta); triplet.second = distance; } @@ -527,8 +522,7 @@ Acts::SingleSeedVertexFinder::findClosestPointFromRays( Acts::Vector3 vtxPrev{m_cfg.rMaxFar, m_cfg.rMaxFar, m_cfg.maxAbsZ}; // (startPoint, direction), distance - std::vector< - std::pair, Acts::ActsScalar>> + std::vector, double>> tripletsWithRays; tripletsWithRays.reserve(triplets.size()); @@ -568,7 +562,7 @@ Acts::SingleSeedVertexFinder::findClosestPointFromRays( for (auto& triplet : tripletsWithRays) { const auto& startPoint = triplet.first.first; const auto& direction = triplet.first.second; - Acts::ActsScalar distance = (vtx - startPoint).cross(direction).norm(); + double distance = (vtx - startPoint).cross(direction).norm(); triplet.second = distance; } diff --git a/Core/include/Acts/Vertexing/Vertex.hpp b/Core/include/Acts/Vertexing/Vertex.hpp index d656c7a199f..453fe34a9e0 100644 --- a/Core/include/Acts/Vertexing/Vertex.hpp +++ b/Core/include/Acts/Vertexing/Vertex.hpp @@ -50,7 +50,7 @@ class Vertex { Vector3 position() const; /// @return Returns time - ActsScalar time() const; + double time() const; /// @return Returns 4-position const Vector4& fullPosition() const; @@ -86,7 +86,7 @@ class Vertex { /// @brief Sets time /// /// @param time The time - void setTime(ActsScalar time); + void setTime(double time); /// @brief Sets 3x3 covariance /// diff --git a/Core/src/Detector/IndexedRootVolumeFinderBuilder.cpp b/Core/src/Detector/IndexedRootVolumeFinderBuilder.cpp index 0493750b9a3..ae1bee83e5d 100644 --- a/Core/src/Detector/IndexedRootVolumeFinderBuilder.cpp +++ b/Core/src/Detector/IndexedRootVolumeFinderBuilder.cpp @@ -21,15 +21,15 @@ void fillGridIndices2D( const Acts::GeometryContext& gctx, Grid2D& grid, const std::vector>& rootVolumes, - const std::array, 2u>& boundaries, + const std::array, 2u>& boundaries, const std::array& casts) { // Brute force loop over all bins & all volumes for (const auto [ic0, c0] : Acts::enumerate(boundaries[0u])) { if (ic0 > 0) { - Acts::ActsScalar v0 = 0.5 * (c0 + boundaries[0u][ic0 - 1]); + double v0 = 0.5 * (c0 + boundaries[0u][ic0 - 1]); for (const auto [ic1, c1] : Acts::enumerate(boundaries[1u])) { if (ic1 > 0) { - Acts::ActsScalar v1 = 0.5 * (c1 + boundaries[1u][ic1 - 1]); + double v1 = 0.5 * (c1 + boundaries[1u][ic1 - 1]); if (casts == std::array{Acts::BinningValue::binZ, Acts::BinningValue::binR}) { @@ -74,8 +74,7 @@ Acts::Experimental::IndexedRootVolumeFinderBuilder::construct( auto casts = std::array{m_casts[0u], m_casts[1u]}; - auto boundaries = - std::array, 2u>{rzphis[1], rzphis[0]}; + auto boundaries = std::array, 2u>{rzphis[1], rzphis[0]}; fillGridIndices2D(gctx, grid, rootVolumes, boundaries, casts); using IndexedDetectorVolumesImpl = diff --git a/Core/src/Detector/LayerStructureBuilder.cpp b/Core/src/Detector/LayerStructureBuilder.cpp index 94766a80d0d..76092582eea 100644 --- a/Core/src/Detector/LayerStructureBuilder.cpp +++ b/Core/src/Detector/LayerStructureBuilder.cpp @@ -48,8 +48,8 @@ void adaptBinningRange(std::vector& pBinning, const Acts::Extent& extent) { for (auto& pb : pBinning) { // Starting values - Acts::ActsScalar vmin = pb.edges.front(); - Acts::ActsScalar vmax = pb.edges.back(); + double vmin = pb.edges.front(); + double vmax = pb.edges.back(); // Get the number of bins std::size_t nBins = pb.bins(); // Check if extent overwrites that @@ -61,7 +61,7 @@ void adaptBinningRange(std::vector& pBinning, } // Possibly update the edges if (pb.axisType == Acts::AxisType::Equidistant) { - Acts::ActsScalar binWidth = (vmax - vmin) / nBins; + double binWidth = (vmax - vmin) / nBins; // Fill the edges pb.edges = {vmin}; pb.edges.resize(nBins + 1); diff --git a/Core/src/Detector/ProtoDetector.cpp b/Core/src/Detector/ProtoDetector.cpp index e305dc9052c..a1ec0009c57 100644 --- a/Core/src/Detector/ProtoDetector.cpp +++ b/Core/src/Detector/ProtoDetector.cpp @@ -99,13 +99,13 @@ void Acts::ProtoVolume::harmonize(bool legacy) { borders.push_back(static_cast(fVolume.extent.min(binValue))); for (unsigned int iv = 1; iv < cts.constituentVolumes.size(); ++iv) { auto& lv = cts.constituentVolumes[iv - 1u]; - ActsScalar zero = lv.extent.min(binValue); - ActsScalar low = lv.extent.max(binValue); + double zero = lv.extent.min(binValue); + double low = lv.extent.max(binValue); auto& hv = cts.constituentVolumes[iv]; - ActsScalar high = hv.extent.min(binValue); - ActsScalar mid = 0.5 * (low + high); - ActsScalar max = hv.extent.max(binValue); + double high = hv.extent.min(binValue); + double mid = 0.5 * (low + high); + double max = hv.extent.max(binValue); lv.extent.set(binValue, zero, mid); hv.extent.set(binValue, mid, max); borders.push_back(mid); @@ -118,7 +118,7 @@ void Acts::ProtoVolume::harmonize(bool legacy) { std::vector boundaries = {}; // New container vector std::vector updatedConstituents; - ActsScalar containerMin = extent.min(binValue); + double containerMin = extent.min(binValue); if (fVolume.extent.min(binValue) > containerMin) { ProtoVolume gap; gap.name = name + "-gap-" + std::to_string(gaps++); @@ -133,9 +133,9 @@ void Acts::ProtoVolume::harmonize(bool legacy) { updatedConstituents.push_back(lv); borders.push_back(static_cast(lv.extent.min(binValue))); // check if a gap to the next is needed - ActsScalar low = lv.extent.max(binValue); + double low = lv.extent.max(binValue); auto& hv = cts.constituentVolumes[iv]; - ActsScalar high = hv.extent.min(binValue); + double high = hv.extent.min(binValue); if (high > low) { ProtoVolume gap; gap.name = name + "-gap-" + std::to_string(gaps++); @@ -144,11 +144,11 @@ void Acts::ProtoVolume::harmonize(bool legacy) { borders.push_back(static_cast(low)); } } - ActsScalar constituentsMax = lVolume.extent.max(binValue); + double constituentsMax = lVolume.extent.max(binValue); updatedConstituents.push_back(lVolume); borders.push_back(static_cast(constituentsMax)); // Check the container min/max setting - ActsScalar containerMax = extent.max(binValue); + double containerMax = extent.max(binValue); if (constituentsMax < containerMax) { ProtoVolume gap; gap.name = name + "-gap-" + std::to_string(gaps++); diff --git a/Core/src/Detector/VolumeStructureBuilder.cpp b/Core/src/Detector/VolumeStructureBuilder.cpp index e63a13d5039..e47263fe3df 100644 --- a/Core/src/Detector/VolumeStructureBuilder.cpp +++ b/Core/src/Detector/VolumeStructureBuilder.cpp @@ -50,7 +50,7 @@ Acts::Experimental::VolumeStructureBuilder::construct( // The transform from the extent auto eTransform = Transform3::Identity(); - std::vector boundValues = m_cfg.boundValues; + std::vector boundValues = m_cfg.boundValues; // This code dispatches into the dedicated volume types switch (m_cfg.boundsType) { @@ -64,8 +64,8 @@ Acts::Experimental::VolumeStructureBuilder::construct( "object. It needs at least 5 parameters, while " + std::to_string(boundValues.size()) + " where given"); } - auto bArray = toArray( - boundValues); + auto bArray = + toArray(boundValues); volumeBounds = std::make_unique(bArray); } break; case VolumeBounds::BoundsType::eCuboid: { @@ -144,7 +144,7 @@ Acts::Experimental::VolumeStructureBuilder::construct( } // Check if phi has been constraint, otherwise fill it with full coverage if (boundValues.size() == 3u) { - boundValues.push_back(std::numbers::pi_v); + boundValues.push_back(std::numbers::pi_v); boundValues.push_back(0.); } ACTS_VERBOSE(" - cylindrical shape with [iR, oR, hZ, sPhi, mPhi] = " diff --git a/Core/src/Detector/detail/BlueprintHelper.cpp b/Core/src/Detector/detail/BlueprintHelper.cpp index bf440c61acc..b0167188021 100644 --- a/Core/src/Detector/detail/BlueprintHelper.cpp +++ b/Core/src/Detector/detail/BlueprintHelper.cpp @@ -122,7 +122,7 @@ void Acts::Experimental::detail::BlueprintHelper::fillGapsCylindrical( unsigned int igap = 0; for (auto& child : node.children) { auto [neg, pos] = endPointsXYZ(*child, bVal); - ActsScalar gapSpan = (neg - negC).norm(); + double gapSpan = (neg - negC).norm(); if (gapSpan > s_onSurfaceTolerance) { // Fill a gap node auto gapName = node.name + "_gap_" + std::to_string(igap); @@ -131,7 +131,7 @@ void Acts::Experimental::detail::BlueprintHelper::fillGapsCylindrical( gapTransform.pretranslate(0.5 * (neg + negC)); auto gap = std::make_unique( gapName, gapTransform, VolumeBounds::eCylinder, - std::vector{cInnerR, cOuterR, 0.5 * gapSpan}); + std::vector{cInnerR, cOuterR, 0.5 * gapSpan}); gaps.push_back(std::move(gap)); ++igap; } @@ -139,7 +139,7 @@ void Acts::Experimental::detail::BlueprintHelper::fillGapsCylindrical( negC = pos; } // Check if a last one needs to be filled - ActsScalar gapSpan = (negC - posC).norm(); + double gapSpan = (negC - posC).norm(); if (gapSpan > s_onSurfaceTolerance) { // Fill a gap node auto gapName = node.name + "_gap_" + std::to_string(igap); @@ -148,7 +148,7 @@ void Acts::Experimental::detail::BlueprintHelper::fillGapsCylindrical( gapTransform.pretranslate(0.5 * (negC + posC)); auto gap = std::make_unique( gapName, gapTransform, VolumeBounds::eCylinder, - std::vector{cInnerR, cOuterR, 0.5 * gapSpan}); + std::vector{cInnerR, cOuterR, 0.5 * gapSpan}); gaps.push_back(std::move(gap)); } @@ -163,14 +163,13 @@ void Acts::Experimental::detail::BlueprintHelper::fillGapsCylindrical( } // Fill the gaps in R unsigned int igap = 0; - ActsScalar lastR = cInnerR; + double lastR = cInnerR; for (auto& child : node.children) { - ActsScalar iR = child->boundaryValues[0]; + double iR = child->boundaryValues[0]; if (std::abs(iR - lastR) > s_onSurfaceTolerance) { auto gap = std::make_unique( node.name + "_gap_" + std::to_string(igap), node.transform, - VolumeBounds::eCylinder, - std::vector{lastR, iR, cHalfZ}); + VolumeBounds::eCylinder, std::vector{lastR, iR, cHalfZ}); gaps.push_back(std::move(gap)); ++igap; } @@ -181,8 +180,7 @@ void Acts::Experimental::detail::BlueprintHelper::fillGapsCylindrical( if (std::abs(lastR - cOuterR) > s_onSurfaceTolerance) { auto gap = std::make_unique( node.name + "_gap_" + std::to_string(igap), node.transform, - VolumeBounds::eCylinder, - std::vector{lastR, cOuterR, cHalfZ}); + VolumeBounds::eCylinder, std::vector{lastR, cOuterR, cHalfZ}); gaps.push_back(std::move(gap)); } } else { @@ -237,14 +235,14 @@ void Acts::Experimental::detail::BlueprintHelper::fillGapsCuboidal( unsigned int igap = 0; for (auto& child : node.children) { auto [neg, pos] = endPointsXYZ(*child, binVal); - ActsScalar gapSpan = (neg - negC).norm(); + double gapSpan = (neg - negC).norm(); if (gapSpan > s_onSurfaceTolerance) { // Fill a gap node auto gapName = node.name + "_gap_" + std::to_string(igap); auto gapTransform = Transform3::Identity(); gapTransform.rotate(node.transform.rotation()); gapTransform.pretranslate(0.5 * (neg + negC)); - std::vector gapBounds{0, 0, 0}; + std::vector gapBounds{0, 0, 0}; gapBounds[toUnderlying(binVal)] = 0.5 * gapSpan; for (auto bv : allowedBinVals) { if (bv != binVal) { @@ -260,14 +258,14 @@ void Acts::Experimental::detail::BlueprintHelper::fillGapsCuboidal( negC = pos; } // Check if a last one needs to be filled - ActsScalar gapSpan = (negC - posC).norm(); + double gapSpan = (negC - posC).norm(); if (gapSpan > s_onSurfaceTolerance) { // Fill a gap node auto gapName = node.name + "_gap_" + std::to_string(igap); auto gapTransform = Transform3::Identity(); gapTransform.rotate(node.transform.rotation()); gapTransform.pretranslate(0.5 * (negC + posC)); - std::vector gapBounds{0, 0, 0}; + std::vector gapBounds{0, 0, 0}; gapBounds[toUnderlying(binVal)] = 0.5 * gapSpan; for (auto bv : allowedBinVals) { if (bv != binVal) { diff --git a/Core/src/Detector/detail/CuboidalDetectorHelper.cpp b/Core/src/Detector/detail/CuboidalDetectorHelper.cpp index ac2acd2482a..cda12f02de2 100644 --- a/Core/src/Detector/detail/CuboidalDetectorHelper.cpp +++ b/Core/src/Detector/detail/CuboidalDetectorHelper.cpp @@ -53,8 +53,8 @@ Acts::Experimental::detail::CuboidalDetectorHelper::connect( auto [sIndex, fIndex] = portalSets[toUnderlying(bValue)]; // Log the merge splits, i.e. the boundaries of the volumes - std::array, 3u> mergeSplits; - std::array mergeHalfLengths = { + std::array, 3u> mergeSplits; + std::array mergeHalfLengths = { 0., 0., 0., @@ -72,7 +72,7 @@ Acts::Experimental::detail::CuboidalDetectorHelper::connect( // Things that can be done without a loop be first/last check // Estimate the merge parameters: the scalar and the transform - using MergeParameters = std::tuple; + using MergeParameters = std::tuple; std::map mergeParameters; auto& firstVolume = volumes.front(); auto& lastVolume = volumes.back(); @@ -93,8 +93,8 @@ Acts::Experimental::detail::CuboidalDetectorHelper::connect( ->surface() .transform(gctx) .rotation(); - ActsScalar stepDown = firstBoundValues[toUnderlying(bValue)]; - ActsScalar stepUp = lastBoundValues[toUnderlying(bValue)]; + double stepDown = firstBoundValues[toUnderlying(bValue)]; + double stepUp = lastBoundValues[toUnderlying(bValue)]; // Take translation from first and last volume auto translationF = firstVolume->portalPtrs()[index] ->surface() @@ -113,7 +113,7 @@ Acts::Experimental::detail::CuboidalDetectorHelper::connect( portalTransform.prerotate(rotation); portalTransform.pretranslate(translation); // The half length to be kept - ActsScalar keepHalfLength = + double keepHalfLength = firstBoundValues[toUnderlying(counterPart(mergeValue))]; mergeParameters[index] = MergeParameters(keepHalfLength, portalTransform); } @@ -183,7 +183,7 @@ Acts::Experimental::detail::CuboidalDetectorHelper::connect( } // The stitch boundaries for portal pointing - std::vector stitchBoundaries; + std::vector stitchBoundaries; stitchBoundaries.push_back(-mergeHalfLengths[im]); for (auto step : mergeSplits[im]) { stitchBoundaries.push_back(stitchBoundaries.back() + step); @@ -322,7 +322,7 @@ Acts::Experimental::detail::CuboidalDetectorHelper::connect( return dShell; } -std::array, 3u> +std::array, 3u> Acts::Experimental::detail::CuboidalDetectorHelper::xyzBoundaries( [[maybe_unused]] const GeometryContext& gctx, [[maybe_unused]] const std::vector< @@ -332,16 +332,16 @@ Acts::Experimental::detail::CuboidalDetectorHelper::xyzBoundaries( ACTS_LOCAL_LOGGER(getDefaultLogger("CuboidalDetectorHelper", logLevel)); // The return boundaries - std::array, 3u> boundaries; + std::array, 3u> boundaries; // The map for collecting - std::array, 3u> valueMaps; + std::array, 3u> valueMaps; auto& xMap = valueMaps[0u]; auto& yMap = valueMaps[1u]; auto& zMap = valueMaps[2u]; - auto fillMap = [&](std::map& map, - const std::array& values) { + auto fillMap = [&](std::map& map, + const std::array& values) { for (auto v : values) { // This will insert v with a value of 0 if it doesn't exist ++map[v]; @@ -353,18 +353,18 @@ Acts::Experimental::detail::CuboidalDetectorHelper::xyzBoundaries( if (v->volumeBounds().type() == Acts::VolumeBounds::BoundsType::eCuboid) { auto bValues = v->volumeBounds().values(); // The min/max values - ActsScalar halfX = bValues[CuboidVolumeBounds::BoundValues::eHalfLengthX]; - ActsScalar halfY = bValues[CuboidVolumeBounds::BoundValues::eHalfLengthY]; - ActsScalar halfZ = bValues[CuboidVolumeBounds::BoundValues::eHalfLengthZ]; + double halfX = bValues[CuboidVolumeBounds::BoundValues::eHalfLengthX]; + double halfY = bValues[CuboidVolumeBounds::BoundValues::eHalfLengthY]; + double halfZ = bValues[CuboidVolumeBounds::BoundValues::eHalfLengthZ]; // Get the transform @todo use a center of gravity of the detector auto translation = v->transform(gctx).translation(); // The min/max values - ActsScalar xMin = translation.x() - halfX; - ActsScalar xMax = translation.x() + halfX; - ActsScalar yMin = translation.y() - halfY; - ActsScalar yMax = translation.y() + halfY; - ActsScalar zMin = translation.z() - halfZ; - ActsScalar zMax = translation.z() + halfZ; + double xMin = translation.x() - halfX; + double xMax = translation.x() + halfX; + double yMin = translation.y() - halfY; + double yMax = translation.y() + halfY; + double zMin = translation.z() - halfZ; + double zMax = translation.z() + halfZ; // Fill the maps fillMap(xMap, {xMin, xMax}); fillMap(yMap, {yMin, yMax}); diff --git a/Core/src/Detector/detail/CylindricalDetectorHelper.cpp b/Core/src/Detector/detail/CylindricalDetectorHelper.cpp index 499d28c0785..545e0947797 100644 --- a/Core/src/Detector/detail/CylindricalDetectorHelper.cpp +++ b/Core/src/Detector/detail/CylindricalDetectorHelper.cpp @@ -80,9 +80,8 @@ namespace { /// /// @return a new portal replacement object Acts::Experimental::PortalReplacement createDiscReplacement( - const Acts::Transform3& transform, - const std::vector& rBoundaries, - const std::vector& phiBoundaries, unsigned int index, + const Acts::Transform3& transform, const std::vector& rBoundaries, + const std::vector& phiBoundaries, unsigned int index, Acts::Direction dir) { // Autodetector stitch value Acts::BinningValue stitchValue = phiBoundaries.size() == 2u @@ -117,9 +116,9 @@ Acts::Experimental::PortalReplacement createDiscReplacement( /// /// @return a new portal replacement object Acts::Experimental::PortalReplacement createCylinderReplacement( - const Acts::Transform3& transform, Acts::ActsScalar r, - const std::vector& zBoundaries, - const std::vector& phiBoundaries, unsigned int index, + const Acts::Transform3& transform, double r, + const std::vector& zBoundaries, + const std::vector& phiBoundaries, unsigned int index, Acts::Direction dir) { // Autodetector stitch value Acts::BinningValue stitchValue = phiBoundaries.size() == 2u @@ -155,9 +154,8 @@ Acts::Experimental::PortalReplacement createCylinderReplacement( /// @return a new portal replacement object Acts::Experimental::PortalReplacement createSectorReplacement( const Acts::GeometryContext& gctx, const Acts::Vector3& volumeCenter, - const Acts::Surface& refSurface, - const std::vector& boundaries, Acts::BinningValue binning, - unsigned int index, Acts::Direction dir) { + const Acts::Surface& refSurface, const std::vector& boundaries, + Acts::BinningValue binning, unsigned int index, Acts::Direction dir) { // Get a reference transform const auto& refTransform = refSurface.transform(gctx); auto refRotation = refTransform.rotation(); @@ -176,7 +174,7 @@ Acts::Experimental::PortalReplacement createSectorReplacement( Acts::Vector3 pCenter = volumeCenter + medium * refRotation.col(1u); transform.pretranslate(pCenter); // Create the halflength - Acts::ActsScalar halfX = + double halfX = 0.5 * (boundValues[Acts::RectangleBounds::BoundValues::eMaxX] - boundValues[Acts::RectangleBounds::BoundValues::eMinX]); // New joint bounds @@ -187,12 +185,12 @@ Acts::Experimental::PortalReplacement createSectorReplacement( // Center R calculation, using projection onto vector const auto& surfaceCenter = refSurface.center(gctx); Acts::Vector3 centerDiffs = (surfaceCenter - volumeCenter); - Acts::ActsScalar centerR = centerDiffs.dot(refRotation.col(2)); + double centerR = centerDiffs.dot(refRotation.col(2)); // New joint center Acts::Vector3 pCenter = volumeCenter + centerR * refRotation.col(2); transform.pretranslate(pCenter); // New joint bounds - Acts::ActsScalar halfY = + double halfY = 0.5 * (boundValues[Acts::RectangleBounds::BoundValues::eMaxY] - boundValues[Acts::RectangleBounds::BoundValues::eMinY]); bounds = std::make_unique(0.5 * range, halfY); @@ -318,7 +316,7 @@ Acts::Experimental::detail::CylindricalDetectorHelper::connectInR( DetectorComponent::PortalContainer dShell; // Innermost volume boundaries - std::vector rBoundaries = {}; + std::vector rBoundaries = {}; auto refValues = volumes[0u]->volumeBounds().values(); // Reference boundary values @@ -329,9 +327,9 @@ Acts::Experimental::detail::CylindricalDetectorHelper::connectInR( bool connectR = selectedOnly.empty() || rangeContainsValue(selectedOnly, 2u); // Get phi sector and average phi - ActsScalar phiSector = + double phiSector = refValues[CylinderVolumeBounds::BoundValues::eHalfPhiSector]; - ActsScalar avgPhi = refValues[CylinderVolumeBounds::BoundValues::eAveragePhi]; + double avgPhi = refValues[CylinderVolumeBounds::BoundValues::eAveragePhi]; // Fuse the cylinders for (unsigned int iv = 1; iv < volumes.size(); ++iv) { @@ -481,7 +479,7 @@ Acts::Experimental::detail::CylindricalDetectorHelper::connectInZ( auto addZboundary3D = [&](const Experimental::DetectorVolume& volume, int side) -> void { const auto boundValues = volume.volumeBounds().values(); - ActsScalar halflengthZ = + double halflengthZ = boundValues[CylinderVolumeBounds::BoundValues::eHalfLengthZ]; zBoundaries3D.push_back(volume.transform(gctx).translation() + side * halflengthZ * rotation.col(2)); @@ -534,11 +532,10 @@ Acts::Experimental::detail::CylindricalDetectorHelper::connectInZ( << toString(combinedCenter)); // Evaluate the series of z boundaries - std::vector zBoundaries = {}; + std::vector zBoundaries = {}; for (const auto& zb3D : zBoundaries3D) { auto proj3D = (zb3D - combinedCenter).dot(rotation.col(2)); - ActsScalar zBoundary = - std::copysign((zb3D - combinedCenter).norm(), proj3D); + double zBoundary = std::copysign((zb3D - combinedCenter).norm(), proj3D); zBoundaries.push_back(zBoundary); } @@ -551,11 +548,11 @@ Acts::Experimental::detail::CylindricalDetectorHelper::connectInZ( const auto refValues = refVolume->volumeBounds().values(); // Get phi sector and average phi - ActsScalar minR = refValues[CylinderVolumeBounds::BoundValues::eMinR]; - ActsScalar maxR = refValues[CylinderVolumeBounds::BoundValues::eMaxR]; - ActsScalar phiSector = + double minR = refValues[CylinderVolumeBounds::BoundValues::eMinR]; + double maxR = refValues[CylinderVolumeBounds::BoundValues::eMaxR]; + double phiSector = refValues[CylinderVolumeBounds::BoundValues::eHalfPhiSector]; - ActsScalar avgPhi = refValues[CylinderVolumeBounds::BoundValues::eAveragePhi]; + double avgPhi = refValues[CylinderVolumeBounds::BoundValues::eAveragePhi]; // Check if inner cylinder and sectors are present by the number of portals std::size_t nPortals = volumes[volumes.size() - 1u]->portals().size(); @@ -569,7 +566,7 @@ Acts::Experimental::detail::CylindricalDetectorHelper::connectInZ( // Disc assignments are forward for negative disc, backward for positive std::vector cylinderDirs = {Acts::Direction::Backward}; // Cylinder radii - std::vector cylinderR = {maxR}; + std::vector cylinderR = {maxR}; if (innerPresent) { ACTS_VERBOSE("Inner surface present, tube geometry detected."); cylinderDirs.push_back(Direction::Forward); @@ -657,7 +654,7 @@ Acts::Experimental::detail::CylindricalDetectorHelper::connectInPhi( // Sector offset unsigned int iSecOffset = innerPresent ? 4u : 3u; - std::vector phiBoundaries = {}; + std::vector phiBoundaries = {}; auto refValues = volumes[0u]->volumeBounds().values(); phiBoundaries.push_back( refValues[CylinderVolumeBounds::BoundValues::eAveragePhi] - @@ -679,10 +676,10 @@ Acts::Experimental::detail::CylindricalDetectorHelper::connectInPhi( // The current values auto curValues = volumes[iv]->volumeBounds().values(); // Bail out if they do not match - ActsScalar lowPhi = + double lowPhi = curValues[CylinderVolumeBounds::BoundValues::eAveragePhi] - curValues[CylinderVolumeBounds::BoundValues::eHalfPhiSector]; - ActsScalar highPhi = + double highPhi = curValues[CylinderVolumeBounds::BoundValues::eAveragePhi] + curValues[CylinderVolumeBounds::BoundValues::eHalfPhiSector]; // Check phi attachment @@ -816,12 +813,11 @@ Acts::Experimental::detail::CylindricalDetectorHelper::wrapInZR( "cylinder volume."); } // We need a new cylinder spanning over the entire inner tube - ActsScalar hlZ = cylVolBounds->get( + double hlZ = cylVolBounds->get( Acts::CylinderVolumeBounds::BoundValues::eHalfLengthZ); - ActsScalar HlZ = ccylVolBounds->get( + double HlZ = ccylVolBounds->get( Acts::CutoutCylinderVolumeBounds::BoundValues::eHalfLengthZ); - ActsScalar innerR = - cylVolBounds->get(CylinderVolumeBounds::BoundValues::eMinR); + double innerR = cylVolBounds->get(CylinderVolumeBounds::BoundValues::eMinR); // Create the inner replacement std::vector pReplacements; pReplacements.push_back(createCylinderReplacement( @@ -1112,17 +1108,15 @@ Acts::Experimental::detail::CylindricalDetectorHelper::wrapInZR( // Inner Container portal auto& centralSegment = innerContainer[3u]; auto centralValues = centralSegment->surface().bounds().values(); - ActsScalar centralHalfLengthZ = + double centralHalfLengthZ = centralValues[CylinderBounds::BoundValues::eHalfLengthZ]; // The two segments auto& nSegment = wrappingVolume->portalPtrs()[6u]; auto nValues = nSegment->surface().bounds().values(); - ActsScalar nHalfLengthZ = - nValues[CylinderBounds::BoundValues::eHalfLengthZ]; + double nHalfLengthZ = nValues[CylinderBounds::BoundValues::eHalfLengthZ]; auto& pSegment = wrappingVolume->portalPtrs()[7u]; auto pValues = pSegment->surface().bounds().values(); - ActsScalar pHalfLengthZ = - pValues[CylinderBounds::BoundValues::eHalfLengthZ]; + double pHalfLengthZ = pValues[CylinderBounds::BoundValues::eHalfLengthZ]; auto sideVolumes = PortalHelper::stripSideVolumes({innerContainer}, {3u}, {3u}, logLevel); @@ -1131,8 +1125,8 @@ Acts::Experimental::detail::CylindricalDetectorHelper::wrapInZR( std::vector> innerVolumes = { wrappingVolume->getSharedPtr()}; - std::vector zBoundaries = { - -centralHalfLengthZ - 2 * nHalfLengthZ, centralHalfLengthZ}; + std::vector zBoundaries = {-centralHalfLengthZ - 2 * nHalfLengthZ, + centralHalfLengthZ}; // Loop over side volume and register the z boundaries for (auto& svs : sideVolumes) { for (auto& v : svs.second) { @@ -1142,7 +1136,7 @@ Acts::Experimental::detail::CylindricalDetectorHelper::wrapInZR( throw std::invalid_argument( "CylindricalDetectorHelper: side volume must be a cylinder."); } - ActsScalar hlZ = + double hlZ = cylVolBounds->get(CylinderVolumeBounds::BoundValues::eHalfLengthZ); zBoundaries.push_back(zBoundaries.back() + 2 * hlZ); innerVolumes.push_back(v); diff --git a/Core/src/Detector/detail/DetectorVolumeConsistency.cpp b/Core/src/Detector/detail/DetectorVolumeConsistency.cpp index 1d9cae71402..999fe5fe6a8 100644 --- a/Core/src/Detector/detail/DetectorVolumeConsistency.cpp +++ b/Core/src/Detector/detail/DetectorVolumeConsistency.cpp @@ -35,12 +35,12 @@ void Acts::Experimental::detail::DetectorVolumeConsistency:: } } -std::vector +std::vector Acts::Experimental::detail::DetectorVolumeConsistency::checkCenterAlignment( const GeometryContext& gctx, const std::vector>& volumes, BinningValue axisValue) { - std::vector distances = {}; + std::vector distances = {}; // First it needs to surfive the rotation check checkRotationAlignment(gctx, volumes); diff --git a/Core/src/Detector/detail/PortalHelper.cpp b/Core/src/Detector/detail/PortalHelper.cpp index 72d4d8ac7f1..a24b74308cf 100644 --- a/Core/src/Detector/detail/PortalHelper.cpp +++ b/Core/src/Detector/detail/PortalHelper.cpp @@ -35,7 +35,7 @@ void Acts::Experimental::detail::PortalHelper::attachExternalNavigationDelegate( void Acts::Experimental::detail::PortalHelper::attachDetectorVolumesUpdater( const GeometryContext& gctx, Portal& portal, const std::vector>& volumes, - const Direction& direction, const std::vector& boundaries, + const Direction& direction, const std::vector& boundaries, const BinningValue& binning) { // Check if the boundaries need a transform const auto pTransform = portal.surface().transform(gctx); diff --git a/Core/src/Detector/detail/SupportSurfacesHelper.cpp b/Core/src/Detector/detail/SupportSurfacesHelper.cpp index 62916abe39c..c992b0f7d95 100644 --- a/Core/src/Detector/detail/SupportSurfacesHelper.cpp +++ b/Core/src/Detector/detail/SupportSurfacesHelper.cpp @@ -36,17 +36,17 @@ operator()(const Extent& lExtent) const { } // Min / Max z with clearances adapted - ActsScalar minZ = lExtent.min(BinningValue::binZ) + std::abs(zClearance[0u]); - ActsScalar maxZ = lExtent.max(BinningValue::binZ) - std::abs(zClearance[1u]); + double minZ = lExtent.min(BinningValue::binZ) + std::abs(zClearance[0u]); + double maxZ = lExtent.max(BinningValue::binZ) - std::abs(zClearance[1u]); // Phi sector - ActsScalar hPhiSector = std::numbers::pi_v; - ActsScalar avgPhi = 0.; + double hPhiSector = std::numbers::pi_v; + double avgPhi = 0.; if (lExtent.constrains(BinningValue::binPhi)) { // Min / Max phi with clearances adapted - ActsScalar minPhi = + double minPhi = lExtent.min(BinningValue::binPhi) + std::abs(phiClearance[0u]); - ActsScalar maxPhi = + double maxPhi = lExtent.max(BinningValue::binPhi) - std::abs(phiClearance[1u]); hPhiSector = 0.5 * (maxPhi - minPhi); avgPhi = 0.5 * (minPhi + maxPhi); @@ -58,8 +58,8 @@ operator()(const Extent& lExtent) const { } // The Radius estimation - ActsScalar r = rOffset < 0 ? lExtent.min(BinningValue::binR) + rOffset - : lExtent.max(BinningValue::binR) + rOffset; + double r = rOffset < 0 ? lExtent.min(BinningValue::binR) + rOffset + : lExtent.max(BinningValue::binR) + rOffset; if (rOffset == 0.) { r = lExtent.medium(BinningValue::binR); } @@ -80,25 +80,25 @@ Acts::Experimental::detail::SupportSurfacesHelper::DiscSupport::operator()( } // Min / Max r with clearances adapted - ActsScalar minR = lExtent.min(BinningValue::binR) + std::abs(rClearance[0u]); - ActsScalar maxR = lExtent.max(BinningValue::binR) - std::abs(rClearance[1u]); + double minR = lExtent.min(BinningValue::binR) + std::abs(rClearance[0u]); + double maxR = lExtent.max(BinningValue::binR) - std::abs(rClearance[1u]); // Phi sector - ActsScalar hPhiSector = std::numbers::pi_v; - ActsScalar avgPhi = 0.; + double hPhiSector = std::numbers::pi_v; + double avgPhi = 0.; if (lExtent.constrains(BinningValue::binPhi)) { // Min / Max phi with clearances adapted - ActsScalar minPhi = + double minPhi = lExtent.min(BinningValue::binPhi) + std::abs(phiClearance[0u]); - ActsScalar maxPhi = + double maxPhi = lExtent.max(BinningValue::binPhi) - std::abs(phiClearance[1u]); hPhiSector = 0.5 * (maxPhi - minPhi); avgPhi = 0.5 * (minPhi + maxPhi); } // The z position estimate - ActsScalar z = zOffset < 0 ? lExtent.min(BinningValue::binZ) + zOffset - : lExtent.max(BinningValue::binZ) + zOffset; + double z = zOffset < 0 ? lExtent.min(BinningValue::binZ) + zOffset + : lExtent.max(BinningValue::binZ) + zOffset; if (zOffset == 0.) { z = lExtent.medium(BinningValue::binZ); } @@ -131,12 +131,12 @@ operator()(const Extent& lExtent) const { } // Make the rectangular shape - ActsScalar minX = lExtent.min(locals[0]) + std::abs(loc0Clearance[0u]); - ActsScalar maxX = lExtent.max(locals[0]) - std::abs(loc0Clearance[1u]); - ActsScalar minY = lExtent.min(locals[1]) + std::abs(loc1Clearance[0u]); - ActsScalar maxY = lExtent.max(locals[1]) - std::abs(loc1Clearance[1u]); + double minX = lExtent.min(locals[0]) + std::abs(loc0Clearance[0u]); + double maxX = lExtent.max(locals[0]) - std::abs(loc0Clearance[1u]); + double minY = lExtent.min(locals[1]) + std::abs(loc1Clearance[0u]); + double maxY = lExtent.max(locals[1]) - std::abs(loc1Clearance[1u]); - ActsScalar gPlacement = lExtent.medium(pPlacement) + pOffset; + double gPlacement = lExtent.medium(pPlacement) + pOffset; Vector3 placement = Vector3::Zero(); placement[toUnderlying(pPlacement)] = gPlacement; @@ -166,7 +166,7 @@ Acts::Experimental::detail::SupportSurfacesHelper::cylindricalSupport( "surface type is not a cylinder."); } - std::array bounds = {}; + std::array bounds = {}; std::copy_n(values.begin(), 6u, bounds.begin()); // Return vector for generated surfaces @@ -177,28 +177,27 @@ Acts::Experimental::detail::SupportSurfacesHelper::cylindricalSupport( transform, std::make_shared(bounds))); } else { // Split into n(splits) planar surfaces, prep work: - ActsScalar r = bounds[0u]; - ActsScalar halfZ = bounds[1u]; - ActsScalar minPhi = bounds[3u] - bounds[2u]; - ActsScalar maxPhi = bounds[3u] + bounds[2u]; - ActsScalar dHalfPhi = (maxPhi - minPhi) / (2 * splits); - ActsScalar cosPhiHalf = std::cos(dHalfPhi); - ActsScalar sinPhiHalf = std::sin(dHalfPhi); - ActsScalar planeR = r * cosPhiHalf; - ActsScalar planeHalfX = r * sinPhiHalf; - ActsScalar planeZ = transform.translation().z(); + double r = bounds[0u]; + double halfZ = bounds[1u]; + double minPhi = bounds[3u] - bounds[2u]; + double maxPhi = bounds[3u] + bounds[2u]; + double dHalfPhi = (maxPhi - minPhi) / (2 * splits); + double cosPhiHalf = std::cos(dHalfPhi); + double sinPhiHalf = std::sin(dHalfPhi); + double planeR = r * cosPhiHalf; + double planeHalfX = r * sinPhiHalf; + double planeZ = transform.translation().z(); auto sRectangle = std::make_shared(planeHalfX, halfZ); // Now create the Trapezoids for (unsigned int iphi = 0; iphi < splits; ++iphi) { // Get the moduleTransform - ActsScalar phi = - -std::numbers::pi_v + (2 * iphi + 1) * dHalfPhi; - ActsScalar cosPhi = std::cos(phi); - ActsScalar sinPhi = std::sin(phi); - ActsScalar planeX = planeR * cosPhi; - ActsScalar planeY = planeR * sinPhi; + double phi = -std::numbers::pi_v + (2 * iphi + 1) * dHalfPhi; + double cosPhi = std::cos(phi); + double sinPhi = std::sin(phi); + double planeX = planeR * cosPhi; + double planeY = planeR * sinPhi; Acts::Vector3 planeCenter(planeX, planeY, planeZ); Acts::Vector3 planeAxisZ(cosPhi, sinPhi, 0.); @@ -241,7 +240,7 @@ Acts::Experimental::detail::SupportSurfacesHelper::discSupport( "surface type is not a disc."); } - std::array bounds = {}; + std::array bounds = {}; std::copy_n(values.begin(), 4u, bounds.begin()); // Return vector for generated surfaces @@ -252,33 +251,31 @@ Acts::Experimental::detail::SupportSurfacesHelper::discSupport( transform, std::make_shared(bounds))); } else { // Split into n(splits) planar surfaces in phi, prep work: - ActsScalar minR = bounds[0u]; - ActsScalar maxR = bounds[1u]; - ActsScalar minPhi = bounds[3u] - bounds[2u]; - ActsScalar maxPhi = bounds[3u] + bounds[2u]; - ActsScalar dHalfPhi = (maxPhi - minPhi) / (2 * splits); - ActsScalar cosPhiHalf = std::cos(dHalfPhi); - ActsScalar sinPhiHalf = std::sin(dHalfPhi); - ActsScalar maxLocY = maxR * cosPhiHalf; - ActsScalar minLocY = minR * cosPhiHalf; - ActsScalar hR = 0.5 * (maxLocY + minLocY); - ActsScalar hY = 0.5 * (maxLocY - minLocY); - ActsScalar hXminY = minR * sinPhiHalf; - ActsScalar hXmaxY = maxR * sinPhiHalf; + double minR = bounds[0u]; + double maxR = bounds[1u]; + double minPhi = bounds[3u] - bounds[2u]; + double maxPhi = bounds[3u] + bounds[2u]; + double dHalfPhi = (maxPhi - minPhi) / (2 * splits); + double cosPhiHalf = std::cos(dHalfPhi); + double sinPhiHalf = std::sin(dHalfPhi); + double maxLocY = maxR * cosPhiHalf; + double minLocY = minR * cosPhiHalf; + double hR = 0.5 * (maxLocY + minLocY); + double hY = 0.5 * (maxLocY - minLocY); + double hXminY = minR * sinPhiHalf; + double hXmaxY = maxR * sinPhiHalf; // Split trapezoid auto sTrapezoid = std::make_shared(hXminY, hXmaxY, hY); Vector3 zAxis = transform.rotation().col(2); - ActsScalar zPosition = transform.translation().z(); + double zPosition = transform.translation().z(); // Now create the Trapezoids for (unsigned int iphi = 0; iphi < splits; ++iphi) { // Create the split module transform - ActsScalar phi = - -std::numbers::pi_v + (2 * iphi + 1) * dHalfPhi; + double phi = -std::numbers::pi_v + (2 * iphi + 1) * dHalfPhi; auto sTransform = Transform3( Translation3(hR * std::cos(phi), hR * std::sin(phi), zPosition) * - AngleAxis3(phi - static_cast(std::numbers::pi / 2.), - zAxis)); + AngleAxis3(phi - static_cast(std::numbers::pi / 2.), zAxis)); // Place it dSupport.push_back( Surface::makeShared(sTransform, sTrapezoid)); @@ -307,7 +304,7 @@ Acts::Experimental::detail::SupportSurfacesHelper::rectangularSupport( "surface type is not a plane."); } - std::array bounds = {}; + std::array bounds = {}; std::copy_n(values.begin(), 4u, bounds.begin()); return {Surface::makeShared( diff --git a/Core/src/EventData/CorrectedTransformationFreeToBound.cpp b/Core/src/EventData/CorrectedTransformationFreeToBound.cpp index ebeb73c00ba..405fea01e3b 100644 --- a/Core/src/EventData/CorrectedTransformationFreeToBound.cpp +++ b/Core/src/EventData/CorrectedTransformationFreeToBound.cpp @@ -25,9 +25,8 @@ #include #include -Acts::FreeToBoundCorrection::FreeToBoundCorrection(bool apply_, - ActsScalar alpha_, - ActsScalar beta_) +Acts::FreeToBoundCorrection::FreeToBoundCorrection(bool apply_, double alpha_, + double beta_) : apply(apply_), alpha(alpha_), beta(beta_) {} Acts::FreeToBoundCorrection::FreeToBoundCorrection(bool apply_) @@ -38,8 +37,8 @@ Acts::FreeToBoundCorrection::operator bool() const { } Acts::detail::CorrectedFreeToBoundTransformer::CorrectedFreeToBoundTransformer( - ActsScalar alpha, ActsScalar beta, ActsScalar cosIncidentAngleMinCutoff, - ActsScalar cosIncidentAngleMaxCutoff) + double alpha, double beta, double cosIncidentAngleMinCutoff, + double cosIncidentAngleMaxCutoff) : m_alpha(alpha), m_beta(beta), m_cosIncidentAngleMinCutoff(cosIncidentAngleMinCutoff), @@ -63,7 +62,7 @@ Acts::detail::CorrectedFreeToBoundTransformer::operator()( Vector3 dir = freeParams.segment<3>(eFreeDir0); Vector3 normal = surface.normal(geoContext, freeParams.segment<3>(eFreePos0), dir); - ActsScalar absCosIncidenceAng = std::abs(dir.dot(normal)); + double absCosIncidenceAng = std::abs(dir.dot(normal)); // No correction if the incidentAngle is small enough (not necessary ) or too // large (correction could be invalid). Fall back to nominal free to bound // transformation @@ -78,7 +77,7 @@ Acts::detail::CorrectedFreeToBoundTransformer::operator()( std::size_t sampleSize = 2 * eFreeSize + 1; // The sampled free parameters, the weight for measurement W_m and weight for // covariance, W_c - std::vector> sampledFreeParams; + std::vector> sampledFreeParams; sampledFreeParams.reserve(sampleSize); // Initialize the covariance sqrt root matrix @@ -99,11 +98,11 @@ Acts::detail::CorrectedFreeToBoundTransformer::operator()( covSqrt = U * D; // Define kappa = alpha*alpha*N - ActsScalar kappa = m_alpha * m_alpha * static_cast(eFreeSize); + double kappa = m_alpha * m_alpha * static_cast(eFreeSize); // lambda = alpha*alpha*N - N - ActsScalar lambda = kappa - static_cast(eFreeSize); + double lambda = kappa - static_cast(eFreeSize); // gamma = sqrt(labmda + N) - ActsScalar gamma = std::sqrt(kappa); + double gamma = std::sqrt(kappa); // Sample the free parameters // 1. the nominal parameter @@ -125,7 +124,7 @@ Acts::detail::CorrectedFreeToBoundTransformer::operator()( // The transformed bound parameters and weight for each sampled free // parameters - std::vector> transformedBoundParams; + std::vector> transformedBoundParams; // 1. The nominal one // The sampled free parameters, the weight for measurement W_m and weight for diff --git a/Core/src/EventData/PrintParameters.cpp b/Core/src/EventData/PrintParameters.cpp index 01d62694c66..a076ea17027 100644 --- a/Core/src/EventData/PrintParameters.cpp +++ b/Core/src/EventData/PrintParameters.cpp @@ -188,8 +188,7 @@ void Acts::detail::printFreeParameters(std::ostream& os, void Acts::detail::printMeasurement(std::ostream& os, BoundIndices size, const std::uint8_t* indices, - const ActsScalar* params, - const ActsScalar* cov) { + const double* params, const double* cov) { auto s = static_cast(size); printParametersCovariance(os, makeBoundNames(), indices, ParametersMap(params, s), CovarianceMap(cov, s, s)); @@ -197,8 +196,7 @@ void Acts::detail::printMeasurement(std::ostream& os, BoundIndices size, void Acts::detail::printMeasurement(std::ostream& os, FreeIndices size, const std::uint8_t* indices, - const ActsScalar* params, - const ActsScalar* cov) { + const double* params, const double* cov) { auto s = static_cast(size); printParametersCovariance(os, makeFreeNames(), indices, ParametersMap(params, s), CovarianceMap(cov, s, s)); diff --git a/Core/src/EventData/TransformationHelpers.cpp b/Core/src/EventData/TransformationHelpers.cpp index 90014814073..ea6dcf061d1 100644 --- a/Core/src/EventData/TransformationHelpers.cpp +++ b/Core/src/EventData/TransformationHelpers.cpp @@ -42,7 +42,7 @@ Acts::FreeVector Acts::transformBoundToFreeParameters( Acts::Result Acts::transformFreeToBoundParameters( const FreeVector& freeParams, const Surface& surface, - const GeometryContext& geoCtx, ActsScalar tolerance) { + const GeometryContext& geoCtx, double tolerance) { // initialize the bound vector BoundVector bp = BoundVector::Zero(); // convert global to local position on the surface @@ -65,10 +65,9 @@ Acts::Result Acts::transformFreeToBoundParameters( } Acts::Result Acts::transformFreeToBoundParameters( - const Acts::Vector3& position, ActsScalar time, - const Acts::Vector3& direction, ActsScalar qOverP, - const Acts::Surface& surface, const Acts::GeometryContext& geoCtx, - ActsScalar tolerance) { + const Acts::Vector3& position, double time, const Acts::Vector3& direction, + double qOverP, const Acts::Surface& surface, + const Acts::GeometryContext& geoCtx, double tolerance) { // initialize the bound vector BoundVector bp = BoundVector::Zero(); // convert global to local position on the surface @@ -88,8 +87,10 @@ Acts::Result Acts::transformFreeToBoundParameters( return Result::success(bp); } -Acts::BoundVector Acts::transformFreeToCurvilinearParameters( - ActsScalar time, ActsScalar phi, ActsScalar theta, ActsScalar qOverP) { +Acts::BoundVector Acts::transformFreeToCurvilinearParameters(double time, + double phi, + double theta, + double qOverP) { BoundVector bp = BoundVector::Zero(); // local coordinates are zero by construction bp[eBoundTime] = time; @@ -100,7 +101,7 @@ Acts::BoundVector Acts::transformFreeToCurvilinearParameters( } Acts::BoundVector Acts::transformFreeToCurvilinearParameters( - ActsScalar time, const Vector3& direction, ActsScalar qOverP) { + double time, const Vector3& direction, double qOverP) { BoundVector bp = BoundVector::Zero(); // local coordinates are zero by construction bp[eBoundTime] = time; diff --git a/Core/src/Geometry/CompositePortalLink.cpp b/Core/src/Geometry/CompositePortalLink.cpp index d8010bbbce2..108db95c192 100644 --- a/Core/src/Geometry/CompositePortalLink.cpp +++ b/Core/src/Geometry/CompositePortalLink.cpp @@ -228,9 +228,9 @@ std::unique_ptr CompositePortalLink::makeGrid( const auto& bounds = dynamic_cast(child->surface().bounds()); Transform3 ltransform = itransform * child->surface().transform(gctx); - ActsScalar hlZ = bounds.get(CylinderBounds::eHalfLengthZ); - ActsScalar minZ = ltransform.translation()[eZ] - hlZ; - ActsScalar maxZ = ltransform.translation()[eZ] + hlZ; + double hlZ = bounds.get(CylinderBounds::eHalfLengthZ); + double minZ = ltransform.translation()[eZ] - hlZ; + double maxZ = ltransform.translation()[eZ] + hlZ; if (i == 0) { edges.push_back(minZ); } diff --git a/Core/src/Geometry/ConeVolumeBounds.cpp b/Core/src/Geometry/ConeVolumeBounds.cpp index 31339ca4779..ebc1262c1b8 100644 --- a/Core/src/Geometry/ConeVolumeBounds.cpp +++ b/Core/src/Geometry/ConeVolumeBounds.cpp @@ -30,10 +30,10 @@ #include namespace Acts { -ConeVolumeBounds::ConeVolumeBounds( - ActsScalar innerAlpha, ActsScalar innerOffsetZ, ActsScalar outerAlpha, - ActsScalar outerOffsetZ, ActsScalar halflengthZ, ActsScalar averagePhi, - ActsScalar halfPhiSector) noexcept(false) +ConeVolumeBounds::ConeVolumeBounds(double innerAlpha, double innerOffsetZ, + double outerAlpha, double outerOffsetZ, + double halflengthZ, double averagePhi, + double halfPhiSector) noexcept(false) : VolumeBounds(), m_values() { m_values[eInnerAlpha] = innerAlpha; m_values[eInnerOffsetZ] = innerOffsetZ; @@ -46,10 +46,10 @@ ConeVolumeBounds::ConeVolumeBounds( checkConsistency(); } -ConeVolumeBounds::ConeVolumeBounds(ActsScalar cylinderR, ActsScalar alpha, - ActsScalar offsetZ, ActsScalar halflengthZ, - ActsScalar averagePhi, - ActsScalar halfPhiSector) noexcept(false) +ConeVolumeBounds::ConeVolumeBounds(double cylinderR, double alpha, + double offsetZ, double halflengthZ, + double averagePhi, + double halfPhiSector) noexcept(false) : VolumeBounds(), m_values() { m_values[eInnerAlpha] = 0.; m_values[eInnerOffsetZ] = 0.; @@ -60,11 +60,11 @@ ConeVolumeBounds::ConeVolumeBounds(ActsScalar cylinderR, ActsScalar alpha, m_values[eHalfPhiSector] = halfPhiSector; // Cone parameters - ActsScalar tanAlpha = std::tan(alpha); - ActsScalar zmin = offsetZ - halflengthZ; - ActsScalar zmax = offsetZ + halflengthZ; - ActsScalar rmin = std::abs(zmin) * tanAlpha; - ActsScalar rmax = std::abs(zmax) * tanAlpha; + double tanAlpha = std::tan(alpha); + double zmin = offsetZ - halflengthZ; + double zmax = offsetZ + halflengthZ; + double rmin = std::abs(zmin) * tanAlpha; + double rmax = std::abs(zmax) * tanAlpha; if (rmin >= cylinderR) { // Cylindrical cut-out of a cone @@ -192,36 +192,35 @@ void ConeVolumeBounds::checkConsistency() noexcept(false) { } } -bool ConeVolumeBounds::inside(const Vector3& pos, ActsScalar tol) const { - ActsScalar z = pos.z(); - ActsScalar zmin = z + tol; - ActsScalar zmax = z - tol; +bool ConeVolumeBounds::inside(const Vector3& pos, double tol) const { + double z = pos.z(); + double zmin = z + tol; + double zmax = z - tol; // Quick check outside z if (zmin < -get(eHalfLengthZ) || zmax > get(eHalfLengthZ)) { return false; } - ActsScalar r = VectorHelpers::perp(pos); + double r = VectorHelpers::perp(pos); if (std::abs(get(eHalfPhiSector) - std::numbers::pi) > s_onSurfaceTolerance) { // need to check the phi sector - approximate phi tolerance - ActsScalar phitol = tol / r; - ActsScalar phi = VectorHelpers::phi(pos); - ActsScalar phimin = phi - phitol; - ActsScalar phimax = phi + phitol; + double phitol = tol / r; + double phi = VectorHelpers::phi(pos); + double phimin = phi - phitol; + double phimax = phi + phitol; if (phimin < get(eAveragePhi) - get(eHalfPhiSector) || phimax > get(eAveragePhi) + get(eHalfPhiSector)) { return false; } } // We are within phi sector check box r quickly - ActsScalar rmin = r + tol; - ActsScalar rmax = r - tol; + double rmin = r + tol; + double rmax = r - tol; if (rmin > innerRmax() && rmax < outerRmin()) { return true; } // Finally we need to check the cone if (m_innerConeBounds != nullptr) { - ActsScalar innerConeR = - m_innerConeBounds->r(std::abs(z + get(eInnerOffsetZ))); + double innerConeR = m_innerConeBounds->r(std::abs(z + get(eInnerOffsetZ))); if (innerConeR > rmin) { return false; } @@ -230,8 +229,7 @@ bool ConeVolumeBounds::inside(const Vector3& pos, ActsScalar tol) const { } // And the outer cone if (m_outerConeBounds != nullptr) { - ActsScalar outerConeR = - m_outerConeBounds->r(std::abs(z + get(eOuterOffsetZ))); + double outerConeR = m_outerConeBounds->r(std::abs(z + get(eOuterOffsetZ))); if (outerConeR < rmax) { return false; } @@ -245,8 +243,8 @@ void ConeVolumeBounds::buildSurfaceBounds() { // Build inner cone or inner cylinder if (get(eInnerAlpha) > s_epsilon) { m_innerTanAlpha = std::tan(get(eInnerAlpha)); - ActsScalar innerZmin = get(eInnerOffsetZ) - get(eHalfLengthZ); - ActsScalar innerZmax = get(eInnerOffsetZ) + get(eHalfLengthZ); + double innerZmin = get(eInnerOffsetZ) - get(eHalfLengthZ); + double innerZmax = get(eInnerOffsetZ) + get(eHalfLengthZ); m_innerRmin = std::abs(innerZmin) * m_innerTanAlpha; m_innerRmax = std::abs(innerZmax) * m_innerTanAlpha; m_innerConeBounds = @@ -259,8 +257,8 @@ void ConeVolumeBounds::buildSurfaceBounds() { if (get(eOuterAlpha) > s_epsilon) { m_outerTanAlpha = std::tan(get(eOuterAlpha)); - ActsScalar outerZmin = get(eOuterOffsetZ) - get(eHalfLengthZ); - ActsScalar outerZmax = get(eOuterOffsetZ) + get(eHalfLengthZ); + double outerZmin = get(eOuterOffsetZ) - get(eHalfLengthZ); + double outerZmax = get(eOuterOffsetZ) + get(eHalfLengthZ); m_outerRmin = std::abs(outerZmin) * m_outerTanAlpha; m_outerRmax = std::abs(outerZmax) * m_outerTanAlpha; m_outerConeBounds = @@ -312,32 +310,32 @@ Volume::BoundingBox ConeVolumeBounds::boundingBox(const Transform3* trf, return trf == nullptr ? box : box.transformed(*trf); } -ActsScalar ConeVolumeBounds::innerRmin() const { +double ConeVolumeBounds::innerRmin() const { return m_innerRmin; } -ActsScalar ConeVolumeBounds::innerRmax() const { +double ConeVolumeBounds::innerRmax() const { return m_innerRmax; } -ActsScalar ConeVolumeBounds::innerTanAlpha() const { +double ConeVolumeBounds::innerTanAlpha() const { return m_innerTanAlpha; } -ActsScalar ConeVolumeBounds::outerRmin() const { +double ConeVolumeBounds::outerRmin() const { return m_outerRmin; } -ActsScalar ConeVolumeBounds::outerRmax() const { +double ConeVolumeBounds::outerRmax() const { return m_outerRmax; } -ActsScalar ConeVolumeBounds::outerTanAlpha() const { +double ConeVolumeBounds::outerTanAlpha() const { return m_outerTanAlpha; } -std::vector ConeVolumeBounds::values() const { - std::vector valvector; +std::vector ConeVolumeBounds::values() const { + std::vector valvector; valvector.insert(valvector.begin(), m_values.begin(), m_values.end()); return valvector; } diff --git a/Core/src/Geometry/CuboidVolumeBounds.cpp b/Core/src/Geometry/CuboidVolumeBounds.cpp index 64b0b67f8d7..be2443c9691 100644 --- a/Core/src/Geometry/CuboidVolumeBounds.cpp +++ b/Core/src/Geometry/CuboidVolumeBounds.cpp @@ -18,15 +18,13 @@ namespace Acts { -CuboidVolumeBounds::CuboidVolumeBounds(ActsScalar halex, ActsScalar haley, - ActsScalar halez) +CuboidVolumeBounds::CuboidVolumeBounds(double halex, double haley, double halez) : VolumeBounds(), m_values({halex, haley, halez}) { checkConsistency(); buildSurfaceBounds(); } -CuboidVolumeBounds::CuboidVolumeBounds( - const std::array& values) +CuboidVolumeBounds::CuboidVolumeBounds(const std::array& values) : m_values(values) { checkConsistency(); buildSurfaceBounds(); @@ -102,7 +100,7 @@ void CuboidVolumeBounds::buildSurfaceBounds() { get(eHalfLengthX)); } -ActsScalar CuboidVolumeBounds::binningBorder(BinningValue bValue) const { +double CuboidVolumeBounds::binningBorder(BinningValue bValue) const { if (bValue <= BinningValue::binZ) { return m_values[toUnderlying(bValue)]; } @@ -115,14 +113,14 @@ ActsScalar CuboidVolumeBounds::binningBorder(BinningValue bValue) const { return 0.0; } -bool CuboidVolumeBounds::inside(const Vector3& pos, ActsScalar tol) const { +bool CuboidVolumeBounds::inside(const Vector3& pos, double tol) const { return (std::abs(pos.x()) <= get(eHalfLengthX) + tol && std::abs(pos.y()) <= get(eHalfLengthY) + tol && std::abs(pos.z()) <= get(eHalfLengthZ) + tol); } -std::vector CuboidVolumeBounds::values() const { - std::vector valvector; +std::vector CuboidVolumeBounds::values() const { + std::vector valvector; valvector.insert(valvector.begin(), m_values.begin(), m_values.end()); return valvector; } @@ -135,13 +133,13 @@ void CuboidVolumeBounds::checkConsistency() noexcept(false) { } } -void CuboidVolumeBounds::set(BoundValues bValue, ActsScalar value) { +void CuboidVolumeBounds::set(BoundValues bValue, double value) { set({{bValue, value}}); } void CuboidVolumeBounds::set( - std::initializer_list> keyValues) { - std::array previous = m_values; + std::initializer_list> keyValues) { + std::array previous = m_values; for (const auto& [key, value] : keyValues) { m_values[key] = value; } diff --git a/Core/src/Geometry/CylinderVolumeBounds.cpp b/Core/src/Geometry/CylinderVolumeBounds.cpp index b4f8084a4c0..1e3bba1d67f 100644 --- a/Core/src/Geometry/CylinderVolumeBounds.cpp +++ b/Core/src/Geometry/CylinderVolumeBounds.cpp @@ -26,11 +26,10 @@ namespace Acts { -CylinderVolumeBounds::CylinderVolumeBounds(ActsScalar rmin, ActsScalar rmax, - ActsScalar halfz, ActsScalar halfphi, - ActsScalar avgphi, - ActsScalar bevelMinZ, - ActsScalar bevelMaxZ) +CylinderVolumeBounds::CylinderVolumeBounds(double rmin, double rmax, + double halfz, double halfphi, + double avgphi, double bevelMinZ, + double bevelMaxZ) : m_values() { m_values[eMinR] = rmin; m_values[eMaxR] = rmax; @@ -44,16 +43,16 @@ CylinderVolumeBounds::CylinderVolumeBounds(ActsScalar rmin, ActsScalar rmax, } CylinderVolumeBounds::CylinderVolumeBounds( - const std::array& values) + const std::array& values) : m_values(values) { checkConsistency(); buildSurfaceBounds(); } CylinderVolumeBounds::CylinderVolumeBounds(const CylinderBounds& cBounds, - ActsScalar thickness) + double thickness) : VolumeBounds() { - ActsScalar cR = cBounds.get(CylinderBounds::eR); + double cR = cBounds.get(CylinderBounds::eR); if (thickness <= 0. || (cR - 0.5 * thickness) < 0.) { throw(std::invalid_argument( "CylinderVolumeBounds: invalid extrusion thickness.")); @@ -69,7 +68,7 @@ CylinderVolumeBounds::CylinderVolumeBounds(const CylinderBounds& cBounds, } CylinderVolumeBounds::CylinderVolumeBounds(const RadialBounds& rBounds, - ActsScalar thickness) + double thickness) : VolumeBounds() { if (thickness <= 0.) { throw(std::invalid_argument( @@ -93,11 +92,11 @@ std::vector CylinderVolumeBounds::orientedSurfaces( Translation3 vMinZ(0., 0., -get(eHalfLengthZ)); Translation3 vMaxZ(0., 0., get(eHalfLengthZ)); // Set up transform for beveled edges if they are defined - ActsScalar bevelMinZ = get(eBevelMinZ); - ActsScalar bevelMaxZ = get(eBevelMaxZ); + double bevelMinZ = get(eBevelMinZ); + double bevelMaxZ = get(eBevelMaxZ); Transform3 transMinZ, transMaxZ; if (bevelMinZ != 0.) { - ActsScalar sy = 1 - 1 / std::cos(bevelMinZ); + double sy = 1 - 1 / std::cos(bevelMinZ); transMinZ = transform * vMinZ * Eigen::AngleAxisd(-bevelMinZ, Eigen::Vector3d(1., 0., 0.)) * Eigen::Scaling(1., 1. + sy, 1.); @@ -105,7 +104,7 @@ std::vector CylinderVolumeBounds::orientedSurfaces( transMinZ = transform * vMinZ; } if (bevelMaxZ != 0.) { - ActsScalar sy = 1 - 1 / std::cos(bevelMaxZ); + double sy = 1 - 1 / std::cos(bevelMaxZ); transMaxZ = transform * vMaxZ * Eigen::AngleAxisd(bevelMaxZ, Eigen::Vector3d(1., 0., 0.)) * Eigen::Scaling(1., 1. + sy, 1.); @@ -195,7 +194,7 @@ std::ostream& CylinderVolumeBounds::toStream(std::ostream& os) const { Volume::BoundingBox CylinderVolumeBounds::boundingBox( const Transform3* trf, const Vector3& envelope, const Volume* entity) const { - ActsScalar xmax = 0, xmin = 0, ymax = 0, ymin = 0; + double xmax = 0, xmin = 0, ymax = 0, ymin = 0; xmax = get(eMaxR); if (get(eHalfPhiSector) > std::numbers::pi / 2.) { @@ -219,10 +218,10 @@ Volume::BoundingBox CylinderVolumeBounds::boundingBox( return trf == nullptr ? box : box.transformed(*trf); } -bool CylinderVolumeBounds::inside(const Vector3& pos, ActsScalar tol) const { +bool CylinderVolumeBounds::inside(const Vector3& pos, double tol) const { using VectorHelpers::perp; using VectorHelpers::phi; - ActsScalar ros = perp(pos); + double ros = perp(pos); bool insidePhi = cos(phi(pos)) >= cos(get(eHalfPhiSector)) - tol; bool insideR = insidePhi ? ((ros >= get(eMinR) - tol) && (ros <= get(eMaxR) + tol)) @@ -241,7 +240,7 @@ Vector3 CylinderVolumeBounds::binningOffset(BinningValue bValue) return VolumeBounds::binningOffset(bValue); } -ActsScalar CylinderVolumeBounds::binningBorder(BinningValue bValue) const { +double CylinderVolumeBounds::binningBorder(BinningValue bValue) const { if (bValue == Acts::BinningValue::binR) { return 0.5 * (get(eMaxR) - get(eMinR)); } @@ -251,8 +250,8 @@ ActsScalar CylinderVolumeBounds::binningBorder(BinningValue bValue) const { return VolumeBounds::binningBorder(bValue); } -std::vector CylinderVolumeBounds::values() const { - std::vector valvector; +std::vector CylinderVolumeBounds::values() const { + std::vector valvector; valvector.insert(valvector.begin(), m_values.begin(), m_values.end()); return valvector; } @@ -291,13 +290,13 @@ void CylinderVolumeBounds::checkConsistency() { } } -void CylinderVolumeBounds::set(BoundValues bValue, ActsScalar value) { +void CylinderVolumeBounds::set(BoundValues bValue, double value) { set({{bValue, value}}); } void CylinderVolumeBounds::set( - std::initializer_list> keyValues) { - std::array previous = m_values; + std::initializer_list> keyValues) { + std::array previous = m_values; for (const auto& [key, value] : keyValues) { m_values[key] = value; } diff --git a/Core/src/Geometry/CylinderVolumeHelper.cpp b/Core/src/Geometry/CylinderVolumeHelper.cpp index f5b244983ef..77d9dcaee8f 100644 --- a/Core/src/Geometry/CylinderVolumeHelper.cpp +++ b/Core/src/Geometry/CylinderVolumeHelper.cpp @@ -638,7 +638,7 @@ bool Acts::CylinderVolumeHelper::interGlueTrackingVolume( std::const_pointer_cast(*(++tVolIter)); // re-evalueate rGlueMin - ActsScalar rGlueR = + double rGlueR = 0.5 * (tVol1->volumeBounds() .values()[CylinderVolumeBounds::BoundValues::eMaxR] + tVol2->volumeBounds() diff --git a/Core/src/Geometry/CylinderVolumeStack.cpp b/Core/src/Geometry/CylinderVolumeStack.cpp index 5dd0949ac79..5350c3e764e 100644 --- a/Core/src/Geometry/CylinderVolumeStack.cpp +++ b/Core/src/Geometry/CylinderVolumeStack.cpp @@ -40,23 +40,23 @@ struct CylinderVolumeStack::VolumeTuple { updatedBounds = std::make_shared(*bounds); } - ActsScalar midZ() const { return localTransform.translation()[eZ]; } - ActsScalar halfLengthZ() const { + double midZ() const { return localTransform.translation()[eZ]; } + double halfLengthZ() const { return updatedBounds->get(CylinderVolumeBounds::eHalfLengthZ); } - ActsScalar minZ() const { return midZ() - halfLengthZ(); } - ActsScalar maxZ() const { return midZ() + halfLengthZ(); } + double minZ() const { return midZ() - halfLengthZ(); } + double maxZ() const { return midZ() + halfLengthZ(); } - ActsScalar minR() const { + double minR() const { return updatedBounds->get(CylinderVolumeBounds::eMinR); } - ActsScalar maxR() const { + double maxR() const { return updatedBounds->get(CylinderVolumeBounds::eMaxR); } - ActsScalar midR() const { return (minR() + maxR()) / 2.0; } + double midR() const { return (minR() + maxR()) / 2.0; } void set(std::initializer_list< - std::pair> + std::pair> keyValues) { updatedBounds->set(keyValues); } @@ -204,11 +204,11 @@ void CylinderVolumeStack::initializeOuterVolume(BinningValue direction, ACTS_DEBUG("*** Volume configuration after final z sorting:"); printVolumeSequence(volumeTuples, logger, Acts::Logging::DEBUG); - ActsScalar minZ = volumeTuples.front().minZ(); - ActsScalar maxZ = volumeTuples.back().maxZ(); + double minZ = volumeTuples.front().minZ(); + double maxZ = volumeTuples.back().maxZ(); - ActsScalar midZ = (minZ + maxZ) / 2.0; - ActsScalar hlZ = (maxZ - minZ) / 2.0; + double midZ = (minZ + maxZ) / 2.0; + double hlZ = (maxZ - minZ) / 2.0; m_transform = m_groupTransform * Translation3{0, 0, midZ}; @@ -261,11 +261,11 @@ void CylinderVolumeStack::initializeOuterVolume(BinningValue direction, ACTS_DEBUG("*** Volume configuration after final r sorting:"); printVolumeSequence(volumeTuples, logger, Acts::Logging::DEBUG); - ActsScalar minR = volumeTuples.front().minR(); - ActsScalar maxR = volumeTuples.back().maxR(); + double minR = volumeTuples.front().minR(); + double maxR = volumeTuples.back().maxR(); - ActsScalar midZ = (minZ + maxZ) / 2.0; - ActsScalar hlZ = (maxZ - minZ) / 2.0; + double midZ = (minZ + maxZ) / 2.0; + double hlZ = (maxZ - minZ) / 2.0; m_transform = m_groupTransform * Translation3{0, 0, midZ}; @@ -349,7 +349,7 @@ CylinderVolumeStack::checkOverlapAndAttachInZ( if (std::abs(a.maxZ() - b.minZ()) < tolerance) { ACTS_VERBOSE("No gap between volumes, no attachment needed"); } else { - ActsScalar gapWidth = b.minZ() - a.maxZ(); + double gapWidth = b.minZ() - a.maxZ(); ACTS_VERBOSE("Gap width: " << gapWidth); ACTS_VERBOSE("Synchronizing bounds in z with strategy: " << strategy); @@ -357,8 +357,8 @@ CylinderVolumeStack::checkOverlapAndAttachInZ( case AttachmentStrategy::Midpoint: { ACTS_VERBOSE(" -> Strategy: Expand both volumes to midpoint"); - ActsScalar aZMidNew = (a.minZ() + a.maxZ()) / 2.0 + gapWidth / 4.0; - ActsScalar aHlZNew = a.halfLengthZ() + gapWidth / 4.0; + double aZMidNew = (a.minZ() + a.maxZ()) / 2.0 + gapWidth / 4.0; + double aHlZNew = a.halfLengthZ() + gapWidth / 4.0; ACTS_VERBOSE(" - New halflength for first volume: " << aHlZNew); ACTS_VERBOSE(" - New bounds for first volume: [" << (aZMidNew - aHlZNew) << " <- " << aZMidNew << " -> " @@ -368,8 +368,8 @@ CylinderVolumeStack::checkOverlapAndAttachInZ( "Volume shrunk"); assert(aHlZNew >= a.halfLengthZ() && "Volume shrunk"); - ActsScalar bZMidNew = (b.minZ() + b.maxZ()) / 2.0 - gapWidth / 4.0; - ActsScalar bHlZNew = b.halfLengthZ() + gapWidth / 4.0; + double bZMidNew = (b.minZ() + b.maxZ()) / 2.0 - gapWidth / 4.0; + double bHlZNew = b.halfLengthZ() + gapWidth / 4.0; ACTS_VERBOSE(" - New halflength for second volume: " << bHlZNew); ACTS_VERBOSE(" - New bounds for second volume: [" << (bZMidNew - bHlZNew) << " <- " << bZMidNew << " -> " @@ -391,8 +391,8 @@ CylinderVolumeStack::checkOverlapAndAttachInZ( } case AttachmentStrategy::First: { ACTS_VERBOSE(" -> Strategy: Expand first volume"); - ActsScalar aZMidNew = (a.minZ() + b.minZ()) / 2.0; - ActsScalar aHlZNew = (b.minZ() - a.minZ()) / 2.0; + double aZMidNew = (a.minZ() + b.minZ()) / 2.0; + double aHlZNew = (b.minZ() - a.minZ()) / 2.0; ACTS_VERBOSE(" - Gap width: " << gapWidth); ACTS_VERBOSE(" - New bounds for first volume: [" << (aZMidNew - aHlZNew) << " <- " << aZMidNew << " -> " @@ -410,8 +410,8 @@ CylinderVolumeStack::checkOverlapAndAttachInZ( } case AttachmentStrategy::Second: { ACTS_VERBOSE(" -> Strategy: Expand second volume"); - ActsScalar bZMidNew = (a.maxZ() + b.maxZ()) / 2.0; - ActsScalar bHlZNew = (b.maxZ() - a.maxZ()) / 2.0; + double bZMidNew = (a.maxZ() + b.maxZ()) / 2.0; + double bHlZNew = (b.maxZ() - a.maxZ()) / 2.0; ACTS_VERBOSE(" - New halflength for second volume: " << bHlZNew); ACTS_VERBOSE(" - New bounds for second volume: [" << (bZMidNew - bHlZNew) << " <- " << bZMidNew << " -> " @@ -428,14 +428,14 @@ CylinderVolumeStack::checkOverlapAndAttachInZ( } case AttachmentStrategy::Gap: { ACTS_VERBOSE(" -> Strategy: Create a gap volume"); - ActsScalar gapHlZ = (b.minZ() - a.maxZ()) / 2.0; - ActsScalar gapMidZ = (b.minZ() + a.maxZ()) / 2.0; + double gapHlZ = (b.minZ() - a.maxZ()) / 2.0; + double gapMidZ = (b.minZ() + a.maxZ()) / 2.0; ACTS_VERBOSE(" - Gap half length: " << gapHlZ << " at z: " << gapMidZ); - ActsScalar minR = std::min(a.minR(), b.minR()); - ActsScalar maxR = std::max(a.maxR(), b.maxR()); + double minR = std::min(a.minR(), b.minR()); + double maxR = std::max(a.maxR(), b.maxR()); Transform3 gapLocalTransform{Translation3{0, 0, gapMidZ}}; Transform3 gapGlobalTransform = m_groupTransform * gapLocalTransform; @@ -483,7 +483,7 @@ CylinderVolumeStack::checkOverlapAndAttachInR( if (std::abs(a.maxR() - b.minR()) < tolerance) { ACTS_VERBOSE("No gap between volumes, no attachment needed"); } else { - ActsScalar gapWidth = b.minR() - a.maxR(); + double gapWidth = b.minR() - a.maxR(); ACTS_VERBOSE("Gap width: " << gapWidth); ACTS_VERBOSE("Synchronizing bounds in r with strategy: " << strategy); @@ -592,9 +592,9 @@ void CylinderVolumeStack::checkVolumeAlignment( } } -std::pair CylinderVolumeStack::synchronizeRBounds( +std::pair CylinderVolumeStack::synchronizeRBounds( std::vector& volumes, const Logger& logger) { - const ActsScalar minR = + const double minR = std::min_element(volumes.begin(), volumes.end(), [](const auto& a, const auto& b) { return a.bounds->get(CylinderVolumeBounds::eMinR) < @@ -602,7 +602,7 @@ std::pair CylinderVolumeStack::synchronizeRBounds( }) ->bounds->get(CylinderVolumeBounds::eMinR); - const ActsScalar maxR = + const double maxR = std::max_element(volumes.begin(), volumes.end(), [](const auto& a, const auto& b) { return a.bounds->get(CylinderVolumeBounds::eMaxR) < @@ -621,21 +621,21 @@ std::pair CylinderVolumeStack::synchronizeRBounds( return {minR, maxR}; } -std::pair CylinderVolumeStack::synchronizeZBounds( +std::pair CylinderVolumeStack::synchronizeZBounds( std::vector& volumes, const Logger& logger) { - const ActsScalar minZ = std::min_element(volumes.begin(), volumes.end(), - [](const auto& a, const auto& b) { - return a.minZ() < b.minZ(); - }) - ->minZ(); - - const ActsScalar maxZ = std::max_element(volumes.begin(), volumes.end(), - [](const auto& a, const auto& b) { - return a.maxZ() < b.maxZ(); - }) - ->maxZ(); - const ActsScalar midZ = (minZ + maxZ) / 2.0; - const ActsScalar hlZ = (maxZ - minZ) / 2.0; + const double minZ = std::min_element(volumes.begin(), volumes.end(), + [](const auto& a, const auto& b) { + return a.minZ() < b.minZ(); + }) + ->minZ(); + + const double maxZ = std::max_element(volumes.begin(), volumes.end(), + [](const auto& a, const auto& b) { + return a.maxZ() < b.maxZ(); + }) + ->maxZ(); + const double midZ = (minZ + maxZ) / 2.0; + const double hlZ = (maxZ - minZ) / 2.0; ACTS_DEBUG("Found overall z bounds: [ " << minZ << " <- " << midZ << " -> " << maxZ << " ]"); const Transform3 transform{Translation3{0, 0, midZ}}; @@ -703,19 +703,19 @@ void CylinderVolumeStack::update(std::shared_ptr volbounds, checkNoPhiOrBevel(*cylBounds, logger); - const ActsScalar newMinR = newVolume.minR(); - const ActsScalar newMaxR = newVolume.maxR(); - const ActsScalar newMinZ = newVolume.minZ(); - const ActsScalar newMaxZ = newVolume.maxZ(); - const ActsScalar newMidZ = newVolume.midZ(); - const ActsScalar newHlZ = newVolume.halfLengthZ(); + const double newMinR = newVolume.minR(); + const double newMaxR = newVolume.maxR(); + const double newMinZ = newVolume.minZ(); + const double newMaxZ = newVolume.maxZ(); + const double newMidZ = newVolume.midZ(); + const double newHlZ = newVolume.halfLengthZ(); - const ActsScalar oldMinR = oldVolume.minR(); - const ActsScalar oldMaxR = oldVolume.maxR(); - const ActsScalar oldMinZ = oldVolume.minZ(); - const ActsScalar oldMaxZ = oldVolume.maxZ(); - const ActsScalar oldMidZ = oldVolume.midZ(); - const ActsScalar oldHlZ = oldVolume.halfLengthZ(); + const double oldMinR = oldVolume.minR(); + const double oldMaxR = oldVolume.maxR(); + const double oldMinZ = oldVolume.minZ(); + const double oldMaxZ = oldVolume.maxZ(); + const double oldMidZ = oldVolume.midZ(); + const double oldHlZ = oldVolume.halfLengthZ(); ACTS_VERBOSE("Previous bounds are: z: [ " << oldMinZ << " <- " << oldMidZ << " -> " << oldMaxZ << " ] (" @@ -727,9 +727,7 @@ void CylinderVolumeStack::update(std::shared_ptr volbounds, << " ]"); constexpr auto tolerance = s_onSurfaceTolerance; - auto same = [](ActsScalar a, ActsScalar b) { - return std::abs(a - b) < tolerance; - }; + auto same = [](double a, double b) { return std::abs(a - b) < tolerance; }; if (!same(newMinZ, oldMinZ) && newMinZ > oldMinZ) { ACTS_ERROR("Shrinking the stack size in z is not supported: " @@ -796,9 +794,9 @@ void CylinderVolumeStack::update(std::shared_ptr volbounds, ACTS_VERBOSE("Expanding first volume to new z bounds"); auto& first = volumeTuples.front(); - ActsScalar newMinZFirst = newVolume.minZ(); - ActsScalar newMidZFirst = (newMinZFirst + first.maxZ()) / 2.0; - ActsScalar newHlZFirst = (first.maxZ() - newMinZFirst) / 2.0; + double newMinZFirst = newVolume.minZ(); + double newMidZFirst = (newMinZFirst + first.maxZ()) / 2.0; + double newHlZFirst = (first.maxZ() - newMinZFirst) / 2.0; ACTS_VERBOSE(" -> first z: [ " << newMinZFirst << " <- " << newMidZFirst << " -> " @@ -813,9 +811,9 @@ void CylinderVolumeStack::update(std::shared_ptr volbounds, ACTS_VERBOSE("Expanding last volume to new z bounds"); auto& last = volumeTuples.back(); - ActsScalar newMaxZLast = newVolume.maxZ(); - ActsScalar newMidZLast = (last.minZ() + newMaxZLast) / 2.0; - ActsScalar newHlZLast = (newMaxZLast - last.minZ()) / 2.0; + double newMaxZLast = newVolume.maxZ(); + double newMidZLast = (last.minZ() + newMaxZLast) / 2.0; + double newHlZLast = (newMaxZLast - last.minZ()) / 2.0; ACTS_VERBOSE(" -> last z: [ " << last.minZ() << " <- " << newMidZLast << " -> " << newMaxZLast @@ -837,10 +835,10 @@ void CylinderVolumeStack::update(std::shared_ptr volbounds, }; if (!same(newMinZ, oldMinZ) && newMinZ < oldMinZ) { - ActsScalar gap1MinZ = newVolume.minZ(); - ActsScalar gap1MaxZ = oldVolume.minZ(); - ActsScalar gap1HlZ = (gap1MaxZ - gap1MinZ) / 2.0; - ActsScalar gap1PZ = (gap1MaxZ + gap1MinZ) / 2.0; + double gap1MinZ = newVolume.minZ(); + double gap1MaxZ = oldVolume.minZ(); + double gap1HlZ = (gap1MaxZ - gap1MinZ) / 2.0; + double gap1PZ = (gap1MaxZ + gap1MinZ) / 2.0; // // check if we need a new gap volume or reuse an existing one auto& candidate = volumeTuples.front(); @@ -875,10 +873,10 @@ void CylinderVolumeStack::update(std::shared_ptr volbounds, } if (!same(newMaxZ, oldMaxZ) && newMaxZ > oldMaxZ) { - ActsScalar gap2MinZ = oldVolume.maxZ(); - ActsScalar gap2MaxZ = newVolume.maxZ(); - ActsScalar gap2HlZ = (gap2MaxZ - gap2MinZ) / 2.0; - ActsScalar gap2PZ = (gap2MaxZ + gap2MinZ) / 2.0; + double gap2MinZ = oldVolume.maxZ(); + double gap2MaxZ = newVolume.maxZ(); + double gap2HlZ = (gap2MaxZ - gap2MinZ) / 2.0; + double gap2PZ = (gap2MaxZ + gap2MinZ) / 2.0; // check if we need a new gap volume or reuse an existing one auto& candidate = volumeTuples.back(); diff --git a/Core/src/Geometry/Extent.cpp b/Core/src/Geometry/Extent.cpp index bd50d8536ef..aa31278134a 100644 --- a/Core/src/Geometry/Extent.cpp +++ b/Core/src/Geometry/Extent.cpp @@ -20,13 +20,13 @@ Acts::Extent::Extent(const ExtentEnvelope& envelope) : m_constrains(0), m_envelope(envelope) { m_range[toUnderlying(BinningValue::binR)] = - Range1D(0., std::numeric_limits::max()); - m_range[toUnderlying(BinningValue::binPhi)] = Range1D( - -std::numbers::pi_v, std::numbers::pi_v); + Range1D(0., std::numeric_limits::max()); + m_range[toUnderlying(BinningValue::binPhi)] = + Range1D(-std::numbers::pi_v, std::numbers::pi_v); m_range[toUnderlying(BinningValue::binRPhi)] = - Range1D(0., std::numeric_limits::max()); + Range1D(0., std::numeric_limits::max()); m_range[toUnderlying(BinningValue::binMag)] = - Range1D(0., std::numeric_limits::max()); + Range1D(0., std::numeric_limits::max()); } void Acts::Extent::extend(const Vector3& vtx, @@ -34,14 +34,14 @@ void Acts::Extent::extend(const Vector3& vtx, bool applyEnv, bool fillHistograms) { for (auto bValue : bValues) { // Get the casted value given the binning value description - ActsScalar cValue = VectorHelpers::cast(vtx, bValue); + double cValue = VectorHelpers::cast(vtx, bValue); if (fillHistograms) { m_valueHistograms[toUnderlying(bValue)].push_back(cValue); } // Apply envelope as suggested - ActsScalar lEnv = applyEnv ? m_envelope[bValue][0] : 0.; - ActsScalar hEnv = applyEnv ? m_envelope[bValue][1] : 0.; - ActsScalar mValue = cValue - lEnv; + double lEnv = applyEnv ? m_envelope[bValue][0] : 0.; + double hEnv = applyEnv ? m_envelope[bValue][1] : 0.; + double mValue = cValue - lEnv; // Special protection for radial value if (bValue == BinningValue::binR && mValue < 0.) { mValue = std::max(mValue, 0.); @@ -61,8 +61,8 @@ void Acts::Extent::extend(const Extent& rhs, for (auto bValue : bValues) { // The value is constraint, envelope can be optional if (rhs.constrains(bValue)) { - ActsScalar lEnv = applyEnv ? m_envelope[bValue][0] : 0.; - ActsScalar hEnv = applyEnv ? m_envelope[bValue][1] : 0.; + double lEnv = applyEnv ? m_envelope[bValue][0] : 0.; + double hEnv = applyEnv ? m_envelope[bValue][1] : 0.; if (constrains(bValue)) { m_range[toUnderlying(bValue)].expand( rhs.range()[toUnderlying(bValue)].min() - lEnv, @@ -95,17 +95,17 @@ void Acts::Extent::addConstrain(const Acts::Extent& rhs, } } -void Acts::Extent::set(BinningValue bValue, ActsScalar min, ActsScalar max) { - ActsScalar minval = min; +void Acts::Extent::set(BinningValue bValue, double min, double max) { + double minval = min; if (bValue == BinningValue::binR && minval < 0.) { minval = 0.; } - m_range[toUnderlying(bValue)] = Range1D{minval, max}; + m_range[toUnderlying(bValue)] = Range1D{minval, max}; m_constrains.set(toUnderlying(bValue)); } -void Acts::Extent::setMin(BinningValue bValue, ActsScalar min) { - ActsScalar minval = min; +void Acts::Extent::setMin(BinningValue bValue, double min) { + double minval = min; if (bValue == BinningValue::binR && minval < 0.) { minval = 0.; } @@ -113,7 +113,7 @@ void Acts::Extent::setMin(BinningValue bValue, ActsScalar min) { m_constrains.set(toUnderlying(bValue)); } -void Acts::Extent::setMax(BinningValue bValue, ActsScalar max) { +void Acts::Extent::setMax(BinningValue bValue, double max) { m_range[toUnderlying(bValue)].setMax(0u, max); m_constrains.set(toUnderlying(bValue)); } @@ -126,7 +126,7 @@ bool Acts::Extent::contains(const Vector3& vtx) const { Extent checkExtent; for (const auto& bv : allBinningValues()) { if (constrains(bv)) { - ActsScalar vtxVal = VectorHelpers::cast(vtx, bv); + double vtxVal = VectorHelpers::cast(vtx, bv); checkExtent.set(bv, vtxVal, vtxVal); } } diff --git a/Core/src/Geometry/GridPortalLink.cpp b/Core/src/Geometry/GridPortalLink.cpp index 632289d9dc3..ae6168e11cf 100644 --- a/Core/src/Geometry/GridPortalLink.cpp +++ b/Core/src/Geometry/GridPortalLink.cpp @@ -24,20 +24,19 @@ std::unique_ptr GridPortalLink::make( dynamic_cast(surface.get()); cylinder != nullptr) { if (direction == BinningValue::binRPhi) { - ActsScalar r = cylinder->bounds().get(CylinderBounds::eR); + double r = cylinder->bounds().get(CylinderBounds::eR); if (cylinder->bounds().coversFullAzimuth()) { grid = GridPortalLink::make( surface, direction, Axis{AxisClosed, -std::numbers::pi * r, std::numbers::pi * r, 1}); } else { - ActsScalar hlPhi = - cylinder->bounds().get(CylinderBounds::eHalfPhiSector); + double hlPhi = cylinder->bounds().get(CylinderBounds::eHalfPhiSector); grid = GridPortalLink::make(surface, direction, Axis{AxisBound, -hlPhi * r, hlPhi * r, 1}); } } else if (direction == BinningValue::binZ) { - ActsScalar hlZ = cylinder->bounds().get(CylinderBounds::eHalfLengthZ); + double hlZ = cylinder->bounds().get(CylinderBounds::eHalfLengthZ); grid = GridPortalLink::make(surface, direction, Axis{AxisBound, -hlZ, hlZ, 1}); } else { @@ -47,8 +46,8 @@ std::unique_ptr GridPortalLink::make( disc != nullptr) { const auto& bounds = dynamic_cast(disc->bounds()); if (direction == BinningValue::binR) { - ActsScalar minR = bounds.get(RadialBounds::eMinR); - ActsScalar maxR = bounds.get(RadialBounds::eMaxR); + double minR = bounds.get(RadialBounds::eMinR); + double maxR = bounds.get(RadialBounds::eMaxR); grid = GridPortalLink::make(surface, direction, Axis{AxisBound, minR, maxR, 1}); } else if (direction == BinningValue::binPhi) { @@ -57,7 +56,7 @@ std::unique_ptr GridPortalLink::make( surface, direction, Axis{AxisClosed, -std::numbers::pi, std::numbers::pi, 1}); } else { - ActsScalar hlPhi = bounds.get(RadialBounds::eHalfPhiSector); + double hlPhi = bounds.get(RadialBounds::eHalfPhiSector); grid = GridPortalLink::make(surface, direction, Axis{AxisBound, -hlPhi, hlPhi, 1}); } @@ -90,7 +89,7 @@ void GridPortalLink::checkConsistency(const CylinderSurface& cyl) const { auto same = [](auto a, auto b) { return std::abs(a - b) < tolerance; }; auto checkZ = [&cyl, same](const IAxis& axis) { - ActsScalar hlZ = cyl.bounds().get(CylinderBounds::eHalfLengthZ); + double hlZ = cyl.bounds().get(CylinderBounds::eHalfLengthZ); if (!same(axis.getMin(), -hlZ) || !same(axis.getMax(), hlZ)) { throw std::invalid_argument( "GridPortalLink: CylinderBounds: invalid length setup: " + @@ -100,9 +99,9 @@ void GridPortalLink::checkConsistency(const CylinderSurface& cyl) const { } }; auto checkRPhi = [&cyl, same](const IAxis& axis) { - ActsScalar hlPhi = cyl.bounds().get(CylinderBounds::eHalfPhiSector); - ActsScalar r = cyl.bounds().get(CylinderBounds::eR); - if (ActsScalar hlRPhi = r * hlPhi; + double hlPhi = cyl.bounds().get(CylinderBounds::eHalfPhiSector); + double r = cyl.bounds().get(CylinderBounds::eR); + if (double hlRPhi = r * hlPhi; !same(axis.getMin(), -hlRPhi) || !same(axis.getMax(), hlRPhi)) { throw std::invalid_argument( "GridPortalLink: CylinderBounds: invalid phi sector setup: axes " @@ -157,8 +156,8 @@ void GridPortalLink::checkConsistency(const DiscSurface& disc) const { } auto checkR = [&bounds, same](const IAxis& axis) { - ActsScalar minR = bounds->get(RadialBounds::eMinR); - ActsScalar maxR = bounds->get(RadialBounds::eMaxR); + double minR = bounds->get(RadialBounds::eMinR); + double maxR = bounds->get(RadialBounds::eMaxR); if (!same(axis.getMin(), minR) || !same(axis.getMax(), maxR)) { throw std::invalid_argument( "GridPortalLink: DiscBounds: invalid radius setup."); @@ -166,7 +165,7 @@ void GridPortalLink::checkConsistency(const DiscSurface& disc) const { }; auto checkPhi = [&bounds, same](const IAxis& axis) { - ActsScalar hlPhi = bounds->get(RadialBounds::eHalfPhiSector); + double hlPhi = bounds->get(RadialBounds::eHalfPhiSector); if (!same(axis.getMin(), -hlPhi) || !same(axis.getMax(), hlPhi)) { throw std::invalid_argument( "GridPortalLink: DiscBounds: invalid phi sector setup."); @@ -322,7 +321,7 @@ std::unique_ptr GridPortalLink::extendTo2dImpl( if (direction() == BinningValue::binRPhi) { const auto& axisRPhi = *grid().axes().front(); // 1D direction is binRPhi, so add a Z axis - ActsScalar hlZ = surface->bounds().get(CylinderBounds::eHalfLengthZ); + double hlZ = surface->bounds().get(CylinderBounds::eHalfLengthZ); auto grid = axisRPhi.visit([&](const auto& axis0) { Axis axisZ{AxisBound, -hlZ, hlZ, 1}; @@ -340,9 +339,9 @@ std::unique_ptr GridPortalLink::extendTo2dImpl( } else { const auto& axisZ = *grid().axes().front(); // 1D direction is binZ, so add an rPhi axis - ActsScalar r = surface->bounds().get(CylinderBounds::eR); - ActsScalar hlPhi = surface->bounds().get(CylinderBounds::eHalfPhiSector); - ActsScalar hlRPhi = r * hlPhi; + double r = surface->bounds().get(CylinderBounds::eR); + double hlPhi = surface->bounds().get(CylinderBounds::eHalfPhiSector); + double hlRPhi = r * hlPhi; auto makeGrid = [&](auto bdt) { auto grid = axisZ.visit([&](const auto& axis1) { @@ -379,7 +378,7 @@ std::unique_ptr GridPortalLink::extendTo2dImpl( if (direction() == BinningValue::binR) { const auto& axisR = *grid().axes().front(); // 1D direction is binR, so add a phi axis - ActsScalar hlPhi = bounds->get(RadialBounds::eHalfPhiSector); + double hlPhi = bounds->get(RadialBounds::eHalfPhiSector); auto makeGrid = [&](auto bdt) { auto grid = axisR.visit([&](const auto& axis0) { @@ -403,8 +402,8 @@ std::unique_ptr GridPortalLink::extendTo2dImpl( } else { const auto& axisPhi = *grid().axes().front(); // 1D direction is binPhi, so add an R axis - ActsScalar rMin = bounds->get(RadialBounds::eMinR); - ActsScalar rMax = bounds->get(RadialBounds::eMaxR); + double rMin = bounds->get(RadialBounds::eMinR); + double rMax = bounds->get(RadialBounds::eMaxR); auto grid = axisPhi.visit([&](const auto& axis1) { Axis axisR{AxisBound, rMin, rMax, 1}; diff --git a/Core/src/Geometry/GridPortalLinkMerging.cpp b/Core/src/Geometry/GridPortalLinkMerging.cpp index 1a828e71176..f475822876b 100644 --- a/Core/src/Geometry/GridPortalLinkMerging.cpp +++ b/Core/src/Geometry/GridPortalLinkMerging.cpp @@ -88,14 +88,14 @@ std::unique_ptr makeGrid( std::unique_ptr mergeVariable( const std::shared_ptr& mergedSurface, const IAxis& axisA, - const IAxis& axisB, ActsScalar /*tolerance*/, BinningValue direction, + const IAxis& axisB, double /*tolerance*/, BinningValue direction, const Logger& logger, const IAxis* otherAxis, bool prepend) { ACTS_VERBOSE("Variable merge: direction is " << direction); ACTS_VERBOSE("~> axis a: " << axisA); ACTS_VERBOSE("~> axis b: " << axisB); - std::vector binEdges; + std::vector binEdges; binEdges.reserve(axisA.getNBins() + axisB.getNBins() + 1); @@ -107,23 +107,23 @@ std::unique_ptr mergeVariable( } else { ACTS_VERBOSE("Performing symmetrized merge"); - ActsScalar halfWidth = + double halfWidth = (axisA.getMax() - axisA.getMin() + axisB.getMax() - axisB.getMin()) / 2.0; ACTS_VERBOSE(" ~> half width: " << halfWidth); - ActsScalar shift = axisA.getMax() - halfWidth; + double shift = axisA.getMax() - halfWidth; ACTS_VERBOSE(" ~> shift: " << shift); std::ranges::transform(edgesA, std::back_inserter(binEdges), - [&](ActsScalar edge) { return edge + shift; }); + [&](double edge) { return edge + shift; }); } - ActsScalar stitchPoint = binEdges.back(); + double stitchPoint = binEdges.back(); auto edgesB = axisB.getBinEdges(); std::transform( std::next(edgesB.begin()), edgesB.end(), std::back_inserter(binEdges), - [&](ActsScalar edge) { return edge - axisB.getMin() + stitchPoint; }); + [&](double edge) { return edge - axisB.getMin() + stitchPoint; }); return makeGrid(mergedSurface, direction, logger, std::tuple{std::move(binEdges)}, otherAxis, prepend); @@ -131,25 +131,25 @@ std::unique_ptr mergeVariable( std::unique_ptr mergeEquidistant( const std::shared_ptr& mergedSurface, const IAxis& axisA, - const IAxis& axisB, ActsScalar tolerance, BinningValue direction, + const IAxis& axisB, double tolerance, BinningValue direction, const Logger& logger, const IAxis* otherAxis, bool prepend) { ACTS_VERBOSE("===> potentially equidistant merge: checking bin widths"); ACTS_VERBOSE("~> axis a: " << axisA); ACTS_VERBOSE("~> axis b: " << axisB); - ActsScalar binsWidthA = (axisA.getMax() - axisA.getMin()) / - static_cast(axisA.getNBins()); - ActsScalar binsWidthB = (axisB.getMax() - axisB.getMin()) / - static_cast(axisB.getNBins()); + double binsWidthA = + (axisA.getMax() - axisA.getMin()) / static_cast(axisA.getNBins()); + double binsWidthB = + (axisB.getMax() - axisB.getMin()) / static_cast(axisB.getNBins()); ACTS_VERBOSE(" ~> binWidths: " << binsWidthA << " vs " << binsWidthB); if (std::abs(binsWidthA - binsWidthB) < tolerance) { ACTS_VERBOSE("==> binWidths same: " << binsWidthA); - ActsScalar min = std::numeric_limits::signaling_NaN(); - ActsScalar max = std::numeric_limits::signaling_NaN(); + double min = std::numeric_limits::signaling_NaN(); + double max = std::numeric_limits::signaling_NaN(); if (direction == BinningValue::binR) { ACTS_VERBOSE("Performing asymmetric merge"); @@ -158,7 +158,7 @@ std::unique_ptr mergeEquidistant( } else { ACTS_VERBOSE("Performing symmetrized merge"); - ActsScalar halfWidth = + double halfWidth = (axisA.getMax() - axisA.getMin() + axisB.getMax() - axisB.getMin()) / 2.0; @@ -183,7 +183,7 @@ std::unique_ptr mergeEquidistant( std::unique_ptr colinearMerge( const std::shared_ptr& mergedSurface, const IAxis& axisA, - const IAxis& axisB, ActsScalar tolerance, BinningValue direction, + const IAxis& axisB, double tolerance, BinningValue direction, const Logger& logger, const IAxis* otherAxis, bool prepend) { AxisType aType = axisA.getType(); AxisType bType = axisB.getType(); diff --git a/Core/src/Geometry/KDTreeTrackingGeometryBuilder.cpp b/Core/src/Geometry/KDTreeTrackingGeometryBuilder.cpp index 75e2d50d4fa..c0a45763372 100644 --- a/Core/src/Geometry/KDTreeTrackingGeometryBuilder.cpp +++ b/Core/src/Geometry/KDTreeTrackingGeometryBuilder.cpp @@ -45,16 +45,16 @@ std::unique_ptr Acts::KDTreeTrackingGeometryBuilder::trackingGeometry( const GeometryContext& gctx) const { using MeasuredSurface = - std::pair, std::shared_ptr>; + std::pair, std::shared_ptr>; // Prepare all the surfaces std::vector surfacesMeasured; surfacesMeasured.reserve(m_cfg.surfaces.size()); for (auto& s : m_cfg.surfaces) { auto ext = s->polyhedronRepresentation(gctx, 1u).extent(); - surfacesMeasured.push_back(MeasuredSurface{ - std::array{ext.medium(BinningValue::binZ), - ext.medium(BinningValue::binR)}, - s}); + surfacesMeasured.push_back( + MeasuredSurface{std::array{ext.medium(BinningValue::binZ), + ext.medium(BinningValue::binR)}, + s}); } // Create the KDTree @@ -157,7 +157,7 @@ Acts::KDTreeTrackingGeometryBuilder::translateLayer( auto& its = plVolume.internal.value(); // Try to pull from the kd tree - RangeXD<2u, ActsScalar> zrRange; + RangeXD<2u, double> zrRange; zrRange[0u] = plVolume.extent.range(Acts::BinningValue::binZ); zrRange[1u] = plVolume.extent.range(Acts::BinningValue::binR); diff --git a/Core/src/Geometry/TrapezoidVolumeBounds.cpp b/Core/src/Geometry/TrapezoidVolumeBounds.cpp index 96d682a35dc..f03af8c85c0 100644 --- a/Core/src/Geometry/TrapezoidVolumeBounds.cpp +++ b/Core/src/Geometry/TrapezoidVolumeBounds.cpp @@ -23,9 +23,8 @@ namespace Acts { -TrapezoidVolumeBounds::TrapezoidVolumeBounds(ActsScalar minhalex, - ActsScalar maxhalex, - ActsScalar haley, ActsScalar halez) +TrapezoidVolumeBounds::TrapezoidVolumeBounds(double minhalex, double maxhalex, + double haley, double halez) : VolumeBounds() { m_values[eHalfLengthXnegY] = minhalex; m_values[eHalfLengthXposY] = maxhalex; @@ -37,9 +36,9 @@ TrapezoidVolumeBounds::TrapezoidVolumeBounds(ActsScalar minhalex, buildSurfaceBounds(); } -TrapezoidVolumeBounds::TrapezoidVolumeBounds(ActsScalar minhalex, - ActsScalar haley, ActsScalar halez, - ActsScalar alpha, ActsScalar beta) +TrapezoidVolumeBounds::TrapezoidVolumeBounds(double minhalex, double haley, + double halez, double alpha, + double beta) : VolumeBounds() { m_values[eHalfLengthXnegY] = minhalex; m_values[eHalfLengthY] = haley; @@ -47,8 +46,8 @@ TrapezoidVolumeBounds::TrapezoidVolumeBounds(ActsScalar minhalex, m_values[eAlpha] = alpha; m_values[eBeta] = beta; // now calculate the remaining max half X - ActsScalar gamma = (alpha > beta) ? (alpha - std::numbers::pi / 2.) - : (beta - std::numbers::pi / 2.); + double gamma = (alpha > beta) ? (alpha - std::numbers::pi / 2.) + : (beta - std::numbers::pi / 2.); m_values[eHalfLengthXposY] = minhalex + (2. * haley) * tan(gamma); checkConsistency(); @@ -78,9 +77,9 @@ std::vector TrapezoidVolumeBounds::orientedSurfaces( oSurfaces.push_back( OrientedSurface{std::move(sf), Direction::OppositeNormal}); - ActsScalar poshOffset = get(eHalfLengthY) / std::tan(get(eAlpha)); - ActsScalar neghOffset = get(eHalfLengthY) / std::tan(get(eBeta)); - ActsScalar topShift = poshOffset + neghOffset; + double poshOffset = get(eHalfLengthY) / std::tan(get(eAlpha)); + double neghOffset = get(eHalfLengthY) / std::tan(get(eBeta)); + double topShift = poshOffset + neghOffset; // Face surfaces yz // (3) - At point B, attached to beta opening angle @@ -141,7 +140,7 @@ void TrapezoidVolumeBounds::buildSurfaceBounds() { get(eHalfLengthZ), get(eHalfLengthXposY)); } -bool TrapezoidVolumeBounds::inside(const Vector3& pos, ActsScalar tol) const { +bool TrapezoidVolumeBounds::inside(const Vector3& pos, double tol) const { if (std::abs(pos.z()) > get(eHalfLengthZ) + tol) { return false; } @@ -168,10 +167,10 @@ std::ostream& TrapezoidVolumeBounds::toStream(std::ostream& os) const { Volume::BoundingBox TrapezoidVolumeBounds::boundingBox( const Transform3* trf, const Vector3& envelope, const Volume* entity) const { - ActsScalar minx = get(eHalfLengthXnegY); - ActsScalar maxx = get(eHalfLengthXposY); - ActsScalar haley = get(eHalfLengthY); - ActsScalar halez = get(eHalfLengthZ); + double minx = get(eHalfLengthXnegY); + double maxx = get(eHalfLengthXposY); + double haley = get(eHalfLengthY); + double halez = get(eHalfLengthZ); std::array vertices = {{{-minx, -haley, -halez}, {+minx, -haley, -halez}, @@ -199,8 +198,8 @@ Volume::BoundingBox TrapezoidVolumeBounds::boundingBox( return {entity, vmin - envelope, vmax + envelope}; } -std::vector TrapezoidVolumeBounds::values() const { - std::vector valvector; +std::vector TrapezoidVolumeBounds::values() const { + std::vector valvector; valvector.insert(valvector.begin(), m_values.begin(), m_values.end()); return valvector; } diff --git a/Core/src/Geometry/Volume.cpp b/Core/src/Geometry/Volume.cpp index 97a026b039f..7aac6f8b9d6 100644 --- a/Core/src/Geometry/Volume.cpp +++ b/Core/src/Geometry/Volume.cpp @@ -55,7 +55,7 @@ Volume& Volume::operator=(const Volume& vol) { return *this; } -bool Volume::inside(const Vector3& gpos, ActsScalar tol) const { +bool Volume::inside(const Vector3& gpos, double tol) const { Vector3 posInVolFrame((transform().inverse()) * gpos); return (volumeBounds()).inside(posInVolFrame, tol); } diff --git a/Core/src/Material/MaterialInteractionAssignment.cpp b/Core/src/Material/MaterialInteractionAssignment.cpp index 8d4b4b0ac60..32e93bcef1a 100644 --- a/Core/src/Material/MaterialInteractionAssignment.cpp +++ b/Core/src/Material/MaterialInteractionAssignment.cpp @@ -49,7 +49,7 @@ Acts::MaterialInteractionAssignment::assign( // Walk along the sorted intersections auto [cSurface, cPosition, cDirection] = intersectedSurfaces[is]; - ActsScalar cDistance = (cPosition - materialInteraction.position).norm(); + double cDistance = (cPosition - materialInteraction.position).norm(); // Peak forward to check if you have a closer intersection while ( @@ -57,9 +57,9 @@ Acts::MaterialInteractionAssignment::assign( (((intersectedSurfaces[is + 1]).position - materialInteraction.position) .norm() < cDistance)) { // Recalculate the new distance - ActsScalar nDistance = ((intersectedSurfaces[is + 1]).position - - materialInteraction.position) - .norm(); + double nDistance = ((intersectedSurfaces[is + 1]).position - + materialInteraction.position) + .norm(); ++is; cDistance = nDistance; } @@ -68,8 +68,7 @@ Acts::MaterialInteractionAssignment::assign( auto [surface, position, direction] = intersectedSurfaces[is]; // Calculate the path correction - ActsScalar pathCorrection = - surface->pathCorrection(gctx, position, direction); + double pathCorrection = surface->pathCorrection(gctx, position, direction); // A local veta veto kicked in GeometryIdentifier intersectionID = surface->geometryId(); diff --git a/Core/src/Navigation/NavigationStream.cpp b/Core/src/Navigation/NavigationStream.cpp index c36eed12bbe..3ea28dd748c 100644 --- a/Core/src/Navigation/NavigationStream.cpp +++ b/Core/src/Navigation/NavigationStream.cpp @@ -18,7 +18,7 @@ namespace Acts { bool NavigationStream::initialize(const GeometryContext& gctx, const QueryPoint& queryPoint, const BoundaryTolerance& cTolerance, - ActsScalar onSurfaceTolerance) { + double onSurfaceTolerance) { // Position and direction from the query point const Vector3& position = queryPoint.position; const Vector3& direction = queryPoint.direction; @@ -95,7 +95,7 @@ bool NavigationStream::initialize(const GeometryContext& gctx, bool NavigationStream::update(const GeometryContext& gctx, const QueryPoint& queryPoint, - ActsScalar onSurfaceTolerance) { + double onSurfaceTolerance) { // Loop over the (currently valid) candidates and update for (; m_currentIndex < m_candidates.size(); ++m_currentIndex) { // Get the candidate, and resolve the tuple diff --git a/Core/src/Seeding/EstimateTrackParamsFromSeed.cpp b/Core/src/Seeding/EstimateTrackParamsFromSeed.cpp index 055691bbb2f..9a06bdea0bf 100644 --- a/Core/src/Seeding/EstimateTrackParamsFromSeed.cpp +++ b/Core/src/Seeding/EstimateTrackParamsFromSeed.cpp @@ -47,27 +47,27 @@ Acts::FreeVector Acts::estimateTrackParamsFromSeed(const Vector3& sp0, Vector2 circleCenter; circleCenter(0) = 0.5 * local1(0); - ActsScalar deltaX21 = local2(0) - local1(0); - ActsScalar sumX21 = local2(0) + local1(0); + double deltaX21 = local2(0) - local1(0); + double sumX21 = local2(0) + local1(0); // straight line connecting the two points // y = a * x + c (we don't care about c right now) // we simply need the slope // we compute 1./a since this is what we need for the following computation - ActsScalar ia = deltaX21 / local2(1); + double ia = deltaX21 / local2(1); // Perpendicular line is then y = -1/a *x + b // we can evaluate b given we know a already by imposing // the line passes through P = (0.5 * (x2 + x1), 0.5 * y2) - ActsScalar b = 0.5 * (local2(1) + ia * sumX21); + double b = 0.5 * (local2(1) + ia * sumX21); circleCenter(1) = -ia * circleCenter(0) + b; // Radius is a signed distance between circleCenter and first sp, which is at // (0, 0) in the new frame. Sign depends on the slope a (positive vs negative) int sign = ia > 0 ? -1 : 1; - const ActsScalar R = circleCenter.norm(); - ActsScalar invTanTheta = + const double R = circleCenter.norm(); + double invTanTheta = local2.z() / (2 * R * std::asin(local2.head<2>().norm() / (2 * R))); // The momentum direction in the new frame (the center of the circle has the // coordinate (-1.*A/(2*B), 1./(2*B))) - ActsScalar A = -circleCenter(0) / circleCenter(1); + double A = -circleCenter(0) / circleCenter(1); Vector3 transDirection(1., A, fastHypot(1, A) * invTanTheta); // Transform it back to the original frame Vector3 direction = rotation * transDirection.normalized(); @@ -83,7 +83,7 @@ Acts::FreeVector Acts::estimateTrackParamsFromSeed(const Vector3& sp0, // The estimated q/pt in [GeV/c]^-1 (note that the pt is the projection of // momentum on the transverse plane of the new frame) - ActsScalar qOverPt = sign / (bField.norm() * R); + double qOverPt = sign / (bField.norm() * R); // The estimated q/p in [GeV/c]^-1 params[eFreeQOverP] = qOverPt / fastHypot(1., invTanTheta); diff --git a/Core/src/Surfaces/AnnulusBounds.cpp b/Core/src/Surfaces/AnnulusBounds.cpp index 34c7b5c468b..bba1ef63b3f 100644 --- a/Core/src/Surfaces/AnnulusBounds.cpp +++ b/Core/src/Surfaces/AnnulusBounds.cpp @@ -107,11 +107,11 @@ std::vector Acts::AnnulusBounds::vertices( if (quarterSegments > 0u) { using VectorHelpers::phi; - ActsScalar phiMinInner = phi(m_inRightStripXY - m_moduleOrigin); - ActsScalar phiMaxInner = phi(m_inLeftStripXY - m_moduleOrigin); + double phiMinInner = phi(m_inRightStripXY - m_moduleOrigin); + double phiMaxInner = phi(m_inLeftStripXY - m_moduleOrigin); - ActsScalar phiMinOuter = phi(m_outRightStripXY - m_moduleOrigin); - ActsScalar phiMaxOuter = phi(m_outLeftStripXY - m_moduleOrigin); + double phiMinOuter = phi(m_outRightStripXY - m_moduleOrigin); + double phiMaxOuter = phi(m_outLeftStripXY - m_moduleOrigin); // Inner bow from phi_min -> phi_max (needs to be reversed) std::vector rvertices = @@ -355,8 +355,7 @@ Acts::Vector2 Acts::AnnulusBounds::closestOnSegment( // weighted scalar product of line to point and segment line auto u = ((p - a).transpose() * weight * n).value() / f; // clamp to [0, 1], convert to point - return std::min(std::max(u, static_cast(0)), - static_cast(1)) * + return std::min(std::max(u, static_cast(0)), static_cast(1)) * n + a; } @@ -367,7 +366,7 @@ double Acts::AnnulusBounds::squaredNorm(const Vector2& v, } Acts::Vector2 Acts::AnnulusBounds::moduleOrigin() const { - return Eigen::Rotation2D(get(eAveragePhi)) * m_moduleOrigin; + return Eigen::Rotation2D(get(eAveragePhi)) * m_moduleOrigin; } // Ostream operator overload diff --git a/Core/src/Surfaces/ConeSurface.cpp b/Core/src/Surfaces/ConeSurface.cpp index b6d04e87e06..21a6d3024fe 100644 --- a/Core/src/Surfaces/ConeSurface.cpp +++ b/Core/src/Surfaces/ConeSurface.cpp @@ -189,8 +189,8 @@ Acts::Polyhedron Acts::ConeSurface::polyhedronRepresentation( std::vector vertices; std::vector faces; std::vector triangularMesh; - ActsScalar minZ = bounds().get(ConeBounds::eMinZ); - ActsScalar maxZ = bounds().get(ConeBounds::eMaxZ); + double minZ = bounds().get(ConeBounds::eMinZ); + double maxZ = bounds().get(ConeBounds::eMaxZ); if (minZ == -std::numeric_limits::infinity() || maxZ == std::numeric_limits::infinity()) { @@ -208,15 +208,15 @@ Acts::Polyhedron Acts::ConeSurface::polyhedronRepresentation( } // Cone parameters - ActsScalar hPhiSec = bounds().get(ConeBounds::eHalfPhiSector); - ActsScalar avgPhi = bounds().get(ConeBounds::eAveragePhi); - std::vector refPhi = {}; - if (bool fullCone = (hPhiSec == std::numbers::pi_v); !fullCone) { + double hPhiSec = bounds().get(ConeBounds::eHalfPhiSector); + double avgPhi = bounds().get(ConeBounds::eAveragePhi); + std::vector refPhi = {}; + if (bool fullCone = (hPhiSec == std::numbers::pi_v); !fullCone) { refPhi = {avgPhi}; } // Add the cone sizes - std::vector coneSides; + std::vector coneSides; if (std::abs(minZ) > s_onSurfaceTolerance) { coneSides.push_back(minZ); } @@ -284,7 +284,7 @@ Acts::detail::RealQuadraticEquation Acts::ConeSurface::intersectionSolver( Acts::SurfaceMultiIntersection Acts::ConeSurface::intersect( const GeometryContext& gctx, const Vector3& position, const Vector3& direction, const BoundaryTolerance& boundaryTolerance, - ActsScalar tolerance) const { + double tolerance) const { // Solve the quadratic equation auto qe = intersectionSolver(gctx, position, direction); diff --git a/Core/src/Surfaces/CylinderBounds.cpp b/Core/src/Surfaces/CylinderBounds.cpp index 82f809c6c5b..665cbe97db5 100644 --- a/Core/src/Surfaces/CylinderBounds.cpp +++ b/Core/src/Surfaces/CylinderBounds.cpp @@ -112,9 +112,9 @@ std::vector Acts::CylinderBounds::circleVertices( double avgPhi = get(eAveragePhi); double halfPhi = get(eHalfPhiSector); - std::vector phiRef = {}; + std::vector phiRef = {}; if (bool fullCylinder = coversFullAzimuth(); fullCylinder) { - phiRef = {static_cast(avgPhi)}; + phiRef = {static_cast(avgPhi)}; } // Write the two bows/circles on either side @@ -127,13 +127,13 @@ std::vector Acts::CylinderBounds::circleVertices( vertices.insert(vertices.end(), svertices.begin(), svertices.end()); } - ActsScalar bevelMinZ = get(eBevelMinZ); - ActsScalar bevelMaxZ = get(eBevelMaxZ); + double bevelMinZ = get(eBevelMinZ); + double bevelMaxZ = get(eBevelMaxZ); // Modify the vertices position if bevel is defined if ((bevelMinZ != 0. || bevelMaxZ != 0.) && vertices.size() % 2 == 0) { auto halfWay = vertices.end() - vertices.size() / 2; - ActsScalar mult{1}; + double mult{1}; auto invTransform = transform.inverse(); auto func = [&mult, &transform, &invTransform](Vector3& v) { v = invTransform * v; diff --git a/Core/src/Surfaces/CylinderSurface.cpp b/Core/src/Surfaces/CylinderSurface.cpp index 4b3cd2db7be..5f9c3189935 100644 --- a/Core/src/Surfaces/CylinderSurface.cpp +++ b/Core/src/Surfaces/CylinderSurface.cpp @@ -230,7 +230,7 @@ Acts::detail::RealQuadraticEquation Acts::CylinderSurface::intersectionSolver( Acts::SurfaceMultiIntersection Acts::CylinderSurface::intersect( const GeometryContext& gctx, const Vector3& position, const Vector3& direction, const BoundaryTolerance& boundaryTolerance, - ActsScalar tolerance) const { + double tolerance) const { const auto& gctxTransform = transform(gctx); // Solve the quadratic equation @@ -430,7 +430,7 @@ Acts::CylinderSurface::mergedWith(const CylinderSurface& other, "CylinderSurface::merge: surfaces have different radii"); } - ActsScalar r = bounds().get(CylinderBounds::eR); + double r = bounds().get(CylinderBounds::eR); // no translation in x/z is allowed Vector3 translation = otherLocal.translation(); @@ -444,20 +444,20 @@ Acts::CylinderSurface::mergedWith(const CylinderSurface& other, "CylinderSurface::merge: surfaces have relative translation in x/y"); } - ActsScalar hlZ = bounds().get(CylinderBounds::eHalfLengthZ); - ActsScalar minZ = -hlZ; - ActsScalar maxZ = hlZ; + double hlZ = bounds().get(CylinderBounds::eHalfLengthZ); + double minZ = -hlZ; + double maxZ = hlZ; - ActsScalar zShift = translation[2]; - ActsScalar otherHlZ = other.bounds().get(CylinderBounds::eHalfLengthZ); - ActsScalar otherMinZ = -otherHlZ + zShift; - ActsScalar otherMaxZ = otherHlZ + zShift; + double zShift = translation[2]; + double otherHlZ = other.bounds().get(CylinderBounds::eHalfLengthZ); + double otherMinZ = -otherHlZ + zShift; + double otherMaxZ = otherHlZ + zShift; - ActsScalar hlPhi = bounds().get(CylinderBounds::eHalfPhiSector); - ActsScalar avgPhi = bounds().get(CylinderBounds::eAveragePhi); + double hlPhi = bounds().get(CylinderBounds::eHalfPhiSector); + double avgPhi = bounds().get(CylinderBounds::eAveragePhi); - ActsScalar otherHlPhi = other.bounds().get(CylinderBounds::eHalfPhiSector); - ActsScalar otherAvgPhi = other.bounds().get(CylinderBounds::eAveragePhi); + double otherHlPhi = other.bounds().get(CylinderBounds::eHalfPhiSector); + double otherAvgPhi = other.bounds().get(CylinderBounds::eAveragePhi); if (direction == Acts::BinningValue::binZ) { // z shift must match the bounds @@ -491,10 +491,10 @@ Acts::CylinderSurface::mergedWith(const CylinderSurface& other, "different phi sectors"); } - ActsScalar newMaxZ = std::max(maxZ, otherMaxZ); - ActsScalar newMinZ = std::min(minZ, otherMinZ); - ActsScalar newHlZ = (newMaxZ - newMinZ) / 2.0; - ActsScalar newMidZ = (newMaxZ + newMinZ) / 2.0; + double newMaxZ = std::max(maxZ, otherMaxZ); + double newMinZ = std::min(minZ, otherMinZ); + double newHlZ = (newMaxZ - newMinZ) / 2.0; + double newMidZ = (newMaxZ + newMinZ) / 2.0; ACTS_VERBOSE("merged: [" << newMinZ << ", " << newMaxZ << "] ~> " << newMidZ << " +- " << newHlZ); @@ -526,7 +526,7 @@ Acts::CylinderSurface::mergedWith(const CylinderSurface& other, // Figure out signed relative rotation Vector2 rotatedX = otherLocal.linear().col(eX).head<2>(); - ActsScalar zrotation = std::atan2(rotatedX[1], rotatedX[0]); + double zrotation = std::atan2(rotatedX[1], rotatedX[0]); ACTS_VERBOSE("this: [" << avgPhi / 1_degree << " +- " << hlPhi / 1_degree << "]"); @@ -535,7 +535,7 @@ Acts::CylinderSurface::mergedWith(const CylinderSurface& other, ACTS_VERBOSE("Relative rotation around local z: " << zrotation / 1_degree); - ActsScalar prevOtherAvgPhi = otherAvgPhi; + double prevOtherAvgPhi = otherAvgPhi; otherAvgPhi = detail::radian_sym(otherAvgPhi + zrotation); ACTS_VERBOSE("~> local other average phi: " << otherAvgPhi / 1_degree diff --git a/Core/src/Surfaces/DiscSurface.cpp b/Core/src/Surfaces/DiscSurface.cpp index da1aa2b54bc..91a853e3b8a 100644 --- a/Core/src/Surfaces/DiscSurface.cpp +++ b/Core/src/Surfaces/DiscSurface.cpp @@ -278,7 +278,7 @@ Acts::FreeToBoundMatrix Acts::DiscSurface::freeToBoundJacobian( Acts::SurfaceMultiIntersection Acts::DiscSurface::intersect( const GeometryContext& gctx, const Vector3& position, const Vector3& direction, const BoundaryTolerance& boundaryTolerance, - ActsScalar tolerance) const { + double tolerance) const { // Get the contextual transform auto gctxTransform = transform(gctx); // Use the intersection helper for planar surfaces @@ -425,25 +425,25 @@ Acts::DiscSurface::mergedWith(const DiscSurface& other, BinningValue direction, "DiscSurface::merge: surfaces have bounds other than radial"); } - ActsScalar minR = bounds->get(RadialBounds::eMinR); - ActsScalar maxR = bounds->get(RadialBounds::eMaxR); + double minR = bounds->get(RadialBounds::eMinR); + double maxR = bounds->get(RadialBounds::eMaxR); - ActsScalar hlPhi = bounds->get(RadialBounds::eHalfPhiSector); - ActsScalar avgPhi = bounds->get(RadialBounds::eAveragePhi); - ActsScalar minPhi = detail::radian_sym(-hlPhi + avgPhi); - ActsScalar maxPhi = detail::radian_sym(hlPhi + avgPhi); + double hlPhi = bounds->get(RadialBounds::eHalfPhiSector); + double avgPhi = bounds->get(RadialBounds::eAveragePhi); + double minPhi = detail::radian_sym(-hlPhi + avgPhi); + double maxPhi = detail::radian_sym(hlPhi + avgPhi); ACTS_VERBOSE(" this: r = [" << minR << ", " << maxR << "]"); ACTS_VERBOSE(" phi = [" << minPhi / 1_degree << ", " << maxPhi / 1_degree << "] ~> " << avgPhi / 1_degree << " +- " << hlPhi / 1_degree); - ActsScalar otherMinR = otherBounds->get(RadialBounds::eMinR); - ActsScalar otherMaxR = otherBounds->get(RadialBounds::eMaxR); - ActsScalar otherAvgPhi = otherBounds->get(RadialBounds::eAveragePhi); - ActsScalar otherHlPhi = otherBounds->get(RadialBounds::eHalfPhiSector); - ActsScalar otherMinPhi = detail::radian_sym(-otherHlPhi + otherAvgPhi); - ActsScalar otherMaxPhi = detail::radian_sym(otherHlPhi + otherAvgPhi); + double otherMinR = otherBounds->get(RadialBounds::eMinR); + double otherMaxR = otherBounds->get(RadialBounds::eMaxR); + double otherAvgPhi = otherBounds->get(RadialBounds::eAveragePhi); + double otherHlPhi = otherBounds->get(RadialBounds::eHalfPhiSector); + double otherMinPhi = detail::radian_sym(-otherHlPhi + otherAvgPhi); + double otherMaxPhi = detail::radian_sym(otherHlPhi + otherAvgPhi); ACTS_VERBOSE("other: r = [" << otherMinR << ", " << otherMaxR << "]"); ACTS_VERBOSE(" phi = [" << otherMinPhi / 1_degree << ", " @@ -481,8 +481,8 @@ Acts::DiscSurface::mergedWith(const DiscSurface& other, BinningValue direction, "DiscSurface::merge: surfaces have different half phi sector"); } - ActsScalar newMinR = std::min(minR, otherMinR); - ActsScalar newMaxR = std::max(maxR, otherMaxR); + double newMinR = std::min(minR, otherMinR); + double newMaxR = std::max(maxR, otherMaxR); ACTS_VERBOSE(" new: r = [" << newMinR << ", " << newMaxR << "]"); auto newBounds = @@ -502,7 +502,7 @@ Acts::DiscSurface::mergedWith(const DiscSurface& other, BinningValue direction, // Figure out signed relative rotation Vector2 rotatedX = otherLocal.linear().col(eX).head<2>(); - ActsScalar zrotation = std::atan2(rotatedX[1], rotatedX[0]); + double zrotation = std::atan2(rotatedX[1], rotatedX[0]); ACTS_VERBOSE("this: [" << avgPhi / 1_degree << " +- " << hlPhi / 1_degree << "]"); @@ -511,7 +511,7 @@ Acts::DiscSurface::mergedWith(const DiscSurface& other, BinningValue direction, ACTS_VERBOSE("Relative rotation around local z: " << zrotation / 1_degree); - ActsScalar prevOtherAvgPhi = otherAvgPhi; + double prevOtherAvgPhi = otherAvgPhi; otherAvgPhi = detail::radian_sym(otherAvgPhi + zrotation); ACTS_VERBOSE("~> local other average phi: " << otherAvgPhi / 1_degree diff --git a/Core/src/Surfaces/IntersectionHelper2D.cpp b/Core/src/Surfaces/IntersectionHelper2D.cpp index 1053021034f..9d25a511ec7 100644 --- a/Core/src/Surfaces/IntersectionHelper2D.cpp +++ b/Core/src/Surfaces/IntersectionHelper2D.cpp @@ -17,11 +17,11 @@ Acts::Intersection2D Acts::detail::IntersectionHelper2D::intersectSegment( const Vector2& s0, const Vector2& s1, const Vector2& origin, const Vector2& dir, bool boundCheck) { - using Line = Eigen::ParametrizedLine; - using Plane = Eigen::Hyperplane; + using Line = Eigen::ParametrizedLine; + using Plane = Eigen::Hyperplane; Vector2 edge(s1 - s0); - ActsScalar det = edge.x() * dir.y() - edge.y() * dir.x(); + double det = edge.x() * dir.y() - edge.y() * dir.x(); if (std::abs(det) < s_epsilon) { return Intersection2D::invalid(); } @@ -41,8 +41,7 @@ Acts::Intersection2D Acts::detail::IntersectionHelper2D::intersectSegment( } std::array -Acts::detail::IntersectionHelper2D::intersectEllipse(ActsScalar Rx, - ActsScalar Ry, +Acts::detail::IntersectionHelper2D::intersectEllipse(double Rx, double Ry, const Vector2& origin, const Vector2& dir) { auto createSolution = @@ -51,8 +50,8 @@ Acts::detail::IntersectionHelper2D::intersectEllipse(ActsScalar Rx, Vector2 toSolD(sol - origin); Vector2 toAltD(alt - origin); - ActsScalar solD = std::copysign(toSolD.norm(), toSolD.dot(dir)); - ActsScalar altD = std::copysign(toAltD.norm(), toAltD.dot(dir)); + double solD = std::copysign(toSolD.norm(), toSolD.dot(dir)); + double altD = std::copysign(toAltD.norm(), toAltD.dot(dir)); if (std::abs(solD) < std::abs(altD)) { return {Intersection2D(sol, solD, Intersection2D::Status::reachable), @@ -64,10 +63,10 @@ Acts::detail::IntersectionHelper2D::intersectEllipse(ActsScalar Rx, // Special cases first if (std::abs(dir.x()) < s_epsilon) { - ActsScalar solx = origin.x(); - ActsScalar D = 1. - solx * solx / (Rx * Rx); + double solx = origin.x(); + double D = 1. - solx * solx / (Rx * Rx); if (D > 0.) { - ActsScalar sqrtD = std::sqrt(D); + double sqrtD = std::sqrt(D); Vector2 sol(solx, Ry * sqrtD); Vector2 alt(solx, -Ry * sqrtD); return createSolution(sol, alt); @@ -78,10 +77,10 @@ Acts::detail::IntersectionHelper2D::intersectEllipse(ActsScalar Rx, } return {Intersection2D::invalid(), Intersection2D::invalid()}; } else if (std::abs(dir.y()) < s_epsilon) { - ActsScalar soly = origin.y(); - ActsScalar D = 1. - soly * soly / (Ry * Ry); + double soly = origin.y(); + double D = 1. - soly * soly / (Ry * Ry); if (D > 0.) { - ActsScalar sqrtD = std::sqrt(D); + double sqrtD = std::sqrt(D); Vector2 sol(Rx * sqrtD, soly); Vector2 alt(-Rx * sqrtD, soly); return createSolution(sol, alt); @@ -93,23 +92,23 @@ Acts::detail::IntersectionHelper2D::intersectEllipse(ActsScalar Rx, return {Intersection2D::invalid(), Intersection2D::invalid()}; } // General solution - ActsScalar k = dir.y() / dir.x(); - ActsScalar d = origin.y() - k * origin.x(); - ActsScalar Ry2 = Ry * Ry; - ActsScalar alpha = 1. / (Rx * Rx) + k * k / Ry2; - ActsScalar beta = 2. * k * d / Ry2; - ActsScalar gamma = d * d / Ry2 - 1; + double k = dir.y() / dir.x(); + double d = origin.y() - k * origin.x(); + double Ry2 = Ry * Ry; + double alpha = 1. / (Rx * Rx) + k * k / Ry2; + double beta = 2. * k * d / Ry2; + double gamma = d * d / Ry2 - 1; Acts::detail::RealQuadraticEquation solver(alpha, beta, gamma); if (solver.solutions == 1) { - ActsScalar x = solver.first; + double x = solver.first; Vector2 sol(x, k * x + d); Vector2 toSolD(sol - origin); - ActsScalar solD = std::copysign(toSolD.norm(), toSolD.dot(dir)); + double solD = std::copysign(toSolD.norm(), toSolD.dot(dir)); return {Intersection2D(sol, solD, Intersection2D::Status::reachable), Intersection2D::invalid()}; } else if (solver.solutions > 1) { - ActsScalar x0 = solver.first; - ActsScalar x1 = solver.second; + double x0 = solver.first; + double x1 = solver.second; Vector2 sol(x0, k * x0 + d); Vector2 alt(x1, k * x1 + d); return createSolution(sol, alt); @@ -118,12 +117,12 @@ Acts::detail::IntersectionHelper2D::intersectEllipse(ActsScalar Rx, } Acts::Intersection2D Acts::detail::IntersectionHelper2D::intersectCircleSegment( - ActsScalar R, ActsScalar phiMin, ActsScalar phiMax, const Vector2& origin, + double R, double phiMin, double phiMax, const Vector2& origin, const Vector2& dir) { auto intersections = intersectCircle(R, origin, dir); for (const auto& candidate : intersections) { if (candidate.pathLength() > 0.) { - ActsScalar phi = Acts::VectorHelpers::phi(candidate.position()); + double phi = Acts::VectorHelpers::phi(candidate.position()); if (phi > phiMin && phi < phiMax) { return candidate; } diff --git a/Core/src/Surfaces/LineSurface.cpp b/Core/src/Surfaces/LineSurface.cpp index f67fe038aa9..84d9b126e9b 100644 --- a/Core/src/Surfaces/LineSurface.cpp +++ b/Core/src/Surfaces/LineSurface.cpp @@ -149,7 +149,7 @@ const Acts::SurfaceBounds& Acts::LineSurface::bounds() const { Acts::SurfaceMultiIntersection Acts::LineSurface::intersect( const GeometryContext& gctx, const Vector3& position, const Vector3& direction, const BoundaryTolerance& boundaryTolerance, - ActsScalar tolerance) const { + double tolerance) const { // The nomenclature is following the header file and doxygen documentation const Vector3& ma = position; diff --git a/Core/src/Surfaces/PlaneSurface.cpp b/Core/src/Surfaces/PlaneSurface.cpp index 658920e6686..237108698bb 100644 --- a/Core/src/Surfaces/PlaneSurface.cpp +++ b/Core/src/Surfaces/PlaneSurface.cpp @@ -160,7 +160,7 @@ double Acts::PlaneSurface::pathCorrection(const GeometryContext& gctx, Acts::SurfaceMultiIntersection Acts::PlaneSurface::intersect( const GeometryContext& gctx, const Vector3& position, const Vector3& direction, const BoundaryTolerance& boundaryTolerance, - ActsScalar tolerance) const { + double tolerance) const { // Get the contextual transform const auto& gctxTransform = transform(gctx); // Use the intersection helper for planar surfaces diff --git a/Core/src/Surfaces/Surface.cpp b/Core/src/Surfaces/Surface.cpp index cadef176cda..0fbfe6bc982 100644 --- a/Core/src/Surfaces/Surface.cpp +++ b/Core/src/Surfaces/Surface.cpp @@ -314,7 +314,7 @@ Acts::FreeToPathMatrix Acts::Surface::freeToPathDerivative( // The measurement frame z axis const Vector3 refZAxis = rframe.col(2); // Cosine of angle between momentum direction and measurement frame z axis - const ActsScalar dz = refZAxis.dot(direction); + const double dz = refZAxis.dot(direction); // Initialize the derivative FreeToPathMatrix freeToPath = FreeToPathMatrix::Zero(); freeToPath.segment<3>(eFreePos0) = -1.0 * refZAxis.transpose() / dz; diff --git a/Core/src/Surfaces/detail/AnnulusBoundsHelper.cpp b/Core/src/Surfaces/detail/AnnulusBoundsHelper.cpp index 47cb4e2e9a6..b46bfaf5b8a 100644 --- a/Core/src/Surfaces/detail/AnnulusBoundsHelper.cpp +++ b/Core/src/Surfaces/detail/AnnulusBoundsHelper.cpp @@ -16,7 +16,7 @@ std::tuple, Acts::Transform3> Acts::detail::AnnulusBoundsHelper::create(const Transform3& transform, - ActsScalar rMin, ActsScalar rMax, + double rMin, double rMax, std::vector vertices) { using Line2D = Eigen::Hyperplane; diff --git a/Core/src/Surfaces/detail/MergeHelper.cpp b/Core/src/Surfaces/detail/MergeHelper.cpp index 414e5761686..ca394efd4e8 100644 --- a/Core/src/Surfaces/detail/MergeHelper.cpp +++ b/Core/src/Surfaces/detail/MergeHelper.cpp @@ -12,9 +12,10 @@ namespace Acts::detail { -std::tuple mergedPhiSector( - ActsScalar hlPhi1, ActsScalar avgPhi1, ActsScalar hlPhi2, - ActsScalar avgPhi2, const Logger& logger, ActsScalar tolerance) { +std::tuple mergedPhiSector(double hlPhi1, double avgPhi1, + double hlPhi2, double avgPhi2, + const Logger& logger, + double tolerance) { using namespace Acts::UnitLiterals; if (std::abs(hlPhi1 - std::numbers::pi / 2.) < tolerance && @@ -33,8 +34,8 @@ std::tuple mergedPhiSector( "Phi sectors cover half a circle but are not opposite"); } - ActsScalar newAvgPhi = detail::radian_sym(avgPhi1 + std::numbers::pi / 2.); - ActsScalar newHlPhi = std::numbers::pi; + double newAvgPhi = detail::radian_sym(avgPhi1 + std::numbers::pi / 2.); + double newHlPhi = std::numbers::pi; ACTS_VERBOSE("merged: [" << detail::radian_sym(newAvgPhi - newHlPhi) / 1_degree << ", " << detail::radian_sym(newAvgPhi + newHlPhi) / 1_degree @@ -43,27 +44,27 @@ std::tuple mergedPhiSector( return {newHlPhi, newAvgPhi, false}; } - ActsScalar minPhi1 = detail::radian_sym(-hlPhi1 + avgPhi1); - ActsScalar maxPhi1 = detail::radian_sym(hlPhi1 + avgPhi1); + double minPhi1 = detail::radian_sym(-hlPhi1 + avgPhi1); + double maxPhi1 = detail::radian_sym(hlPhi1 + avgPhi1); ACTS_VERBOSE("one: [" << minPhi1 / 1_degree << ", " << maxPhi1 / 1_degree << "] ~> " << avgPhi1 / 1_degree << " +- " << hlPhi1 / 1_degree); - ActsScalar maxPhi2 = detail::radian_sym(hlPhi2 + avgPhi2); - ActsScalar minPhi2 = detail::radian_sym(-hlPhi2 + avgPhi2); + double maxPhi2 = detail::radian_sym(hlPhi2 + avgPhi2); + double minPhi2 = detail::radian_sym(-hlPhi2 + avgPhi2); ACTS_VERBOSE("two: [" << minPhi2 / 1_degree << ", " << maxPhi2 / 1_degree << "] ~> " << avgPhi2 / 1_degree << " +- " << hlPhi2 / 1_degree); ACTS_VERBOSE("Checking for CCW or CW ordering"); - auto same = [tolerance](ActsScalar a, ActsScalar b) { + auto same = [tolerance](double a, double b) { return std::abs(a - b) < tolerance; }; - ActsScalar newMaxPhi{}, newMinPhi{}; - ActsScalar newHlPhi = hlPhi1 + hlPhi2; + double newMaxPhi{}, newMinPhi{}; + double newHlPhi = hlPhi1 + hlPhi2; bool reversed = false; if (same(minPhi1, maxPhi2)) { @@ -81,7 +82,7 @@ std::tuple mergedPhiSector( throw std::invalid_argument("Phi ranges are incompatible"); } - ActsScalar newAvgPhi = detail::radian_sym(newMinPhi + newHlPhi); + double newAvgPhi = detail::radian_sym(newMinPhi + newHlPhi); ACTS_VERBOSE("merged: [" << newMinPhi / 1_degree << ", " << newMaxPhi / 1_degree << "] ~> " diff --git a/Core/src/Surfaces/detail/VerticesHelper.cpp b/Core/src/Surfaces/detail/VerticesHelper.cpp index e97d75d45bf..98a00deb142 100644 --- a/Core/src/Surfaces/detail/VerticesHelper.cpp +++ b/Core/src/Surfaces/detail/VerticesHelper.cpp @@ -13,9 +13,9 @@ #include #include -std::vector Acts::detail::VerticesHelper::phiSegments( - ActsScalar phiMin, ActsScalar phiMax, - const std::vector& phiRefs, unsigned int quarterSegments) { +std::vector Acts::detail::VerticesHelper::phiSegments( + double phiMin, double phiMax, const std::vector& phiRefs, + unsigned int quarterSegments) { // Check that the phi range is valid if (phiMin > phiMax) { throw std::invalid_argument( @@ -24,7 +24,7 @@ std::vector Acts::detail::VerticesHelper::phiSegments( } // First check that no reference phi is outside the range - for (ActsScalar phiRef : phiRefs) { + for (double phiRef : phiRefs) { if (phiRef < phiMin || phiRef > phiMax) { throw std::invalid_argument( "VerticesHelper::phiSegments ... Reference phi is outside the range " @@ -36,16 +36,16 @@ std::vector Acts::detail::VerticesHelper::phiSegments( "VerticesHelper::phiSegments ... Number of segments must be larger " "than 0."); } - std::vector phiSegments = {phiMin, phiMax}; + std::vector phiSegments = {phiMin, phiMax}; // Minimum approximation for a circle need // - if the circle is closed the last point is given twice for (unsigned int i = 0; i < 4 * quarterSegments + 1; ++i) { - ActsScalar phiExt = + double phiExt = -std::numbers::pi + i * 2 * std::numbers::pi / (4 * quarterSegments); if (phiExt > phiMin && phiExt < phiMax && - std::ranges::none_of(phiSegments, [&phiExt](ActsScalar phi) { + std::ranges::none_of(phiSegments, [&phiExt](double phi) { return std::abs(phi - phiExt) < - std::numeric_limits::epsilon(); + std::numeric_limits::epsilon(); })) { phiSegments.push_back(phiExt); } @@ -53,9 +53,9 @@ std::vector Acts::detail::VerticesHelper::phiSegments( // Add the reference phis for (const auto& phiRef : phiRefs) { if (phiRef > phiMin && phiRef < phiMax) { - if (std::ranges::none_of(phiSegments, [&phiRef](ActsScalar phi) { + if (std::ranges::none_of(phiSegments, [&phiRef](double phi) { return std::abs(phi - phiRef) < - std::numeric_limits::epsilon(); + std::numeric_limits::epsilon(); })) { phiSegments.push_back(phiRef); } @@ -68,9 +68,8 @@ std::vector Acts::detail::VerticesHelper::phiSegments( } std::vector Acts::detail::VerticesHelper::ellipsoidVertices( - ActsScalar innerRx, ActsScalar innerRy, ActsScalar outerRx, - ActsScalar outerRy, ActsScalar avgPhi, ActsScalar halfPhi, - unsigned int quarterSegments) { + double innerRx, double innerRy, double outerRx, double outerRy, + double avgPhi, double halfPhi, unsigned int quarterSegments) { // List of vertices counter-clockwise starting at smallest phi w.r.t center, // for both inner/outer ring/segment std::vector rvertices; // return vertices @@ -80,7 +79,7 @@ std::vector Acts::detail::VerticesHelper::ellipsoidVertices( bool innerExists = (innerRx > 0. && innerRy > 0.); bool closed = std::abs(halfPhi - std::numbers::pi) < s_onSurfaceTolerance; - std::vector refPhi = {}; + std::vector refPhi = {}; if (avgPhi != 0.) { refPhi.push_back(avgPhi); } @@ -113,20 +112,20 @@ std::vector Acts::detail::VerticesHelper::ellipsoidVertices( } std::vector Acts::detail::VerticesHelper::circularVertices( - ActsScalar innerR, ActsScalar outerR, ActsScalar avgPhi, ActsScalar halfPhi, + double innerR, double outerR, double avgPhi, double halfPhi, unsigned int quarterSegments) { return ellipsoidVertices(innerR, innerR, outerR, outerR, avgPhi, halfPhi, quarterSegments); } bool Acts::detail::VerticesHelper::onHyperPlane( - const std::vector& vertices, ActsScalar tolerance) { + const std::vector& vertices, double tolerance) { // Obvious always on one surface if (vertices.size() < 4) { return true; } // Create the hyperplane - auto hyperPlane = Eigen::Hyperplane::Through( + auto hyperPlane = Eigen::Hyperplane::Through( vertices[0], vertices[1], vertices[2]); for (std::size_t ip = 3; ip < vertices.size(); ++ip) { if (hyperPlane.absDistance(vertices[ip]) > tolerance) { diff --git a/Core/src/TrackFitting/GsfUtils.cpp b/Core/src/TrackFitting/GsfUtils.cpp index ae5b47ca700..b70544e47c6 100644 --- a/Core/src/TrackFitting/GsfUtils.cpp +++ b/Core/src/TrackFitting/GsfUtils.cpp @@ -17,10 +17,10 @@ namespace Acts::detail { using TrackStateTraits = TrackStateTraits; -ActsScalar calculateDeterminant( - const double* fullCalibratedCovariance, - TrackStateTraits::Covariance predictedCovariance, - TrackStateTraits::Projector projector, unsigned int calibratedSize) { +double calculateDeterminant(const double* fullCalibratedCovariance, + TrackStateTraits::Covariance predictedCovariance, + TrackStateTraits::Projector projector, + unsigned int calibratedSize) { return visit_measurement(calibratedSize, [&](auto N) { constexpr std::size_t kMeasurementSize = decltype(N)::value; diff --git a/Core/src/TrackFitting/MbfSmoother.cpp b/Core/src/TrackFitting/MbfSmoother.cpp index 2614834aadb..e260a578e38 100644 --- a/Core/src/TrackFitting/MbfSmoother.cpp +++ b/Core/src/TrackFitting/MbfSmoother.cpp @@ -44,11 +44,11 @@ void MbfSmoother::visitMeasurement(const InternalTrackState& ts, constexpr std::size_t kMeasurementSize = decltype(N)::value; using MeasurementMatrix = - Eigen::Matrix; + Eigen::Matrix; using CovarianceMatrix = - Eigen::Matrix; + Eigen::Matrix; using KalmanGainMatrix = - Eigen::Matrix; + Eigen::Matrix; typename TrackStateTraits::Calibrated calibrated{ measurement.calibrated}; @@ -71,12 +71,12 @@ void MbfSmoother::visitMeasurement(const InternalTrackState& ts, const KalmanGainMatrix K = (ts.predictedCovariance * H.transpose() * SInv); const Acts::BoundMatrix CHat = (Acts::BoundMatrix::Identity() - K * H); - const Eigen::Matrix y = + const Eigen::Matrix y = (calibrated - H * ts.predicted); const Acts::BoundMatrix bigLambdaTilde = (H.transpose() * SInv * H + CHat.transpose() * bigLambdaHat * CHat); - const Eigen::Matrix smallLambdaTilde = + const Eigen::Matrix smallLambdaTilde = (-H.transpose() * SInv * y + CHat.transpose() * smallLambdaHat); bigLambdaHat = F.transpose() * bigLambdaTilde * F; diff --git a/Core/src/Utilities/SpacePointUtility.cpp b/Core/src/Utilities/SpacePointUtility.cpp index 7018db37830..32470e1ebb9 100644 --- a/Core/src/Utilities/SpacePointUtility.cpp +++ b/Core/src/Utilities/SpacePointUtility.cpp @@ -51,8 +51,7 @@ Result SpacePointUtility::differenceOfMeasurementsChecked( return Result::success(diffTheta2 + diffPhi2); } -std::tuple, Vector2, - std::optional> +std::tuple, Vector2, std::optional> SpacePointUtility::globalCoords( const GeometryContext& gctx, const SourceLink& slink, const SourceLinkSurfaceAccessor& surfaceAccessor, const BoundVector& par, @@ -93,8 +92,8 @@ SpacePointUtility::globalCoords( // optionally set time // TODO the current condition of checking the covariance is not optional but // should do for now - std::optional globalTime = par[eBoundTime]; - std::optional tcov = cov(eBoundTime, eBoundTime); + std::optional globalTime = par[eBoundTime]; + std::optional tcov = cov(eBoundTime, eBoundTime); if (tcov.value() <= 0) { globalTime = std::nullopt; tcov = std::nullopt; diff --git a/Core/src/Vertexing/HelicalTrackLinearizer.cpp b/Core/src/Vertexing/HelicalTrackLinearizer.cpp index 9d529745559..e42bc9d0aad 100644 --- a/Core/src/Vertexing/HelicalTrackLinearizer.cpp +++ b/Core/src/Vertexing/HelicalTrackLinearizer.cpp @@ -68,40 +68,40 @@ Acts::HelicalTrackLinearizer::linearizeTrack( // Extracting Perigee parameters and compute functions of them for later // usage - ActsScalar d0 = paramsAtPCA(BoundIndices::eBoundLoc0); + double d0 = paramsAtPCA(BoundIndices::eBoundLoc0); - ActsScalar phi = paramsAtPCA(BoundIndices::eBoundPhi); - ActsScalar sinPhi = std::sin(phi); - ActsScalar cosPhi = std::cos(phi); + double phi = paramsAtPCA(BoundIndices::eBoundPhi); + double sinPhi = std::sin(phi); + double cosPhi = std::cos(phi); - ActsScalar theta = paramsAtPCA(BoundIndices::eBoundTheta); - ActsScalar sinTheta = std::sin(theta); - ActsScalar tanTheta = std::tan(theta); + double theta = paramsAtPCA(BoundIndices::eBoundTheta); + double sinTheta = std::sin(theta); + double tanTheta = std::tan(theta); // q over p - ActsScalar qOvP = paramsAtPCA(BoundIndices::eBoundQOverP); + double qOvP = paramsAtPCA(BoundIndices::eBoundQOverP); // Rest mass - ActsScalar m0 = params.particleHypothesis().mass(); + double m0 = params.particleHypothesis().mass(); // Momentum - ActsScalar p = params.particleHypothesis().extractMomentum(qOvP); + double p = params.particleHypothesis().extractMomentum(qOvP); // Speed in units of c - ActsScalar beta = p / fastHypot(p, m0); + double beta = p / fastHypot(p, m0); // Transverse speed (i.e., speed in the x-y plane) - ActsScalar betaT = beta * sinTheta; + double betaT = beta * sinTheta; // Momentum direction at the PCA Vector3 momentumAtPCA(phi, theta, qOvP); // Particle charge - ActsScalar absoluteCharge = params.particleHypothesis().absoluteCharge(); + double absoluteCharge = params.particleHypothesis().absoluteCharge(); // get the z-component of the B-field at the PCA auto field = m_cfg.bField->getField(VectorHelpers::position(pca), fieldCache); if (!field.ok()) { return field.error(); } - ActsScalar Bz = (*field)[eZ]; + double Bz = (*field)[eZ]; // Complete Jacobian (consists of positionJacobian and momentumJacobian) ActsMatrix completeJacobian = @@ -142,24 +142,24 @@ Acts::HelicalTrackLinearizer::linearizeTrack( completeJacobian(eBoundTime, eLinPhi) = -d0 / betaT; } else { // Helix radius - ActsScalar rho = sinTheta * (1. / qOvP) / Bz; + double rho = sinTheta * (1. / qOvP) / Bz; // Sign of helix radius - ActsScalar h = (rho < 0.) ? -1 : 1; + double h = (rho < 0.) ? -1 : 1; // Quantities from Eq. 5.34 in Ref. (1) (see .hpp) - ActsScalar X = pca(0) - perigeeSurface.center(gctx).x() + rho * sinPhi; - ActsScalar Y = pca(1) - perigeeSurface.center(gctx).y() - rho * cosPhi; - ActsScalar S2 = (X * X + Y * Y); + double X = pca(0) - perigeeSurface.center(gctx).x() + rho * sinPhi; + double Y = pca(1) - perigeeSurface.center(gctx).y() - rho * cosPhi; + double S2 = (X * X + Y * Y); // S is the 2D distance from the helix center to the reference point // in the x-y plane - ActsScalar S = std::sqrt(S2); + double S = std::sqrt(S2); - ActsScalar XoverS2 = X / S2; - ActsScalar YoverS2 = Y / S2; - ActsScalar rhoCotTheta = rho / tanTheta; - ActsScalar rhoOverBetaT = rho / betaT; + double XoverS2 = X / S2; + double YoverS2 = Y / S2; + double rhoCotTheta = rho / tanTheta; + double rhoOverBetaT = rho / betaT; // Absolute value of rho over S - ActsScalar absRhoOverS = h * rho / S; + double absRhoOverS = h * rho / S; // Derivatives can be found in Eq. 5.36 in Ref. (1) // Since we propagated to the PCA (point P in Ref. (1)), the points diff --git a/Core/src/Vertexing/ImpactPointEstimator.cpp b/Core/src/Vertexing/ImpactPointEstimator.cpp index 3caac09b57b..df9f75fd9fa 100644 --- a/Core/src/Vertexing/ImpactPointEstimator.cpp +++ b/Core/src/Vertexing/ImpactPointEstimator.cpp @@ -193,7 +193,7 @@ Result> getDistanceAndMomentumImpl( Vector3 positionOnTrack = trkParams.position(gctx); // Distance between positionOnTrack and the 3D PCA - ActsScalar distanceToPca = + double distanceToPca = (vtxPos.template head<3>() - positionOnTrack).dot(momDirStraightTrack); // 3D PCA @@ -204,11 +204,11 @@ Result> getDistanceAndMomentumImpl( // Track time at positionOnTrack double timeOnTrack = trkParams.parameters()[BoundIndices::eBoundTime]; - ActsScalar m0 = trkParams.particleHypothesis().mass(); - ActsScalar p = trkParams.particleHypothesis().extractMomentum(qOvP); + double m0 = trkParams.particleHypothesis().mass(); + double p = trkParams.particleHypothesis().extractMomentum(qOvP); // Speed in units of c - ActsScalar beta = p / fastHypot(p, m0); + double beta = p / fastHypot(p, m0); pcaStraightTrack[3] = timeOnTrack + distanceToPca / beta; } @@ -279,11 +279,11 @@ Result> getDistanceAndMomentumImpl( // Time at the 2D PCA P double tP = trkParams.parameters()[BoundIndices::eBoundTime]; - ActsScalar m0 = trkParams.particleHypothesis().mass(); - ActsScalar p = trkParams.particleHypothesis().extractMomentum(qOvP); + double m0 = trkParams.particleHypothesis().mass(); + double p = trkParams.particleHypothesis().extractMomentum(qOvP); // Speed in units of c - ActsScalar beta = p / fastHypot(p, m0); + double beta = p / fastHypot(p, m0); pca[3] = tP - rho / (beta * sinTheta) * (phi - phiP); } diff --git a/Core/src/Vertexing/NumericalTrackLinearizer.cpp b/Core/src/Vertexing/NumericalTrackLinearizer.cpp index ca9af5825e4..c7928a23258 100644 --- a/Core/src/Vertexing/NumericalTrackLinearizer.cpp +++ b/Core/src/Vertexing/NumericalTrackLinearizer.cpp @@ -78,10 +78,10 @@ Acts::NumericalTrackLinearizer::linearizeTrack( // Fill "paramVec", "pca", and "momentumAtPCA" { Vector3 globalCoords = endParams.position(gctx); - ActsScalar globalTime = endParams.time(); - ActsScalar phi = perigeeParams(BoundIndices::eBoundPhi); - ActsScalar theta = perigeeParams(BoundIndices::eBoundTheta); - ActsScalar qOvP = perigeeParams(BoundIndices::eBoundQOverP); + double globalTime = endParams.time(); + double phi = perigeeParams(BoundIndices::eBoundPhi); + double theta = perigeeParams(BoundIndices::eBoundTheta); + double qOvP = perigeeParams(BoundIndices::eBoundQOverP); paramVec << globalCoords, globalTime, phi, theta, qOvP; pca << globalCoords, globalTime; diff --git a/Core/src/Vertexing/Vertex.cpp b/Core/src/Vertexing/Vertex.cpp index 0a8eda8c279..7c2c54cc7ac 100644 --- a/Core/src/Vertexing/Vertex.cpp +++ b/Core/src/Vertexing/Vertex.cpp @@ -37,7 +37,7 @@ Vector3 Vertex::position() const { return VectorHelpers::position(m_position); } -ActsScalar Vertex::time() const { +double Vertex::time() const { return m_position[eTime]; } @@ -85,7 +85,7 @@ void Vertex::setFullPosition(const Vector4& fullPosition) { m_position = fullPosition; } -void Vertex::setTime(ActsScalar time) { +void Vertex::setTime(double time) { m_position[eTime] = time; } diff --git a/Examples/Algorithms/Digitization/include/ActsExamples/Digitization/DigitizationConfig.hpp b/Examples/Algorithms/Digitization/include/ActsExamples/Digitization/DigitizationConfig.hpp index 6a933f50075..5fce6107f1e 100644 --- a/Examples/Algorithms/Digitization/include/ActsExamples/Digitization/DigitizationConfig.hpp +++ b/Examples/Algorithms/Digitization/include/ActsExamples/Digitization/DigitizationConfig.hpp @@ -72,10 +72,10 @@ struct GeometricConfig { bool strip = false; /// The variances for this digitization - std::map> varianceMap = {}; + std::map> varianceMap = {}; /// Charge generation (configurable via the chargeSmearer) - Acts::ActsScalar charge(Acts::ActsScalar path, RandomEngine &rng) const { + double charge(double path, RandomEngine &rng) const { if (!chargeSmearer) { return path; } @@ -96,9 +96,8 @@ struct GeometricConfig { /// @param cmins is the cluster minimum in the different dimensions /// /// @return a vector of variances for the cluster - std::vector variances( - const std::array &csizes, - const std::array &cmins) const; + std::vector variances(const std::array &csizes, + const std::array &cmins) const; /// Drift generation (currently not implemented) /// Takes as an argument the position, and a random engine diff --git a/Examples/Algorithms/Digitization/include/ActsExamples/Digitization/MeasurementCreation.hpp b/Examples/Algorithms/Digitization/include/ActsExamples/Digitization/MeasurementCreation.hpp index 667e0c9f4c3..ce139065e20 100644 --- a/Examples/Algorithms/Digitization/include/ActsExamples/Digitization/MeasurementCreation.hpp +++ b/Examples/Algorithms/Digitization/include/ActsExamples/Digitization/MeasurementCreation.hpp @@ -26,8 +26,8 @@ namespace ActsExamples { /// Is public as it is also used by the I/O system struct DigitizedParameters { std::vector indices = {}; - std::vector values = {}; - std::vector variances = {}; + std::vector values = {}; + std::vector variances = {}; Cluster cluster; }; diff --git a/Examples/Algorithms/Digitization/include/ActsExamples/Digitization/ModuleClusters.hpp b/Examples/Algorithms/Digitization/include/ActsExamples/Digitization/ModuleClusters.hpp index 675f86af07d..f0ef3e8c75a 100644 --- a/Examples/Algorithms/Digitization/include/ActsExamples/Digitization/ModuleClusters.hpp +++ b/Examples/Algorithms/Digitization/include/ActsExamples/Digitization/ModuleClusters.hpp @@ -29,8 +29,8 @@ struct DigitizedParameters; struct ModuleValue { std::vector paramIndices = {}; - std::vector paramValues = {}; - std::vector paramVariances = {}; + std::vector paramValues = {}; + std::vector paramVariances = {}; std::variant value; std::set sources = {}; Acts::Ccl::Label label = {Acts::Ccl::NO_LABEL}; diff --git a/Examples/Algorithms/Digitization/src/DigitizationAlgorithm.cpp b/Examples/Algorithms/Digitization/src/DigitizationAlgorithm.cpp index 72f3905ab57..9c4822c774b 100644 --- a/Examples/Algorithms/Digitization/src/DigitizationAlgorithm.cpp +++ b/Examples/Algorithms/Digitization/src/DigitizationAlgorithm.cpp @@ -333,7 +333,7 @@ ActsExamples::DigitizationAlgorithm::localParameters( const auto& binningData = geoCfg.segmentation.binningData(); - Acts::ActsScalar totalWeight = 0.; + double totalWeight = 0.; Acts::Vector2 m(0., 0.); std::size_t b0min = std::numeric_limits::max(); std::size_t b0max = 0; @@ -342,8 +342,7 @@ ActsExamples::DigitizationAlgorithm::localParameters( // Combine the channels for (const auto& ch : channels) { auto bin = ch.bin; - Acts::ActsScalar charge = - geoCfg.digital ? 1. : geoCfg.charge(ch.activation, rng); + double charge = geoCfg.digital ? 1. : geoCfg.charge(ch.activation, rng); if (geoCfg.digital || charge > geoCfg.threshold) { totalWeight += charge; std::size_t b0 = bin[0]; diff --git a/Examples/Algorithms/Digitization/src/DigitizationConfig.cpp b/Examples/Algorithms/Digitization/src/DigitizationConfig.cpp index e19452d1e7a..cad7f04b974 100644 --- a/Examples/Algorithms/Digitization/src/DigitizationConfig.cpp +++ b/Examples/Algorithms/Digitization/src/DigitizationConfig.cpp @@ -60,12 +60,12 @@ ActsExamples::DigitizationConfig::getBoundIndices() const { return bIndexInput; } -std::vector ActsExamples::GeometricConfig::variances( +std::vector ActsExamples::GeometricConfig::variances( const std::array& csizes, const std::array& cmins) const { - std::vector rVariances; + std::vector rVariances; for (const auto& bIndex : indices) { - Acts::ActsScalar var = 0.; + double var = 0.; if (varianceMap.contains(bIndex)) { // Try to find the variance for this cluster size std::size_t lsize = diff --git a/Examples/Algorithms/Digitization/src/DigitizationConfigurator.cpp b/Examples/Algorithms/Digitization/src/DigitizationConfigurator.cpp index e7bd2ddfa09..007a708fed3 100644 --- a/Examples/Algorithms/Digitization/src/DigitizationConfigurator.cpp +++ b/Examples/Algorithms/Digitization/src/DigitizationConfigurator.cpp @@ -82,8 +82,8 @@ void ActsExamples::DigitizationConfigurator::operator()( case Acts::SurfaceBounds::eRectangle: { if (inputSegmentation.binningData()[0].binvalue == Acts::BinningValue::binX) { - Acts::ActsScalar minX = boundValues[Acts::RectangleBounds::eMinX]; - Acts::ActsScalar maxX = boundValues[Acts::RectangleBounds::eMaxX]; + double minX = boundValues[Acts::RectangleBounds::eMinX]; + double maxX = boundValues[Acts::RectangleBounds::eMaxX]; unsigned int nBins = static_cast(std::round( (maxX - minX) / inputSegmentation.binningData()[0].step)); outputSegmentation += Acts::BinUtility( @@ -95,8 +95,8 @@ void ActsExamples::DigitizationConfigurator::operator()( inputSegmentation.dimensions() == 2) { unsigned int accessBin = inputSegmentation.dimensions() == 2 ? 1 : 0; - Acts::ActsScalar minY = boundValues[Acts::RectangleBounds::eMinY]; - Acts::ActsScalar maxY = boundValues[Acts::RectangleBounds::eMaxY]; + double minY = boundValues[Acts::RectangleBounds::eMinY]; + double maxY = boundValues[Acts::RectangleBounds::eMaxY]; unsigned int nBins = static_cast( std::round((maxY - minY) / inputSegmentation.binningData()[accessBin].step)); @@ -110,7 +110,7 @@ void ActsExamples::DigitizationConfigurator::operator()( case Acts::SurfaceBounds::eTrapezoid: { if (inputSegmentation.binningData()[0].binvalue == Acts::BinningValue::binX) { - Acts::ActsScalar maxX = std::max( + double maxX = std::max( boundValues[Acts::TrapezoidBounds::eHalfLengthXnegY], boundValues[Acts::TrapezoidBounds::eHalfLengthXposY]); unsigned int nBins = static_cast(std::round( @@ -124,8 +124,7 @@ void ActsExamples::DigitizationConfigurator::operator()( inputSegmentation.dimensions() == 2) { unsigned int accessBin = inputSegmentation.dimensions() == 2 ? 1 : 0; - Acts::ActsScalar maxY = - boundValues[Acts::TrapezoidBounds::eHalfLengthY]; + double maxY = boundValues[Acts::TrapezoidBounds::eHalfLengthY]; unsigned int nBins = static_cast( std::round((2 * maxY) / inputSegmentation.binningData()[accessBin].step)); @@ -139,8 +138,8 @@ void ActsExamples::DigitizationConfigurator::operator()( case Acts::SurfaceBounds::eAnnulus: { if (inputSegmentation.binningData()[0].binvalue == Acts::BinningValue::binR) { - Acts::ActsScalar minR = boundValues[Acts::AnnulusBounds::eMinR]; - Acts::ActsScalar maxR = boundValues[Acts::AnnulusBounds::eMaxR]; + double minR = boundValues[Acts::AnnulusBounds::eMinR]; + double maxR = boundValues[Acts::AnnulusBounds::eMaxR]; unsigned int nBins = static_cast(std::round( (maxR - minR) / inputSegmentation.binningData()[0].step)); outputSegmentation += Acts::BinUtility( @@ -152,11 +151,10 @@ void ActsExamples::DigitizationConfigurator::operator()( inputSegmentation.dimensions() == 2) { unsigned int accessBin = inputSegmentation.dimensions() == 2 ? 1 : 0; - Acts::ActsScalar averagePhi = - boundValues[Acts::AnnulusBounds::eAveragePhi]; - Acts::ActsScalar minPhi = + double averagePhi = boundValues[Acts::AnnulusBounds::eAveragePhi]; + double minPhi = averagePhi - boundValues[Acts::AnnulusBounds::eMinPhiRel]; - Acts::ActsScalar maxPhi = + double maxPhi = averagePhi + boundValues[Acts::AnnulusBounds::eMaxPhiRel]; unsigned int nBins = static_cast( std::round((maxPhi - minPhi) / @@ -170,10 +168,8 @@ void ActsExamples::DigitizationConfigurator::operator()( // The module is a Disc Trapezoid case Acts::SurfaceBounds::eDiscTrapezoid: { - Acts::ActsScalar minR = - boundValues[Acts::DiscTrapezoidBounds::eMinR]; - Acts::ActsScalar maxR = - boundValues[Acts::DiscTrapezoidBounds::eMaxR]; + double minR = boundValues[Acts::DiscTrapezoidBounds::eMinR]; + double maxR = boundValues[Acts::DiscTrapezoidBounds::eMaxR]; if (inputSegmentation.binningData()[0].binvalue == Acts::BinningValue::binR) { @@ -188,16 +184,16 @@ void ActsExamples::DigitizationConfigurator::operator()( inputSegmentation.dimensions() == 2) { unsigned int accessBin = inputSegmentation.dimensions() == 2 ? 1 : 0; - Acts::ActsScalar hxMinR = + double hxMinR = boundValues[Acts::DiscTrapezoidBounds::eHalfLengthXminR]; - Acts::ActsScalar hxMaxR = + double hxMaxR = boundValues[Acts::DiscTrapezoidBounds::eHalfLengthXmaxR]; - Acts::ActsScalar averagePhi = + double averagePhi = boundValues[Acts::DiscTrapezoidBounds::eAveragePhi]; - Acts::ActsScalar alphaMinR = std::atan2(minR, hxMinR); - Acts::ActsScalar alphaMaxR = std::atan2(maxR, hxMaxR); - Acts::ActsScalar alpha = std::max(alphaMinR, alphaMaxR); + double alphaMinR = std::atan2(minR, hxMinR); + double alphaMaxR = std::atan2(maxR, hxMaxR); + double alpha = std::max(alphaMinR, alphaMaxR); unsigned int nBins = static_cast(std::round( 2 * alpha / inputSegmentation.binningData()[accessBin].step)); outputSegmentation += Acts::BinUtility( @@ -211,8 +207,8 @@ void ActsExamples::DigitizationConfigurator::operator()( case Acts::SurfaceBounds::eDisc: { if (inputSegmentation.binningData()[0].binvalue == Acts::BinningValue::binR) { - Acts::ActsScalar minR = boundValues[Acts::RadialBounds::eMinR]; - Acts::ActsScalar maxR = boundValues[Acts::RadialBounds::eMaxR]; + double minR = boundValues[Acts::RadialBounds::eMinR]; + double maxR = boundValues[Acts::RadialBounds::eMaxR]; unsigned int nBins = static_cast(std::round( (maxR - minR) / inputSegmentation.binningData()[0].step)); outputSegmentation += Acts::BinUtility( @@ -225,12 +221,11 @@ void ActsExamples::DigitizationConfigurator::operator()( unsigned int accessBin = inputSegmentation.dimensions() == 2 ? 1 : 0; - Acts::ActsScalar averagePhi = - boundValues[Acts::RadialBounds::eAveragePhi]; - Acts::ActsScalar halfPhiSector = + double averagePhi = boundValues[Acts::RadialBounds::eAveragePhi]; + double halfPhiSector = boundValues[Acts::RadialBounds::eHalfPhiSector]; - Acts::ActsScalar minPhi = averagePhi - halfPhiSector; - Acts::ActsScalar maxPhi = averagePhi + halfPhiSector; + double minPhi = averagePhi - halfPhiSector; + double maxPhi = averagePhi + halfPhiSector; unsigned int nBins = static_cast( std::round((maxPhi - minPhi) / diff --git a/Examples/Algorithms/Digitization/src/ModuleClusters.cpp b/Examples/Algorithms/Digitization/src/ModuleClusters.cpp index fbe7bb2a901..d8c456c427c 100644 --- a/Examples/Algorithms/Digitization/src/ModuleClusters.cpp +++ b/Examples/Algorithms/Digitization/src/ModuleClusters.cpp @@ -186,12 +186,12 @@ std::vector> ModuleClusters::mergeParameters( for (ModuleValue& thisval : thisvec) { // Loop over non-geometric dimensions for (auto k : nonGeoEntries(thisval.paramIndices)) { - Acts::ActsScalar p_i = thisval.paramValues.at(k); - Acts::ActsScalar p_j = values.at(j).paramValues.at(k); - Acts::ActsScalar v_i = thisval.paramVariances.at(k); - Acts::ActsScalar v_j = values.at(j).paramVariances.at(k); + double p_i = thisval.paramValues.at(k); + double p_j = values.at(j).paramValues.at(k); + double v_i = thisval.paramVariances.at(k); + double v_j = values.at(j).paramVariances.at(k); - Acts::ActsScalar left = 0, right = 0; + double left = 0, right = 0; if (p_i < p_j) { left = p_i + m_nsigma * std::sqrt(v_i); right = p_j - m_nsigma * std::sqrt(v_j); @@ -225,9 +225,9 @@ std::vector> ModuleClusters::mergeParameters( ModuleValue ModuleClusters::squash(std::vector& values) { ModuleValue mval; - Acts::ActsScalar tot = 0; - Acts::ActsScalar tot2 = 0; - std::vector weights; + double tot = 0; + double tot2 = 0; + std::vector weights; // First, start by computing cell weights for (ModuleValue& other : values) { @@ -253,9 +253,8 @@ ModuleValue ModuleClusters::squash(std::vector& values) { mval.paramValues.push_back(0); mval.paramVariances.push_back(0); } - Acts::ActsScalar f = weights.at(i) / (tot > 0 ? tot : 1); - Acts::ActsScalar f2 = - weights.at(i) * weights.at(i) / (tot2 > 0 ? tot2 : 1); + double f = weights.at(i) / (tot > 0 ? tot : 1); + double f2 = weights.at(i) * weights.at(i) / (tot2 > 0 ? tot2 : 1); mval.paramValues.at(j) += f * other.paramValues.at(j); mval.paramVariances.at(j) += f2 * other.paramVariances.at(j); } diff --git a/Examples/Algorithms/Geant4/src/SensitiveSteppingAction.cpp b/Examples/Algorithms/Geant4/src/SensitiveSteppingAction.cpp index 17df42bdb21..3cc886bc7c2 100644 --- a/Examples/Algorithms/Geant4/src/SensitiveSteppingAction.cpp +++ b/Examples/Algorithms/Geant4/src/SensitiveSteppingAction.cpp @@ -72,19 +72,19 @@ ActsFatras::Hit hitFromStep(const G4StepPoint* preStepPoint, G4ThreeVector postStepMomentum = convertEnergy * postStepPoint->GetMomentum(); G4double postStepEnergy = convertEnergy * postStepPoint->GetTotalEnergy(); - Acts::ActsScalar hX = 0.5 * (preStepPosition[0] + postStepPosition[0]); - Acts::ActsScalar hY = 0.5 * (preStepPosition[1] + postStepPosition[1]); - Acts::ActsScalar hZ = 0.5 * (preStepPosition[2] + postStepPosition[2]); - Acts::ActsScalar hT = 0.5 * (preStepTime + postStepTime); - - Acts::ActsScalar mXpre = preStepMomentum[0]; - Acts::ActsScalar mYpre = preStepMomentum[1]; - Acts::ActsScalar mZpre = preStepMomentum[2]; - Acts::ActsScalar mEpre = preStepEnergy; - Acts::ActsScalar mXpost = postStepMomentum[0]; - Acts::ActsScalar mYpost = postStepMomentum[1]; - Acts::ActsScalar mZpost = postStepMomentum[2]; - Acts::ActsScalar mEpost = postStepEnergy; + double hX = 0.5 * (preStepPosition[0] + postStepPosition[0]); + double hY = 0.5 * (preStepPosition[1] + postStepPosition[1]); + double hZ = 0.5 * (preStepPosition[2] + postStepPosition[2]); + double hT = 0.5 * (preStepTime + postStepTime); + + double mXpre = preStepMomentum[0]; + double mYpre = preStepMomentum[1]; + double mZpre = preStepMomentum[2]; + double mEpre = preStepEnergy; + double mXpost = postStepMomentum[0]; + double mYpost = postStepMomentum[1]; + double mZpost = postStepMomentum[2]; + double mEpost = postStepEnergy; Acts::Vector4 particlePosition(hX, hY, hZ, hT); Acts::Vector4 beforeMomentum(mXpre, mYpre, mZpre, mEpre); diff --git a/Examples/Algorithms/Geometry/include/ActsExamples/Geometry/VolumeAssociationTest.hpp b/Examples/Algorithms/Geometry/include/ActsExamples/Geometry/VolumeAssociationTest.hpp index c86720c340a..a468051aff2 100644 --- a/Examples/Algorithms/Geometry/include/ActsExamples/Geometry/VolumeAssociationTest.hpp +++ b/Examples/Algorithms/Geometry/include/ActsExamples/Geometry/VolumeAssociationTest.hpp @@ -33,7 +33,7 @@ class VolumeAssociationTest final : public IAlgorithm { /// The random number service std::shared_ptr randomNumbers = nullptr; /// The random number range - std::vector randomRange = {}; + std::vector randomRange = {}; /// The detector std::shared_ptr detector = nullptr; }; diff --git a/Examples/Algorithms/Geometry/src/VolumeAssociationTest.cpp b/Examples/Algorithms/Geometry/src/VolumeAssociationTest.cpp index 353bcf94bac..dbb5ac2bc79 100644 --- a/Examples/Algorithms/Geometry/src/VolumeAssociationTest.cpp +++ b/Examples/Algorithms/Geometry/src/VolumeAssociationTest.cpp @@ -38,18 +38,17 @@ ActsExamples::ProcessCode ActsExamples::VolumeAssociationTest::execute( auto rng = m_cfg.randomNumbers->spawnGenerator(ctx); // Setup random number distributions for some quantities - std::uniform_real_distribution phiDist(-std::numbers::pi, - std::numbers::pi); - std::uniform_real_distribution rDist(0., - m_cfg.randomRange[0u]); - std::uniform_real_distribution zDist(-m_cfg.randomRange[1u], - m_cfg.randomRange[1u]); + std::uniform_real_distribution phiDist(-std::numbers::pi, + std::numbers::pi); + std::uniform_real_distribution rDist(0., m_cfg.randomRange[0u]); + std::uniform_real_distribution zDist(-m_cfg.randomRange[1u], + m_cfg.randomRange[1u]); // Lemma for vector creation auto testPosition = [&]() -> Acts::Vector3 { - Acts::ActsScalar r = rDist(rng); - Acts::ActsScalar phi = phiDist(rng); - Acts::ActsScalar z = zDist(rng); + double r = rDist(rng); + double phi = phiDist(rng); + double z = zDist(rng); return Acts::Vector3(r * cos(phi), r * sin(phi), z); }; diff --git a/Examples/Algorithms/MaterialMapping/include/ActsExamples/MaterialMapping/MaterialValidation.hpp b/Examples/Algorithms/MaterialMapping/include/ActsExamples/MaterialMapping/MaterialValidation.hpp index ad1a7a93dff..69558244027 100644 --- a/Examples/Algorithms/MaterialMapping/include/ActsExamples/MaterialMapping/MaterialValidation.hpp +++ b/Examples/Algorithms/MaterialMapping/include/ActsExamples/MaterialMapping/MaterialValidation.hpp @@ -37,11 +37,10 @@ class MaterialValidation : public IAlgorithm { Acts::Vector3 startPosition = Acts::Vector3(0., 0., 0.); /// Start direction for the scan: phi - std::pair phiRange = {-std::numbers::pi, - std::numbers::pi}; + std::pair phiRange = {-std::numbers::pi, std::numbers::pi}; /// Start direction for the scan: eta - std::pair etaRange = {-4., 4.}; + std::pair etaRange = {-4., 4.}; /// Random number service std::shared_ptr randomNumberSvc = nullptr; diff --git a/Examples/Algorithms/MaterialMapping/src/MaterialValidation.cpp b/Examples/Algorithms/MaterialMapping/src/MaterialValidation.cpp index c75c654ed2b..a162edd2129 100644 --- a/Examples/Algorithms/MaterialMapping/src/MaterialValidation.cpp +++ b/Examples/Algorithms/MaterialMapping/src/MaterialValidation.cpp @@ -47,9 +47,9 @@ ProcessCode MaterialValidation::execute(const AlgorithmContext& context) const { // Loop over the number of tracks for (std::size_t iTrack = 0; iTrack < m_cfg.ntracks; ++iTrack) { // Generate a random phi and eta - Acts::ActsScalar phi = phiDist(rng); - Acts::ActsScalar eta = etaDist(rng); - Acts::ActsScalar theta = 2 * std::atan(std::exp(-eta)); + double phi = phiDist(rng); + double eta = etaDist(rng); + double theta = 2 * std::atan(std::exp(-eta)); Acts::Vector3 direction(std::cos(phi) * std::sin(theta), std::sin(phi) * std::sin(theta), std::cos(theta)); diff --git a/Examples/Algorithms/Propagation/src/SimHitToSummaryConversion.cpp b/Examples/Algorithms/Propagation/src/SimHitToSummaryConversion.cpp index 2d90a2bc8ac..f963d88662e 100644 --- a/Examples/Algorithms/Propagation/src/SimHitToSummaryConversion.cpp +++ b/Examples/Algorithms/Propagation/src/SimHitToSummaryConversion.cpp @@ -29,7 +29,7 @@ Acts::detail::Step concatenateSteps( concatStep.position += step.position; concatStep.momentum += step.momentum; } - Acts::ActsScalar weight = 1.0 / static_cast(steps.size()); + double weight = 1.0 / static_cast(steps.size()); concatStep.position *= weight; concatStep.momentum *= weight; } else { @@ -92,9 +92,9 @@ ActsExamples::ProcessCode ActsExamples::SimHitToSummaryConversion::execute( if (!moduleSteps.contains(paritcleId)) { moduleSteps[paritcleId] = std::vector(); } - Acts::ActsScalar hx = simHit.fourPosition().x() / Acts::UnitConstants::mm; - Acts::ActsScalar hy = simHit.fourPosition().y() / Acts::UnitConstants::mm; - Acts::ActsScalar hz = simHit.fourPosition().z() / Acts::UnitConstants::mm; + double hx = simHit.fourPosition().x() / Acts::UnitConstants::mm; + double hy = simHit.fourPosition().y() / Acts::UnitConstants::mm; + double hz = simHit.fourPosition().z() / Acts::UnitConstants::mm; Acts::detail::Step step; step.position = Acts::Vector3(hx, hy, hz); step.momentum = simHit.direction(); diff --git a/Examples/Detectors/MagneticField/include/ActsExamples/MagneticField/FieldMapRootIo.hpp b/Examples/Detectors/MagneticField/include/ActsExamples/MagneticField/FieldMapRootIo.hpp index b5a523c2c0e..3f05cad4cc7 100644 --- a/Examples/Detectors/MagneticField/include/ActsExamples/MagneticField/FieldMapRootIo.hpp +++ b/Examples/Detectors/MagneticField/include/ActsExamples/MagneticField/FieldMapRootIo.hpp @@ -57,8 +57,7 @@ detail::InterpolatedMagneticField2 makeMagneticFieldMapRzFromRoot( std::array nBinsRZ)>& localToGlobalBin, const std::string& fieldMapFile, const std::string& treeName, - Acts::ActsScalar lengthUnit, Acts::ActsScalar BFieldUnit, - bool firstQuadrant = false); + double lengthUnit, double BFieldUnit, bool firstQuadrant = false); /// Method to setup the FieldMap /// @param localToGlobalBin Function mapping the local bins of x,y,z to the @@ -105,7 +104,6 @@ detail::InterpolatedMagneticField3 makeMagneticFieldMapXyzFromRoot( std::array nBinsXYZ)>& localToGlobalBin, const std::string& fieldMapFile, const std::string& treeName, - Acts::ActsScalar lengthUnit, Acts::ActsScalar BFieldUnit, - bool firstOctant = false); + double lengthUnit, double BFieldUnit, bool firstOctant = false); } // namespace ActsExamples diff --git a/Examples/Detectors/MagneticField/include/ActsExamples/MagneticField/FieldMapTextIo.hpp b/Examples/Detectors/MagneticField/include/ActsExamples/MagneticField/FieldMapTextIo.hpp index ed191226705..f7ba1f2848a 100644 --- a/Examples/Detectors/MagneticField/include/ActsExamples/MagneticField/FieldMapTextIo.hpp +++ b/Examples/Detectors/MagneticField/include/ActsExamples/MagneticField/FieldMapTextIo.hpp @@ -58,8 +58,8 @@ detail::InterpolatedMagneticField2 makeMagneticFieldMapRzFromText( const std::function binsRZ, std::array nBinsRZ)>& localToGlobalBin, - const std::string& fieldMapFile, Acts::ActsScalar lengthUnit, - Acts::ActsScalar BFieldUnit, bool firstQuadrant = false); + const std::string& fieldMapFile, double lengthUnit, double BFieldUnit, + bool firstQuadrant = false); /// Method to setup the FieldMapper /// @param localToGlobalBin Function mapping the local bins of x,y,z to the @@ -107,7 +107,7 @@ detail::InterpolatedMagneticField3 makeMagneticFieldMapXyzFromText( const std::function binsXYZ, std::array nBinsXYZ)>& localToGlobalBin, - const std::string& fieldMapFile, Acts::ActsScalar lengthUnit, - Acts::ActsScalar BFieldUnit, bool firstOctant = false); + const std::string& fieldMapFile, double lengthUnit, double BFieldUnit, + bool firstOctant = false); } // namespace ActsExamples diff --git a/Examples/Detectors/MagneticField/include/ActsExamples/MagneticField/ScalableBField.hpp b/Examples/Detectors/MagneticField/include/ActsExamples/MagneticField/ScalableBField.hpp index 5def5740fa4..aa799319e29 100644 --- a/Examples/Detectors/MagneticField/include/ActsExamples/MagneticField/ScalableBField.hpp +++ b/Examples/Detectors/MagneticField/include/ActsExamples/MagneticField/ScalableBField.hpp @@ -16,14 +16,14 @@ namespace ActsExamples { /// The ScalableBField-specific magnetic field context. struct ScalableBFieldContext { - Acts::ActsScalar scalor = 1.; + double scalor = 1.; }; /// A constant magnetic field that is scaled depending on the event context. class ScalableBField final : public Acts::MagneticFieldProvider { public: struct Cache { - Acts::ActsScalar scalor = 1.; + double scalor = 1.; /// @brief constructor with context explicit Cache(const Acts::MagneticFieldContext& mctx) { @@ -41,8 +41,7 @@ class ScalableBField final : public Acts::MagneticFieldProvider { /// @param [in] Bx magnetic field component in global x-direction /// @param [in] By magnetic field component in global y-direction /// @param [in] Bz magnetic field component in global z-direction - ScalableBField(Acts::ActsScalar Bx = 0, Acts::ActsScalar By = 0, - Acts::ActsScalar Bz = 0) + ScalableBField(double Bx = 0, double By = 0, double Bz = 0) : m_BField(Bx, By, Bz) {} /// @brief retrieve magnetic field value diff --git a/Examples/Detectors/MagneticField/include/ActsExamples/MagneticField/ScalableBFieldService.hpp b/Examples/Detectors/MagneticField/include/ActsExamples/MagneticField/ScalableBFieldService.hpp index a228eccfe55..f39e7a6cf86 100644 --- a/Examples/Detectors/MagneticField/include/ActsExamples/MagneticField/ScalableBFieldService.hpp +++ b/Examples/Detectors/MagneticField/include/ActsExamples/MagneticField/ScalableBFieldService.hpp @@ -26,7 +26,7 @@ class ScalableBFieldService : public IContextDecorator { public: struct Config { /// Scaling factor. Unit value means the magnetic field is left unchanged. - Acts::ActsScalar scalor = 1.25; + double scalor = 1.25; }; /// Construct the magnetic field service. diff --git a/Examples/Detectors/MagneticField/src/FieldMapRootIo.cpp b/Examples/Detectors/MagneticField/src/FieldMapRootIo.cpp index bcc93238364..a4a7c7828c8 100644 --- a/Examples/Detectors/MagneticField/src/FieldMapRootIo.cpp +++ b/Examples/Detectors/MagneticField/src/FieldMapRootIo.cpp @@ -23,8 +23,7 @@ ActsExamples::makeMagneticFieldMapRzFromRoot( std::array nBinsRZ)>& localToGlobalBin, const std::string& fieldMapFile, const std::string& treeName, - Acts::ActsScalar lengthUnit, Acts::ActsScalar BFieldUnit, - bool firstQuadrant) { + double lengthUnit, double BFieldUnit, bool firstQuadrant) { /// [1] Read in field map file // Grid position points in r and z std::vector rPos; @@ -74,8 +73,7 @@ ActsExamples::makeMagneticFieldMapXyzFromRoot( std::array nBinsXYZ)>& localToGlobalBin, const std::string& fieldMapFile, const std::string& treeName, - Acts::ActsScalar lengthUnit, Acts::ActsScalar BFieldUnit, - bool firstOctant) { + double lengthUnit, double BFieldUnit, bool firstOctant) { /// [1] Read in field map file // Grid position points in x, y and z std::vector xPos; diff --git a/Examples/Detectors/MagneticField/src/FieldMapTextIo.cpp b/Examples/Detectors/MagneticField/src/FieldMapTextIo.cpp index d298ec046b2..4512355ba73 100644 --- a/Examples/Detectors/MagneticField/src/FieldMapTextIo.cpp +++ b/Examples/Detectors/MagneticField/src/FieldMapTextIo.cpp @@ -22,8 +22,8 @@ ActsExamples::makeMagneticFieldMapRzFromText( const std::function binsRZ, std::array nBinsRZ)>& localToGlobalBin, - const std::string& fieldMapFile, Acts::ActsScalar lengthUnit, - Acts::ActsScalar BFieldUnit, bool firstQuadrant) { + const std::string& fieldMapFile, double lengthUnit, double BFieldUnit, + bool firstQuadrant) { /// [1] Read in field map file // Grid position points in r and z std::vector rPos; @@ -65,8 +65,8 @@ ActsExamples::makeMagneticFieldMapXyzFromText( const std::function binsXYZ, std::array nBinsXYZ)>& localToGlobalBin, - const std::string& fieldMapFile, Acts::ActsScalar lengthUnit, - Acts::ActsScalar BFieldUnit, bool firstOctant) { + const std::string& fieldMapFile, double lengthUnit, double BFieldUnit, + bool firstOctant) { /// [1] Read in field map file // Grid position points in x, y and z std::vector xPos; diff --git a/Examples/Detectors/MuonSpectrometerMockupDetector/src/MockupSectorBuilder.cpp b/Examples/Detectors/MuonSpectrometerMockupDetector/src/MockupSectorBuilder.cpp index f6431c5ddbe..b5ff0c8aed4 100644 --- a/Examples/Detectors/MuonSpectrometerMockupDetector/src/MockupSectorBuilder.cpp +++ b/Examples/Detectors/MuonSpectrometerMockupDetector/src/MockupSectorBuilder.cpp @@ -127,14 +127,12 @@ ActsExamples::MockupSectorBuilder::buildChamber( Acts::Vector3 maxValues = {min_max[0].second, min_max[1].second, min_max[2].second}; - Acts::ActsScalar hx = + double hx = strawSurfaces.front()->bounds().values()[1] + mCfg.toleranceOverlap; - Acts::ActsScalar hy = - 0.5 * ((maxValues.y() + radius) - (minValues.y() - radius)) + - mCfg.toleranceOverlap; - Acts::ActsScalar hz = - 0.5 * ((maxValues.z() + radius) - (minValues.z() - radius)) + - mCfg.toleranceOverlap; + double hy = 0.5 * ((maxValues.y() + radius) - (minValues.y() - radius)) + + mCfg.toleranceOverlap; + double hz = 0.5 * ((maxValues.z() + radius) - (minValues.z() - radius)) + + mCfg.toleranceOverlap; auto detectorVolumeBounds = std::make_shared(hx, hy, hz); @@ -189,10 +187,9 @@ ActsExamples::MockupSectorBuilder::buildSector( // calculate the phi angles of the vectors auto phiA = Acts::VectorHelpers::phi(pointA); auto phiB = Acts::VectorHelpers::phi(pointB); - Acts::ActsScalar sectorAngle = std::numbers::pi_v; + double sectorAngle = std::numbers::pi_v; - Acts::ActsScalar halfPhi = - std::numbers::pi_v / mCfg.NumberOfSectors; + double halfPhi = std::numbers::pi_v / mCfg.NumberOfSectors; if (mCfg.NumberOfSectors == 1) { halfPhi = (phiB - phiA) / 2; diff --git a/Examples/Framework/include/ActsExamples/EventData/DriftCircle.hpp b/Examples/Framework/include/ActsExamples/EventData/DriftCircle.hpp index 88cad84fffe..41fbe819dd4 100644 --- a/Examples/Framework/include/ActsExamples/EventData/DriftCircle.hpp +++ b/Examples/Framework/include/ActsExamples/EventData/DriftCircle.hpp @@ -23,7 +23,7 @@ namespace ActsExamples { /// representation of a drift circle measurement used for track finding class DriftCircle { - using Scalar = Acts::ActsScalar; + using Scalar = double; public: /// Construct the drift circle from the drift radius and tube location diff --git a/Examples/Framework/include/ActsExamples/EventData/SimParticle.hpp b/Examples/Framework/include/ActsExamples/EventData/SimParticle.hpp index cfcf8a5e25e..7ea0a71714f 100644 --- a/Examples/Framework/include/ActsExamples/EventData/SimParticle.hpp +++ b/Examples/Framework/include/ActsExamples/EventData/SimParticle.hpp @@ -23,7 +23,7 @@ using SimParticleState = ::ActsFatras::Particle; class SimParticle final { public: - using Scalar = Acts::ActsScalar; + using Scalar = double; using Vector3 = Acts::ActsVector<3>; using Vector4 = Acts::ActsVector<4>; diff --git a/Examples/Framework/include/ActsExamples/EventData/SimSpacePoint.hpp b/Examples/Framework/include/ActsExamples/EventData/SimSpacePoint.hpp index 0359913199f..41b7f816b9f 100644 --- a/Examples/Framework/include/ActsExamples/EventData/SimSpacePoint.hpp +++ b/Examples/Framework/include/ActsExamples/EventData/SimSpacePoint.hpp @@ -23,7 +23,7 @@ namespace ActsExamples { /// Space point representation of a measurement suitable for track seeding. class SimSpacePoint { - using Scalar = Acts::ActsScalar; + using Scalar = double; public: /// Construct the space point from global position and selected variances. diff --git a/Examples/Framework/include/ActsExamples/EventData/SimVertex.hpp b/Examples/Framework/include/ActsExamples/EventData/SimVertex.hpp index 0bdfbb4925c..e04f92f7d6e 100644 --- a/Examples/Framework/include/ActsExamples/EventData/SimVertex.hpp +++ b/Examples/Framework/include/ActsExamples/EventData/SimVertex.hpp @@ -77,7 +77,7 @@ class SimVertexBarcode { /// A simulated vertex e.g. from a physics process. struct SimVertex { - using Scalar = Acts::ActsScalar; + using Scalar = double; using Vector4 = Acts::ActsVector<4>; /// The vertex ID diff --git a/Examples/Io/Csv/src/CsvTrackingGeometryWriter.cpp b/Examples/Io/Csv/src/CsvTrackingGeometryWriter.cpp index 1257be23ff6..e40c679a055 100644 --- a/Examples/Io/Csv/src/CsvTrackingGeometryWriter.cpp +++ b/Examples/Io/Csv/src/CsvTrackingGeometryWriter.cpp @@ -128,12 +128,12 @@ void writeSurface(SurfaceWriter& sfWriter, const Acts::Surface& surface, /// @param transform the layer transform /// @param representingBoundValues [in,out] the bound values /// @param last is the last layer -void writeCylinderLayerVolume( - LayerVolumeWriter& lvWriter, const Acts::Layer& lv, - const Acts::Transform3& transform, - std::vector& representingBoundValues, - std::vector& volumeBoundValues, - std::vector& lastBoundValues, bool last) { +void writeCylinderLayerVolume(LayerVolumeWriter& lvWriter, + const Acts::Layer& lv, + const Acts::Transform3& transform, + std::vector& representingBoundValues, + std::vector& volumeBoundValues, + std::vector& lastBoundValues, bool last) { // The layer volume to be written LayerVolumeData lvDims; lvDims.geometry_id = lv.geometryId().value(); @@ -229,9 +229,8 @@ void writeVolume(SurfaceWriter& sfWriter, SurfaceGridWriter& sfGridWriter, const auto& vTransform = volume.transform(); // Get the values of the volume boundaries - std::vector volumeBoundValues = - volume.volumeBounds().values(); - std::vector lastBoundValues; + std::vector volumeBoundValues = volume.volumeBounds().values(); + std::vector lastBoundValues; if (volume.volumeBounds().type() == Acts::VolumeBounds::eCylinder) { auto vTranslation = vTransform.translation(); @@ -285,7 +284,7 @@ void writeVolume(SurfaceWriter& sfWriter, SurfaceGridWriter& sfGridWriter, // Write the layer volume, exclude single layer volumes (written above) if (rVolume != nullptr && writeLayerVolume && layers.size() > 3) { // Get the values of the representing volume - std::vector representingBoundValues = + std::vector representingBoundValues = rVolume->volumeBounds().values(); if (rVolume->volumeBounds().type() == Acts::VolumeBounds::eCylinder) { bool last = (layerIdx + 2 == diff --git a/Examples/Io/Json/src/JsonDigitizationConfig.cpp b/Examples/Io/Json/src/JsonDigitizationConfig.cpp index 489c86087bf..8e3b3abe2cc 100644 --- a/Examples/Io/Json/src/JsonDigitizationConfig.cpp +++ b/Examples/Io/Json/src/JsonDigitizationConfig.cpp @@ -87,12 +87,12 @@ void from_json( if (sType == "Gauss") { f = Digitization::Gauss(j["stddev"]); } else if (sType == "GaussTrunc") { - Acts::ActsScalar sigma = j["stddev"]; - std::pair range = j["range"]; + double sigma = j["stddev"]; + std::pair range = j["range"]; f = Digitization::GaussTrunc(sigma, range); } else if (sType == "GaussClipped") { - Acts::ActsScalar sigma = j["stddev"]; - std::pair range = j["range"]; + double sigma = j["stddev"]; + std::pair range = j["range"]; f = Digitization::GaussClipped(sigma, range); } else if (sType == "Uniform") { Acts::BinningData bd; @@ -159,7 +159,7 @@ void ActsExamples::from_json(const nlohmann::json& j, for (const auto& jvar : jvariances) { auto idx = static_cast(jvar["index"].get()); - auto vars = jvar["rms"].get>(); + auto vars = jvar["rms"].get>(); gdc.varianceMap[idx] = vars; } } diff --git a/Examples/Io/Root/src/VertexNTupleWriter.cpp b/Examples/Io/Root/src/VertexNTupleWriter.cpp index 07c71f115c1..6304af1cb8d 100644 --- a/Examples/Io/Root/src/VertexNTupleWriter.cpp +++ b/Examples/Io/Root/src/VertexNTupleWriter.cpp @@ -345,24 +345,24 @@ ProcessCode VertexNTupleWriter::writeT( }; // Helper function for computing the pull - auto pull = - [this](const Acts::ActsScalar& diff, const Acts::ActsScalar& variance, - const std::string& variableStr, const bool& afterFit = true) { - if (variance <= 0) { - std::string tempStr; - if (afterFit) { - tempStr = "after"; - } else { - tempStr = "before"; - } - ACTS_WARNING("Nonpositive variance " - << tempStr << " vertex fit: Var(" << variableStr - << ") = " << variance << " <= 0."); - return std::numeric_limits::quiet_NaN(); - } - double std = std::sqrt(variance); - return diff / std; - }; + auto pull = [this](const double& diff, const double& variance, + const std::string& variableStr, + const bool& afterFit = true) { + if (variance <= 0) { + std::string tempStr; + if (afterFit) { + tempStr = "after"; + } else { + tempStr = "before"; + } + ACTS_WARNING("Nonpositive variance " << tempStr << " vertex fit: Var(" + << variableStr << ") = " << variance + << " <= 0."); + return std::numeric_limits::quiet_NaN(); + } + double std = std::sqrt(variance); + return diff / std; + }; auto calculateTruthPrimaryVertexDensity = [this, truthVertices](const Acts::Vertex& vtx) { @@ -571,14 +571,14 @@ ProcessCode VertexNTupleWriter::writeT( m_recoZ.push_back(vtx.fullPosition()[Acts::CoordinateIndices::eZ]); m_recoT.push_back(vtx.fullPosition()[Acts::CoordinateIndices::eTime]); - Acts::ActsScalar varX = vtx.fullCovariance()(Acts::CoordinateIndices::eX, - Acts::CoordinateIndices::eX); - Acts::ActsScalar varY = vtx.fullCovariance()(Acts::CoordinateIndices::eY, - Acts::CoordinateIndices::eY); - Acts::ActsScalar varZ = vtx.fullCovariance()(Acts::CoordinateIndices::eZ, - Acts::CoordinateIndices::eZ); - Acts::ActsScalar varTime = vtx.fullCovariance()( - Acts::CoordinateIndices::eTime, Acts::CoordinateIndices::eTime); + double varX = vtx.fullCovariance()(Acts::CoordinateIndices::eX, + Acts::CoordinateIndices::eX); + double varY = vtx.fullCovariance()(Acts::CoordinateIndices::eY, + Acts::CoordinateIndices::eY); + double varZ = vtx.fullCovariance()(Acts::CoordinateIndices::eZ, + Acts::CoordinateIndices::eZ); + double varTime = vtx.fullCovariance()(Acts::CoordinateIndices::eTime, + Acts::CoordinateIndices::eTime); m_covXX.push_back(varX); m_covYY.push_back(varY); diff --git a/Examples/Io/Root/src/detail/NuclearInteractionParametrisation.cpp b/Examples/Io/Root/src/detail/NuclearInteractionParametrisation.cpp index 174f3648ce1..9a42c1b68a3 100644 --- a/Examples/Io/Root/src/detail/NuclearInteractionParametrisation.cpp +++ b/Examples/Io/Root/src/detail/NuclearInteractionParametrisation.cpp @@ -53,8 +53,8 @@ float gaussianValue(TH1F const* histo, const float mom) { float invariantMass(const Acts::Vector4& fourVector1, const Acts::Vector4& fourVector2) { Acts::Vector4 sum = fourVector1 + fourVector2; - const Acts::ActsScalar energy = sum[Acts::eEnergy]; - Acts::ActsScalar momentum = sum.template segment<3>(Acts::eMom0).norm(); + const double energy = sum[Acts::eEnergy]; + double momentum = sum.template segment<3>(Acts::eMom0).norm(); return std::sqrt(energy * energy - momentum * momentum); } diff --git a/Examples/Io/Svg/include/ActsExamples/Io/Svg/SvgPointWriter.hpp b/Examples/Io/Svg/include/ActsExamples/Io/Svg/SvgPointWriter.hpp index 3ad6527a882..8695fe2e7f1 100644 --- a/Examples/Io/Svg/include/ActsExamples/Io/Svg/SvgPointWriter.hpp +++ b/Examples/Io/Svg/include/ActsExamples/Io/Svg/SvgPointWriter.hpp @@ -82,7 +82,7 @@ class SvgPointWriter final : public WriterT> { std::string outputDir; ///< where to place output files std::size_t outputPrecision = 6; ///< floating point precision - Acts::ActsScalar spSize = 10.; //!< size of the space point to be drawn + double spSize = 10.; //!< size of the space point to be drawn Acts::Svg::Style spStyle = s_pointStyle; //!< The style of the space point to be drawn @@ -91,11 +91,11 @@ class SvgPointWriter final : public WriterT> { Acts::Svg::Style infoBoxStyle = s_infoStyle; // The style of the info box bool projectionXY = true; ///< xy projection - std::array zRangeXY = { - std::numeric_limits::lowest(), - std::numeric_limits::max()}; ///< View range in z of - ///< the XY view - bool projectionZR = true; ///< zr projection + std::array zRangeXY = { + std::numeric_limits::lowest(), + std::numeric_limits::max()}; ///< View range in z of + ///< the XY view + bool projectionZR = true; ///< zr projection std::shared_ptr trackingGeometry = nullptr; ///< The tracking geometry, a set pointer will cause the diff --git a/Examples/Python/src/Geometry.cpp b/Examples/Python/src/Geometry.cpp index ee98bac3fb5..d69b35a86ba 100644 --- a/Examples/Python/src/Geometry.cpp +++ b/Examples/Python/src/Geometry.cpp @@ -199,8 +199,8 @@ void addGeometry(Context& ctx) { py::class_, Acts::VolumeBounds>(m, "CylinderVolumeBounds") - .def(py::init(), + .def(py::init(), "rmin"_a, "rmax"_a, "halfz"_a, "halfphi"_a = std::numbers::pi, "avgphi"_a = 0., "bevelMinZ"_a = 0., "bevelMaxZ"_a = 0.); @@ -282,7 +282,7 @@ void addGeometry(Context& ctx) { py::arg("envelope") = ExtentEnvelope::Zero()) .def("range", [](const Acts::Extent& self, - Acts::BinningValue bval) -> std::array { + Acts::BinningValue bval) -> std::array { return {self.min(bval), self.max(bval)}; }) .def("__str__", &Extent::toString); @@ -382,11 +382,10 @@ void addExperimentalGeometry(Context& ctx) { // Be able to construct a proto binning py::class_(m, "ProtoBinning") .def(py::init&, std::size_t>(), + const std::vector&, std::size_t>(), "bValue"_a, "bType"_a, "e"_a, "exp"_a = 0u) - .def(py::init(), + .def(py::init(), "bValue"_a, "bType"_a, "minE"_a, "maxE"_a, "nbins"_a, "exp"_a = 0u) .def(py::init(), @@ -436,13 +435,13 @@ void addExperimentalGeometry(Context& ctx) { } { - using RangeXDDim1 = Acts::RangeXD<1u, Acts::ActsScalar>; + using RangeXDDim1 = Acts::RangeXD<1u, double>; using KdtSurfacesDim1Bin100 = Acts::Experimental::KdtSurfaces<1u, 100u>; using KdtSurfacesProviderDim1Bin100 = Acts::Experimental::KdtSurfacesProvider<1u, 100u>; py::class_(m, "RangeXDDim1") - .def(py::init([](const std::array& irange) { + .def(py::init([](const std::array& irange) { RangeXDDim1 range; range[0].shrink(irange[0], irange[1]); return range; @@ -464,14 +463,14 @@ void addExperimentalGeometry(Context& ctx) { } { - using RangeXDDim2 = Acts::RangeXD<2u, Acts::ActsScalar>; + using RangeXDDim2 = Acts::RangeXD<2u, double>; using KdtSurfacesDim2Bin100 = Acts::Experimental::KdtSurfaces<2u, 100u>; using KdtSurfacesProviderDim2Bin100 = Acts::Experimental::KdtSurfacesProvider<2u, 100u>; py::class_(m, "RangeXDDim2") - .def(py::init([](const std::array& range0, - const std::array& range1) { + .def(py::init([](const std::array& range0, + const std::array& range1) { RangeXDDim2 range; range[0].shrink(range0[0], range0[1]); range[1].shrink(range1[0], range1[1]); diff --git a/Fatras/include/ActsFatras/Digitization/DigitizationData.hpp b/Fatras/include/ActsFatras/Digitization/DigitizationData.hpp index 314cbcc5eb1..e0b8e657251 100644 --- a/Fatras/include/ActsFatras/Digitization/DigitizationData.hpp +++ b/Fatras/include/ActsFatras/Digitization/DigitizationData.hpp @@ -17,7 +17,7 @@ namespace ActsFatras { /// A single cell definition: index, cell central value -using Cell = std::pair; +using Cell = std::pair; /// A channel definition: Cell identification, readout word, links /// @@ -51,7 +51,7 @@ struct Channel { /// @tparam kSize Number of cluster coordinates template struct Cluster { - using Scalar = Acts::ActsScalar; + using Scalar = double; using ParametersVector = Acts::ActsVector; using CovarianceMatrix = Acts::ActsSquareMatrix; diff --git a/Fatras/include/ActsFatras/Digitization/UncorrelatedHitSmearer.hpp b/Fatras/include/ActsFatras/Digitization/UncorrelatedHitSmearer.hpp index 4420c8a6200..eb6c3ef3390 100644 --- a/Fatras/include/ActsFatras/Digitization/UncorrelatedHitSmearer.hpp +++ b/Fatras/include/ActsFatras/Digitization/UncorrelatedHitSmearer.hpp @@ -41,7 +41,7 @@ using SingleParameterSmearFunction = /// vector and associated covariance matrix. template struct BoundParametersSmearer { - using Scalar = Acts::ActsScalar; + using Scalar = double; using ParametersVector = Acts::ActsVector; using CovarianceMatrix = Acts::ActsSquareMatrix; using Result = Acts::Result>; @@ -116,7 +116,7 @@ struct BoundParametersSmearer { /// individually is not recommended template struct FreeParametersSmearer { - using Scalar = Acts::ActsScalar; + using Scalar = double; using ParametersVector = Acts::ActsVector; using CovarianceMatrix = Acts::ActsSquareMatrix; using Result = Acts::Result>; diff --git a/Fatras/include/ActsFatras/EventData/Hit.hpp b/Fatras/include/ActsFatras/EventData/Hit.hpp index d5eb25662f8..91008715958 100644 --- a/Fatras/include/ActsFatras/EventData/Hit.hpp +++ b/Fatras/include/ActsFatras/EventData/Hit.hpp @@ -26,7 +26,7 @@ namespace ActsFatras { /// thus stored as two separate four-vectors. class Hit { public: - using Scalar = Acts::ActsScalar; + using Scalar = double; using Vector3 = Acts::ActsVector<3>; using Vector4 = Acts::ActsVector<4>; diff --git a/Fatras/include/ActsFatras/EventData/Particle.hpp b/Fatras/include/ActsFatras/EventData/Particle.hpp index 5b6eb2f7a61..43805d0671c 100644 --- a/Fatras/include/ActsFatras/EventData/Particle.hpp +++ b/Fatras/include/ActsFatras/EventData/Particle.hpp @@ -32,7 +32,7 @@ namespace ActsFatras { /// Also stores some simulation-specific properties. class Particle { public: - using Scalar = Acts::ActsScalar; + using Scalar = double; using Vector3 = Acts::ActsVector<3>; using Vector4 = Acts::ActsVector<4>; diff --git a/Fatras/include/ActsFatras/Physics/NuclearInteraction/NuclearInteraction.hpp b/Fatras/include/ActsFatras/Physics/NuclearInteraction/NuclearInteraction.hpp index 89072e78536..d2f37ad738c 100644 --- a/Fatras/include/ActsFatras/Physics/NuclearInteraction/NuclearInteraction.hpp +++ b/Fatras/include/ActsFatras/Physics/NuclearInteraction/NuclearInteraction.hpp @@ -416,8 +416,8 @@ Acts::ActsDynamicVector NuclearInteraction::sampleInvariantMasses( // Sample in the eigenspace for (unsigned int i = 0; i < size; i++) { float variance = parametrisation.eigenvaluesInvariantMass[i]; - std::normal_distribution dist{ - parametrisation.meanInvariantMass[i], std::sqrt(variance)}; + std::normal_distribution dist{parametrisation.meanInvariantMass[i], + std::sqrt(variance)}; parameters[i] = dist(generator); } // Transform to multivariate normal distribution @@ -446,8 +446,8 @@ Acts::ActsDynamicVector NuclearInteraction::sampleMomenta( // Sample in the eigenspace for (unsigned int i = 0; i < size; i++) { float variance = parametrisation.eigenvaluesMomentum[i]; - std::normal_distribution dist{ - parametrisation.meanMomentum[i], std::sqrt(variance)}; + std::normal_distribution dist{parametrisation.meanMomentum[i], + std::sqrt(variance)}; parameters[i] = dist(generator); } diff --git a/Plugins/ActSVG/include/Acts/Plugins/ActSVG/EventDataSvgConverter.hpp b/Plugins/ActSVG/include/Acts/Plugins/ActSVG/EventDataSvgConverter.hpp index c05539d6dd4..ddcf1654eb1 100644 --- a/Plugins/ActSVG/include/Acts/Plugins/ActSVG/EventDataSvgConverter.hpp +++ b/Plugins/ActSVG/include/Acts/Plugins/ActSVG/EventDataSvgConverter.hpp @@ -23,8 +23,8 @@ namespace Acts::Svg::EventDataConverter { /// @param idx the running index /// /// @return a vector of svg objects -actsvg::svg::object pointXY(const Vector3& pos, ActsScalar size, - const Style& style, unsigned int idx = 0); +actsvg::svg::object pointXY(const Vector3& pos, double size, const Style& style, + unsigned int idx = 0); /// Write/create a 3D point in ZR view /// @@ -34,8 +34,8 @@ actsvg::svg::object pointXY(const Vector3& pos, ActsScalar size, /// @param indx the running index /// /// @return a vector of svg objects -actsvg::svg::object pointZR(const Vector3& pos, ActsScalar size, - const Style& style, unsigned int idx = 0); +actsvg::svg::object pointZR(const Vector3& pos, double size, const Style& style, + unsigned int idx = 0); /// Write/create a 3D point in a given view /// @@ -46,8 +46,8 @@ actsvg::svg::object pointZR(const Vector3& pos, ActsScalar size, /// /// @return a vector of svg objects template -actsvg::svg::object point(const Vector3& pos, ActsScalar size, - const Style& style, unsigned int idx) { +actsvg::svg::object point(const Vector3& pos, double size, const Style& style, + unsigned int idx) { view_type view; std::vector ps = {pos}; auto ppos = view(ps)[0]; diff --git a/Plugins/ActSVG/include/Acts/Plugins/ActSVG/GridSvgConverter.hpp b/Plugins/ActSVG/include/Acts/Plugins/ActSVG/GridSvgConverter.hpp index 909fc44a356..c81698de5c2 100644 --- a/Plugins/ActSVG/include/Acts/Plugins/ActSVG/GridSvgConverter.hpp +++ b/Plugins/ActSVG/include/Acts/Plugins/ActSVG/GridSvgConverter.hpp @@ -31,7 +31,7 @@ using ProtoGrid = actsvg::proto::grid; namespace GridConverter { // An optional range and binning value -using AxisBound = std::tuple, BinningValue>; +using AxisBound = std::tuple, BinningValue>; /// Nested Options struct struct Options { @@ -65,8 +65,8 @@ ProtoGrid convert(const grid_type& grid, // The edge values - these need to follow the ACTSVG convention, // so there could be swapping when necessary - std::vector edges0; - std::vector edges1; + std::vector edges0; + std::vector edges1; // 1D case (more to be filled in later) if constexpr (grid_type::DIM == 1u) { diff --git a/Plugins/ActSVG/include/Acts/Plugins/ActSVG/IndexedSurfacesSvgConverter.hpp b/Plugins/ActSVG/include/Acts/Plugins/ActSVG/IndexedSurfacesSvgConverter.hpp index 788ac36aca5..b90803b07a5 100644 --- a/Plugins/ActSVG/include/Acts/Plugins/ActSVG/IndexedSurfacesSvgConverter.hpp +++ b/Plugins/ActSVG/include/Acts/Plugins/ActSVG/IndexedSurfacesSvgConverter.hpp @@ -115,7 +115,7 @@ ProtoIndexedSurfaceGrid convertImpl(const GeometryContext& gctx, if constexpr (index_grid::grid_type::DIM == 1u) { if (indexGrid.casts[0u] == BinningValue::binPhi) { auto estRangeR = constrain.range(BinningValue::binR); - std::array rRange = {estRangeR.min(), estRangeR.max()}; + std::array rRange = {estRangeR.min(), estRangeR.max()}; gridOptions.optionalBound = {rRange, BinningValue::binR}; } } @@ -139,7 +139,7 @@ ProtoIndexedSurfaceGrid convertImpl(const GeometryContext& gctx, // Register the bin naming std::string binInfo = std::string("- bin : [") + std::to_string(ib0) + std::string("]"); - ActsScalar binCenter = 0.5 * (binEdges[ib0] + binEdges[ib0 - 1u]); + double binCenter = 0.5 * (binEdges[ib0] + binEdges[ib0 - 1u]); binInfo += "\n - center : (" + std::to_string(binCenter) + ")"; pGrid._bin_ids.push_back(binInfo); } @@ -158,8 +158,8 @@ ProtoIndexedSurfaceGrid convertImpl(const GeometryContext& gctx, std::string binInfo = std::string("- bin : [") + std::to_string(ib0) + std::string(", ") + std::to_string(ib1) + std::string("]"); - ActsScalar binCenter0 = 0.5 * (binEdges0[ib0] + binEdges0[ib0 - 1u]); - ActsScalar binCenter1 = 0.5 * (binEdges1[ib1] + binEdges1[ib1 - 1u]); + double binCenter0 = 0.5 * (binEdges0[ib0] + binEdges0[ib0 - 1u]); + double binCenter1 = 0.5 * (binEdges1[ib1] + binEdges1[ib1 - 1u]); binInfo += "\n - center : (" + std::to_string(binCenter0) + ", " + std::to_string(binCenter1) + ")"; pGrid._bin_ids.push_back(binInfo); diff --git a/Plugins/ActSVG/include/Acts/Plugins/ActSVG/LayerSvgConverter.hpp b/Plugins/ActSVG/include/Acts/Plugins/ActSVG/LayerSvgConverter.hpp index 079f5ae7aec..9f3a84421bf 100644 --- a/Plugins/ActSVG/include/Acts/Plugins/ActSVG/LayerSvgConverter.hpp +++ b/Plugins/ActSVG/include/Acts/Plugins/ActSVG/LayerSvgConverter.hpp @@ -24,13 +24,11 @@ namespace Svg { using ProtoVolume = actsvg::proto::volume>; -static std::array noLimitZ = { - std::numeric_limits::lowest(), - std::numeric_limits::max()}; +static std::array noLimitZ = {std::numeric_limits::lowest(), + std::numeric_limits::max()}; -static std::array noLimitPhi = { - -std::numbers::pi_v, - std::numbers::pi_v}; +static std::array noLimitPhi = {-std::numbers::pi_v, + std::numbers::pi_v}; namespace LayerConverter { @@ -49,16 +47,16 @@ struct Options { /// The style of the surface objects GeometryHierarchyMap