diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 68c78341c5d..4158678a3e0 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -92,7 +92,7 @@ repos: - id: leftover_conflict_markers name: Leftover conflict markers language: system - entry: git diff --staged --check + entry: git --no-pager diff --staged --check - repo: local hooks: diff --git a/Core/include/Acts/EventData/TrackContainer.hpp b/Core/include/Acts/EventData/TrackContainer.hpp index 03f7f1f8bb1..842c6a136dd 100644 --- a/Core/include/Acts/EventData/TrackContainer.hpp +++ b/Core/include/Acts/EventData/TrackContainer.hpp @@ -8,9 +8,6 @@ #pragma once -#include "Acts/Definitions/Algebra.hpp" -#include "Acts/Definitions/TrackParametrization.hpp" -#include "Acts/Definitions/Units.hpp" #include "Acts/EventData/MultiTrajectory.hpp" #include "Acts/EventData/MultiTrajectoryBackendConcept.hpp" #include "Acts/EventData/TrackContainerBackendConcept.hpp" @@ -21,11 +18,9 @@ #include "Acts/Utilities/Holders.hpp" #include "Acts/Utilities/Iterator.hpp" #include "Acts/Utilities/TypeTraits.hpp" -#include "Acts/Utilities/UnitVectors.hpp" #include -#include -#include +#include #include namespace Acts { diff --git a/Core/include/Acts/EventData/TrackProxy.hpp b/Core/include/Acts/EventData/TrackProxy.hpp index 7e62eea943d..722c69afba1 100644 --- a/Core/include/Acts/EventData/TrackProxy.hpp +++ b/Core/include/Acts/EventData/TrackProxy.hpp @@ -21,7 +21,6 @@ #include "Acts/Utilities/UnitVectors.hpp" #include -#include namespace Acts { diff --git a/Core/include/Acts/Geometry/Extent.hpp b/Core/include/Acts/Geometry/Extent.hpp index ca4d439e9ba..840a4ef582c 100644 --- a/Core/include/Acts/Geometry/Extent.hpp +++ b/Core/include/Acts/Geometry/Extent.hpp @@ -18,6 +18,7 @@ #include #include +#include #include #include #include diff --git a/Core/include/Acts/Geometry/GeometryIdentifier.hpp b/Core/include/Acts/Geometry/GeometryIdentifier.hpp index f1bf7a26736..6b43e510f78 100644 --- a/Core/include/Acts/Geometry/GeometryIdentifier.hpp +++ b/Core/include/Acts/Geometry/GeometryIdentifier.hpp @@ -11,7 +11,6 @@ #include #include #include -#include namespace Acts { diff --git a/Core/include/Acts/MagneticField/BFieldMapUtils.hpp b/Core/include/Acts/MagneticField/BFieldMapUtils.hpp index 09ac0035d9b..4aa1934699b 100644 --- a/Core/include/Acts/MagneticField/BFieldMapUtils.hpp +++ b/Core/include/Acts/MagneticField/BFieldMapUtils.hpp @@ -75,7 +75,7 @@ fieldMapRZ(const std::function binsRZ, std::array nBinsRZ)>& localToGlobalBin, std::vector rPos, std::vector zPos, - std::vector bField, + const std::vector& bField, double lengthUnit = UnitConstants::mm, double BFieldUnit = UnitConstants::T, bool firstQuadrant = false); @@ -137,7 +137,7 @@ fieldMapXYZ( std::array nBinsXYZ)>& localToGlobalBin, std::vector xPos, std::vector yPos, - std::vector zPos, std::vector bField, + std::vector zPos, const std::vector& bField, double lengthUnit = UnitConstants::mm, double BFieldUnit = UnitConstants::T, bool firstOctant = false); @@ -145,17 +145,18 @@ fieldMapXYZ( /// creates a field mapper by sampling grid points from the analytical /// solenoid field. /// -/// @param rlim pair of r bounds -/// @param zlim pair of z bounds -/// @param nbins pair of bin counts +/// @param rLim pair of r bounds +/// @param zLim pair of z bounds +/// @param nBins pair of bin counts /// @param field the solenoid field instance /// /// @return A field map instance for use in interpolation. Acts::InterpolatedBFieldMap< Acts::Grid, Acts::Axis>> -solenoidFieldMap(std::pair rlim, std::pair zlim, - std::pair nbins, +solenoidFieldMap(const std::pair& rLim, + const std::pair& zLim, + const std::pair& nBins, const SolenoidBField& field); } // namespace Acts diff --git a/Core/include/Acts/TrackFinding/CombinatorialKalmanFilter.hpp b/Core/include/Acts/TrackFinding/CombinatorialKalmanFilter.hpp index 90a7ab5f134..1ab019b59ce 100644 --- a/Core/include/Acts/TrackFinding/CombinatorialKalmanFilter.hpp +++ b/Core/include/Acts/TrackFinding/CombinatorialKalmanFilter.hpp @@ -365,7 +365,7 @@ class CombinatorialKalmanFilter { ACTS_VERBOSE("Create temp track state with mask: " << mask); // CAREFUL! This trackstate has a previous index that is not in this - // MultiTrajectory Visiting brackwards from this track state will + // MultiTrajectory Visiting backwards from this track state will // fail! auto ts = bufferTrajectory.makeTrackState(mask, prevTip); diff --git a/Core/include/Acts/TrackFinding/MeasurementSelector.hpp b/Core/include/Acts/TrackFinding/MeasurementSelector.hpp index fd348d44075..4c205820b76 100644 --- a/Core/include/Acts/TrackFinding/MeasurementSelector.hpp +++ b/Core/include/Acts/TrackFinding/MeasurementSelector.hpp @@ -11,7 +11,6 @@ #include "Acts/Definitions/TrackParametrization.hpp" #include "Acts/EventData/MeasurementHelpers.hpp" #include "Acts/EventData/MultiTrajectory.hpp" -#include "Acts/EventData/TrackParameters.hpp" #include "Acts/EventData/Types.hpp" #include "Acts/Geometry/GeometryHierarchyMap.hpp" #include "Acts/Geometry/GeometryIdentifier.hpp" @@ -21,7 +20,6 @@ #include #include -#include #include #include #include diff --git a/Core/include/Acts/Utilities/Helpers.hpp b/Core/include/Acts/Utilities/Helpers.hpp index 44bf23d9157..6e60443da36 100644 --- a/Core/include/Acts/Utilities/Helpers.hpp +++ b/Core/include/Acts/Utilities/Helpers.hpp @@ -15,8 +15,6 @@ #include #include #include -#include -#include #include #include @@ -221,4 +219,49 @@ struct overloaded : Ts... { template overloaded(Ts...) -> overloaded; +namespace detail { + +/// Computes the minimum, maximum, and bin count for a given vector of values. +/// +/// This function processes a vector of doubles to compute: +/// - The minimum value (@c xMin) +/// - The maximum value (@c xMax), adjusted to include an additional bin +/// - The bin count (@c xBinCount) based on the number of unique values +/// +/// The computation is performed as follows: +/// 1. Sorts the input vector using @c std::ranges::sort to prepare for uniqueness. +/// 2. Determines the number of unique values using @c std::unique and calculates the bin count. +/// 3. Calculates the minimum and maximum using @c std::ranges::minmax. +/// 4. Adjusts the maximum to include an additional bin by adding the bin step +/// size. +/// +/// @param xPos A reference to a vector of doubles. +/// @return A tuple containing: +/// - The minimum value (double) +/// - The adjusted maximum value (double) +/// - The bin count (std::size_t) +/// +/// @note The vector xPos will be modified during the call. +inline auto getMinMaxAndBinCount(std::vector& xPos) { + // sort the values for unique() + std::ranges::sort(xPos); + + // get the number of bins over unique values + auto it = std::unique(xPos.begin(), xPos.end()); + const std::size_t xBinCount = std::distance(xPos.begin(), it); + + // get the minimum and maximum + auto [xMin, xMax] = std::ranges::minmax(xPos); + + // calculate maxima (add one last bin, because bin value always corresponds to + // left boundary) + const double stepX = (xMax - xMin) / static_cast(xBinCount - 1); + xMax += stepX; + + // Return all values as a tuple + return std::make_tuple(xMin, xMax, xBinCount); +} + +} // namespace detail + } // namespace Acts diff --git a/Core/src/MagneticField/BFieldMapUtils.cpp b/Core/src/MagneticField/BFieldMapUtils.cpp index b5b92191589..f5b1b410ffe 100644 --- a/Core/src/MagneticField/BFieldMapUtils.cpp +++ b/Core/src/MagneticField/BFieldMapUtils.cpp @@ -12,12 +12,14 @@ #include "Acts/MagneticField/SolenoidBField.hpp" #include "Acts/Utilities/Axis.hpp" #include "Acts/Utilities/Grid.hpp" +#include "Acts/Utilities/Helpers.hpp" #include "Acts/Utilities/Result.hpp" #include "Acts/Utilities/VectorHelpers.hpp" #include "Acts/Utilities/detail/grid_helper.hpp" #include #include +#include #include #include #include @@ -35,100 +37,73 @@ Acts::fieldMapRZ( std::array nBinsRZ)>& localToGlobalBin, std::vector rPos, std::vector zPos, - std::vector bField, double lengthUnit, double BFieldUnit, + const std::vector& bField, double lengthUnit, double BFieldUnit, bool firstQuadrant) { // [1] Create Grid - // sort the values - std::ranges::sort(rPos); - std::ranges::sort(zPos); - // Get unique values - rPos.erase(std::unique(rPos.begin(), rPos.end()), rPos.end()); - zPos.erase(std::unique(zPos.begin(), zPos.end()), zPos.end()); - rPos.shrink_to_fit(); - zPos.shrink_to_fit(); - // get the number of bins - std::size_t nBinsR = rPos.size(); - std::size_t nBinsZ = zPos.size(); - - // get the minimum and maximum. We just sorted the vectors, so these are just - // the first and last elements. - double rMin = rPos[0]; - double zMin = zPos[0]; - double rMax = rPos[nBinsR - 1]; - double zMax = zPos[nBinsZ - 1]; - // calculate maxima (add one last bin, because bin value always corresponds to - // left boundary) - double stepZ = std::abs(zMax - zMin) / (nBinsZ - 1); - double stepR = std::abs(rMax - rMin) / (nBinsR - 1); - rMax += stepR; - zMax += stepZ; + const auto [rMin, rMax, rBinCount] = detail::getMinMaxAndBinCount(rPos); + auto [zMin, zMax, zBinCount] = detail::getMinMaxAndBinCount(zPos); + + const std::size_t nBinsR = rBinCount; + std::size_t nBinsZ = zBinCount; + if (firstQuadrant) { zMin = -zPos[nBinsZ - 1]; - nBinsZ = static_cast(2. * nBinsZ - 1); + nBinsZ = 2 * nBinsZ - 1; } // Create the axis for the grid - Acts::Axis rAxis(rMin * lengthUnit, rMax * lengthUnit, nBinsR); - Acts::Axis zAxis(zMin * lengthUnit, zMax * lengthUnit, nBinsZ); + Axis rAxis(rMin * lengthUnit, rMax * lengthUnit, nBinsR); + Axis zAxis(zMin * lengthUnit, zMax * lengthUnit, nBinsZ); // Create the grid - Grid grid(Type, std::move(rAxis), std::move(zAxis)); + Grid grid(Type, std::move(rAxis), std::move(zAxis)); using Grid_t = decltype(grid); // [2] Set the bField values + const std::array nIndices = {{rBinCount, zBinCount}}; for (std::size_t i = 1; i <= nBinsR; ++i) { for (std::size_t j = 1; j <= nBinsZ; ++j) { - std::array nIndices = {{rPos.size(), zPos.size()}}; Grid_t::index_t indices = {{i, j}}; + // std::vectors begin with 0 and we do not want the user needing to take + // underflow or overflow bins in account this is why we need to subtract + // by one if (firstQuadrant) { - // std::vectors begin with 0 and we do not want the user needing to - // take underflow or overflow bins in account this is why we need to - // subtract by one - std::size_t n = - std::abs(static_cast(j) - static_cast(zPos.size())); - Grid_t::index_t indicesFirstQuadrant = {{i - 1, n}}; + std::size_t n = std::abs(static_cast(j) - + static_cast(zBinCount)); grid.atLocalBins(indices) = - bField.at(localToGlobalBin(indicesFirstQuadrant, nIndices)) * - BFieldUnit; + bField.at(localToGlobalBin({{i - 1, n}}, nIndices)) * BFieldUnit; } else { - // std::vectors begin with 0 and we do not want the user needing to - // take underflow or overflow bins in account this is why we need to - // subtract by one grid.atLocalBins(indices) = bField.at(localToGlobalBin({{i - 1, j - 1}}, nIndices)) * BFieldUnit; } } } - grid.setExteriorBins(Acts::Vector2::Zero()); + grid.setExteriorBins(Vector2::Zero()); - // [3] Create the transformation for the position - // map (x,y,z) -> (r,z) - auto transformPos = [](const Acts::Vector3& pos) { - return Acts::Vector2(perp(pos), pos.z()); + // [3] Create the transformation for the position map (x,y,z) -> (r,z) + auto transformPos = [](const Vector3& pos) { + return Vector2(perp(pos), pos.z()); }; - // [4] Create the transformation for the bfield - // map (Br,Bz) -> (Bx,By,Bz) - auto transformBField = [](const Acts::Vector2& field, - const Acts::Vector3& pos) { - double r_sin_theta_2 = pos.x() * pos.x() + pos.y() * pos.y(); - double cos_phi = 0, sin_phi = 0; - if (r_sin_theta_2 > std::numeric_limits::min()) { - double inv_r_sin_theta = 1. / sqrt(r_sin_theta_2); - cos_phi = pos.x() * inv_r_sin_theta; - sin_phi = pos.y() * inv_r_sin_theta; - } else { - cos_phi = 1.; - sin_phi = 0.; + // [4] Create the transformation for the bField map (Br,Bz) -> (Bx,By,Bz) + auto transformBField = [](const Vector2& field, const Vector3& pos) { + const double rSinTheta2 = pos.x() * pos.x() + pos.y() * pos.y(); + double cosPhi = 1.; + double sinPhi = 0.; + + if (rSinTheta2 > std::numeric_limits::min()) { + const double invRsinTheta = 1. / std::sqrt(rSinTheta2); + cosPhi = pos.x() * invRsinTheta; + sinPhi = pos.y() * invRsinTheta; } - return Acts::Vector3(field.x() * cos_phi, field.x() * sin_phi, field.y()); + + return Vector3(field.x() * cosPhi, field.x() * sinPhi, field.y()); }; - // [5] Create the mapper & BField Service - // create field mapping - return Acts::InterpolatedBFieldMap( + // [5] Create the mapper & BField Service create field mapping + return InterpolatedBFieldMap( {transformPos, transformBField, std::move(grid)}); } @@ -141,88 +116,58 @@ Acts::fieldMapXYZ( std::array nBinsXYZ)>& localToGlobalBin, std::vector xPos, std::vector yPos, - std::vector zPos, std::vector bField, + std::vector zPos, const std::vector& bField, double lengthUnit, double BFieldUnit, bool firstOctant) { // [1] Create Grid - // Sort the values - std::ranges::sort(xPos); - std::ranges::sort(yPos); - std::ranges::sort(zPos); - // Get unique values - xPos.erase(std::unique(xPos.begin(), xPos.end()), xPos.end()); - yPos.erase(std::unique(yPos.begin(), yPos.end()), yPos.end()); - zPos.erase(std::unique(zPos.begin(), zPos.end()), zPos.end()); - xPos.shrink_to_fit(); - yPos.shrink_to_fit(); - zPos.shrink_to_fit(); - // get the number of bins - std::size_t nBinsX = xPos.size(); - std::size_t nBinsY = yPos.size(); - std::size_t nBinsZ = zPos.size(); + auto [xMin, xMax, xBinCount] = detail::getMinMaxAndBinCount(xPos); + auto [yMin, yMax, yBinCount] = detail::getMinMaxAndBinCount(yPos); + auto [zMin, zMax, zBinCount] = detail::getMinMaxAndBinCount(zPos); - // Create the axis for the grid - // get minima and maximia. We just sorted the vectors, so these are just the - // first and last elements. - double xMin = xPos[0]; - double yMin = yPos[0]; - double zMin = zPos[0]; - // get maxima - double xMax = xPos[nBinsX - 1]; - double yMax = yPos[nBinsY - 1]; - double zMax = zPos[nBinsZ - 1]; - // calculate maxima (add one last bin, because bin value always corresponds to - // left boundary) - double stepZ = std::abs(zMax - zMin) / (nBinsZ - 1); - double stepY = std::abs(yMax - yMin) / (nBinsY - 1); - double stepX = std::abs(xMax - xMin) / (nBinsX - 1); - xMax += stepX; - yMax += stepY; - zMax += stepZ; + std::size_t nBinsX = xBinCount; + std::size_t nBinsY = yBinCount; + std::size_t nBinsZ = zBinCount; - // If only the first octant is given if (firstOctant) { xMin = -xPos[nBinsX - 1]; - yMin = -yPos[nBinsY - 1]; - zMin = -zPos[nBinsZ - 1]; nBinsX = 2 * nBinsX - 1; + yMin = -yPos[nBinsY - 1]; nBinsY = 2 * nBinsY - 1; + zMin = -zPos[nBinsZ - 1]; nBinsZ = 2 * nBinsZ - 1; } - Acts::Axis xAxis(xMin * lengthUnit, xMax * lengthUnit, nBinsX); - Acts::Axis yAxis(yMin * lengthUnit, yMax * lengthUnit, nBinsY); - Acts::Axis zAxis(zMin * lengthUnit, zMax * lengthUnit, nBinsZ); + + Axis xAxis(xMin * lengthUnit, xMax * lengthUnit, nBinsX); + Axis yAxis(yMin * lengthUnit, yMax * lengthUnit, nBinsY); + Axis zAxis(zMin * lengthUnit, zMax * lengthUnit, nBinsZ); // Create the grid Grid grid(Type, std::move(xAxis), std::move(yAxis), std::move(zAxis)); using Grid_t = decltype(grid); // [2] Set the bField values + const std::array nIndices = { + {xBinCount, yBinCount, zBinCount}}; + + auto calcAbsDiff = [](std::size_t val, std::size_t binCount) { + return std::abs(static_cast(val) - + static_cast(binCount)); + }; + for (std::size_t i = 1; i <= nBinsX; ++i) { for (std::size_t j = 1; j <= nBinsY; ++j) { for (std::size_t k = 1; k <= nBinsZ; ++k) { Grid_t::index_t indices = {{i, j, k}}; - std::array nIndices = { - {xPos.size(), yPos.size(), zPos.size()}}; + // std::vectors begin with 0 and we do not want the user needing to take + // underflow or overflow bins in account this is why we need to subtract + // by one if (firstOctant) { - // std::vectors begin with 0 and we do not want the user needing to - // take underflow or overflow bins in account this is why we need to - // subtract by one - std::size_t m = - std::abs(static_cast(i) - (static_cast(xPos.size()))); - std::size_t n = - std::abs(static_cast(j) - (static_cast(yPos.size()))); - std::size_t l = - std::abs(static_cast(k) - (static_cast(zPos.size()))); - Grid_t::index_t indicesFirstOctant = {{m, n, l}}; + const std::size_t l = calcAbsDiff(i, xBinCount); + const std::size_t m = calcAbsDiff(j, yBinCount); + const std::size_t n = calcAbsDiff(k, zBinCount); grid.atLocalBins(indices) = - bField.at(localToGlobalBin(indicesFirstOctant, nIndices)) * - BFieldUnit; - + bField.at(localToGlobalBin({{l, m, n}}, nIndices)) * BFieldUnit; } else { - // std::vectors begin with 0 and we do not want the user needing to - // take underflow or overflow bins in account this is why we need to - // subtract by one grid.atLocalBins(indices) = bField.at(localToGlobalBin({{i - 1, j - 1, k - 1}}, nIndices)) * BFieldUnit; @@ -230,74 +175,67 @@ Acts::fieldMapXYZ( } } } - grid.setExteriorBins(Acts::Vector3::Zero()); + grid.setExteriorBins(Vector3::Zero()); - // [3] Create the transformation for the position - // map (x,y,z) -> (r,z) - auto transformPos = [](const Acts::Vector3& pos) { return pos; }; + // [3] Create the transformation for the position map (x,y,z) -> (r,z) + auto transformPos = [](const Vector3& pos) { return pos; }; - // [4] Create the transformation for the bfield - // map (Bx,By,Bz) -> (Bx,By,Bz) - auto transformBField = [](const Acts::Vector3& field, - const Acts::Vector3& /*pos*/) { return field; }; + // [4] Create the transformation for the BField map (Bx,By,Bz) -> (Bx,By,Bz) + auto transformBField = [](const Vector3& field, const Vector3& /*pos*/) { + return field; + }; - // [5] Create the mapper & BField Service - // create field mapping - return Acts::InterpolatedBFieldMap( + // [5] Create the mapper & BField Service create field mapping + return InterpolatedBFieldMap( {transformPos, transformBField, std::move(grid)}); } Acts::InterpolatedBFieldMap< Acts::Grid, Acts::Axis>> -Acts::solenoidFieldMap(std::pair rlim, - std::pair zlim, - std::pair nbins, +Acts::solenoidFieldMap(const std::pair& rLim, + const std::pair& zLim, + const std::pair& nBins, const SolenoidBField& field) { - auto [rMin, rMax] = rlim; - auto [zMin, zMax] = zlim; - const auto [nBinsR, nBinsZ] = nbins; + auto [rMin, rMax] = rLim; + auto [zMin, zMax] = zLim; + const auto [nBinsR, nBinsZ] = nBins; double stepZ = std::abs(zMax - zMin) / (nBinsZ - 1); double stepR = std::abs(rMax - rMin) / (nBinsR - 1); - rMax += stepR; zMax += stepZ; // Create the axis for the grid - Acts::Axis rAxis(rMin, rMax, nBinsR); - Acts::Axis zAxis(zMin, zMax, nBinsZ); + Axis rAxis(rMin, rMax, nBinsR); + Axis zAxis(zMin, zMax, nBinsZ); // Create the grid - Grid grid(Type, std::move(rAxis), std::move(zAxis)); + Grid grid(Type, std::move(rAxis), std::move(zAxis)); using Grid_t = decltype(grid); - // Create the transformation for the position - // map (x,y,z) -> (r,z) - auto transformPos = [](const Acts::Vector3& pos) { - return Acts::Vector2(perp(pos), pos.z()); + // Create the transformation for the position map (x,y,z) -> (r,z) + auto transformPos = [](const Vector3& pos) { + return Vector2(perp(pos), pos.z()); }; - // Create the transformation for the bfield - // map (Br,Bz) -> (Bx,By,Bz) - auto transformBField = [](const Acts::Vector2& bfield, - const Acts::Vector3& pos) { - double r_sin_theta_2 = pos.x() * pos.x() + pos.y() * pos.y(); - double cos_phi = 0, sin_phi = 0; - if (r_sin_theta_2 > std::numeric_limits::min()) { - double inv_r_sin_theta = 1. / sqrt(r_sin_theta_2); - cos_phi = pos.x() * inv_r_sin_theta; - sin_phi = pos.y() * inv_r_sin_theta; - } else { - cos_phi = 1.; - sin_phi = 0.; + // Create the transformation for the bField map (Br,Bz) -> (Bx,By,Bz) + auto transformBField = [](const Vector2& bField, const Vector3& pos) { + const double rSinTheta2 = pos.x() * pos.x() + pos.y() * pos.y(); + double cosPhi = 1.; + double sinPhi = 0.; + + if (rSinTheta2 > std::numeric_limits::min()) { + const double invRsinTheta = 1. / std::sqrt(rSinTheta2); + cosPhi = pos.x() * invRsinTheta; + sinPhi = pos.y() * invRsinTheta; } - return Acts::Vector3(bfield.x() * cos_phi, bfield.x() * sin_phi, - bfield.y()); + + return Vector3(bField.x() * cosPhi, bField.x() * sinPhi, bField.y()); }; - // iterate over all bins, set their value to the solenoid value - // at their lower left position + // iterate over all bins, set their value to the solenoid value at their lower + // left position for (std::size_t i = 0; i <= nBinsR + 1; i++) { for (std::size_t j = 0; j <= nBinsZ + 1; j++) { Grid_t::index_t index({i, j}); @@ -314,9 +252,8 @@ Acts::solenoidFieldMap(std::pair rlim, } } - // Create the mapper & BField Service - // create field mapping - Acts::InterpolatedBFieldMap map( + // Create the mapper & BField Service create field mapping + InterpolatedBFieldMap map( {transformPos, transformBField, std::move(grid)}); return map; } diff --git a/Core/src/Material/MaterialMapUtils.cpp b/Core/src/Material/MaterialMapUtils.cpp index b51b1a3e223..8f4d23cd71e 100644 --- a/Core/src/Material/MaterialMapUtils.cpp +++ b/Core/src/Material/MaterialMapUtils.cpp @@ -12,6 +12,7 @@ #include "Acts/Material/Material.hpp" #include "Acts/Utilities/Axis.hpp" #include "Acts/Utilities/Grid.hpp" +#include "Acts/Utilities/Helpers.hpp" #include #include @@ -43,31 +44,8 @@ auto Acts::materialMapperRZ( } // [2] Create Grid - // sort the values - std::ranges::sort(rPos); - std::ranges::sort(zPos); - // Get unique values - rPos.erase(std::unique(rPos.begin(), rPos.end()), rPos.end()); - zPos.erase(std::unique(zPos.begin(), zPos.end()), zPos.end()); - rPos.shrink_to_fit(); - zPos.shrink_to_fit(); - // get the number of bins - std::size_t nBinsR = rPos.size(); - std::size_t nBinsZ = zPos.size(); - - // get the minimum and maximum - auto minMaxR = std::minmax_element(rPos.begin(), rPos.end()); - auto minMaxZ = std::minmax_element(zPos.begin(), zPos.end()); - double rMin = *minMaxR.first; - double zMin = *minMaxZ.first; - double rMax = *minMaxR.second; - double zMax = *minMaxZ.second; - // calculate maxima (add one last bin, because bin value always corresponds to - // left boundary) - double stepZ = std::abs(zMax - zMin) / (nBinsZ - 1); - double stepR = std::abs(rMax - rMin) / (nBinsR - 1); - rMax += stepR; - zMax += stepZ; + const auto [rMin, rMax, nBinsR] = detail::getMinMaxAndBinCount(rPos); + const auto [zMin, zMax, nBinsZ] = detail::getMinMaxAndBinCount(zPos); // Create the axis for the grid Axis rAxis(rMin * lengthUnit, rMax * lengthUnit, nBinsR); @@ -79,13 +57,13 @@ auto Acts::materialMapperRZ( using Grid_t = decltype(grid); // [3] Set the material values + const std::array nIndices = {{nBinsR, nBinsZ}}; for (std::size_t i = 1; i <= nBinsR; ++i) { for (std::size_t j = 1; j <= nBinsZ; ++j) { - std::array nIndices = {{rPos.size(), zPos.size()}}; Grid_t::index_t indices = {{i, j}}; - // std::vectors begin with 0 and we do not want the user needing to - // take underflow or overflow bins in account this is why we need to - // subtract by one + // std::vectors begin with 0 and we do not want the user needing to take + // underflow or overflow bins in account this is why we need to subtract + // by one grid.atLocalBins(indices) = materialVector.at( materialVectorToGridMapper({{i - 1, j - 1}}, nIndices)); } @@ -95,14 +73,12 @@ auto Acts::materialMapperRZ( 0., 0., 0.; grid.setExteriorBins(vec); - // [4] Create the transformation for the position - // map (x,y,z) -> (r,z) + // [4] Create the transformation for the position map (x,y,z) -> (r,z) auto transformPos = [](const Vector3& pos) { return Vector2(perp(pos), pos.z()); }; - // [5] Create the mapper & BField Service - // create material mapping + // [5] Create the mapper & BField Service create material mapping return MaterialMapper(transformPos, std::move(grid)); } @@ -125,44 +101,11 @@ auto Acts::materialMapperXYZ( } // [2] Create Grid - // Sort the values - std::ranges::sort(xPos); - std::ranges::sort(yPos); - std::ranges::sort(zPos); - // Get unique values - xPos.erase(std::unique(xPos.begin(), xPos.end()), xPos.end()); - yPos.erase(std::unique(yPos.begin(), yPos.end()), yPos.end()); - zPos.erase(std::unique(zPos.begin(), zPos.end()), zPos.end()); - xPos.shrink_to_fit(); - yPos.shrink_to_fit(); - zPos.shrink_to_fit(); - // get the number of bins - std::size_t nBinsX = xPos.size(); - std::size_t nBinsY = yPos.size(); - std::size_t nBinsZ = zPos.size(); - - // get the minimum and maximum - auto minMaxX = std::minmax_element(xPos.begin(), xPos.end()); - auto minMaxY = std::minmax_element(yPos.begin(), yPos.end()); - auto minMaxZ = std::minmax_element(zPos.begin(), zPos.end()); - // Create the axis for the grid - // get minima - double xMin = *minMaxX.first; - double yMin = *minMaxY.first; - double zMin = *minMaxZ.first; - // get maxima - double xMax = *minMaxX.second; - double yMax = *minMaxY.second; - double zMax = *minMaxZ.second; - // calculate maxima (add one last bin, because bin value always corresponds to - // left boundary) - double stepZ = std::abs(zMax - zMin) / (nBinsZ - 1); - double stepY = std::abs(yMax - yMin) / (nBinsY - 1); - double stepX = std::abs(xMax - xMin) / (nBinsX - 1); - xMax += stepX; - yMax += stepY; - zMax += stepZ; + const auto [xMin, xMax, nBinsX] = detail::getMinMaxAndBinCount(xPos); + const auto [yMin, yMax, nBinsY] = detail::getMinMaxAndBinCount(yPos); + const auto [zMin, zMax, nBinsZ] = detail::getMinMaxAndBinCount(zPos); + // Create the axis for the grid Axis xAxis(xMin * lengthUnit, xMax * lengthUnit, nBinsX); Axis yAxis(yMin * lengthUnit, yMax * lengthUnit, nBinsY); Axis zAxis(zMin * lengthUnit, zMax * lengthUnit, nBinsZ); @@ -172,15 +115,14 @@ auto Acts::materialMapperXYZ( using Grid_t = decltype(grid); // [3] Set the bField values + const std::array nIndices = {{nBinsX, nBinsY, nBinsZ}}; for (std::size_t i = 1; i <= nBinsX; ++i) { for (std::size_t j = 1; j <= nBinsY; ++j) { for (std::size_t k = 1; k <= nBinsZ; ++k) { Grid_t::index_t indices = {{i, j, k}}; - std::array nIndices = { - {xPos.size(), yPos.size(), zPos.size()}}; - // std::vectors begin with 0 and we do not want the user needing to - // take underflow or overflow bins in account this is why we need to - // subtract by one + // std::vectors begin with 0 and we do not want the user needing to take + // underflow or overflow bins in account this is why we need to subtract + // by one grid.atLocalBins(indices) = materialVector.at( materialVectorToGridMapper({{i - 1, j - 1, k - 1}}, nIndices)); } @@ -191,11 +133,9 @@ auto Acts::materialMapperXYZ( 0., 0., 0.; grid.setExteriorBins(vec); - // [4] Create the transformation for the position - // map (x,y,z) -> (r,z) + // [4] Create the transformation for the position map (x,y,z) -> (r,z) auto transformPos = [](const Vector3& pos) { return pos; }; - // [5] Create the mapper & BField Service - // create material mapping + // [5] Create the mapper & BField Service create material mapping return MaterialMapper(transformPos, std::move(grid)); } diff --git a/Examples/Algorithms/Digitization/src/DigitizationAlgorithm.cpp b/Examples/Algorithms/Digitization/src/DigitizationAlgorithm.cpp index 08b19b34ba1..d7b4754cb3a 100644 --- a/Examples/Algorithms/Digitization/src/DigitizationAlgorithm.cpp +++ b/Examples/Algorithms/Digitization/src/DigitizationAlgorithm.cpp @@ -13,11 +13,15 @@ #include "Acts/Geometry/GeometryIdentifier.hpp" #include "Acts/Utilities/BinUtility.hpp" #include "ActsExamples/Digitization/ModuleClusters.hpp" +#include "ActsExamples/EventData/GeometryContainers.hpp" +#include "ActsExamples/EventData/Index.hpp" #include "ActsExamples/Framework/AlgorithmContext.hpp" +#include "ActsExamples/Utilities/Range.hpp" #include "ActsFatras/EventData/Barcode.hpp" #include #include +#include #include #include #include diff --git a/Examples/Algorithms/Digitization/src/MeasurementCreation.cpp b/Examples/Algorithms/Digitization/src/MeasurementCreation.cpp index 066901cc0cf..0e2f0668615 100644 --- a/Examples/Algorithms/Digitization/src/MeasurementCreation.cpp +++ b/Examples/Algorithms/Digitization/src/MeasurementCreation.cpp @@ -9,14 +9,11 @@ #include "ActsExamples/Digitization/MeasurementCreation.hpp" #include "Acts/EventData/MeasurementHelpers.hpp" -#include "Acts/EventData/SourceLink.hpp" #include "Acts/Geometry/GeometryIdentifier.hpp" -#include "ActsExamples/EventData/IndexSourceLink.hpp" #include "ActsExamples/EventData/Measurement.hpp" #include #include -#include ActsExamples::VariableBoundMeasurementProxy ActsExamples::createMeasurement( MeasurementContainer& container, Acts::GeometryIdentifier geometryId, diff --git a/Examples/Algorithms/TrackFinding/include/ActsExamples/TrackFinding/TrackFindingAlgorithm.hpp b/Examples/Algorithms/TrackFinding/include/ActsExamples/TrackFinding/TrackFindingAlgorithm.hpp index 0f532be2d28..804d554515d 100644 --- a/Examples/Algorithms/TrackFinding/include/ActsExamples/TrackFinding/TrackFindingAlgorithm.hpp +++ b/Examples/Algorithms/TrackFinding/include/ActsExamples/TrackFinding/TrackFindingAlgorithm.hpp @@ -8,11 +8,10 @@ #pragma once -#include "Acts/EventData/SourceLink.hpp" #include "Acts/EventData/TrackContainer.hpp" -#include "Acts/EventData/TrackProxy.hpp" #include "Acts/EventData/VectorMultiTrajectory.hpp" #include "Acts/Geometry/TrackingGeometry.hpp" +#include "Acts/MagneticField/MagneticFieldProvider.hpp" #include "Acts/TrackFinding/CombinatorialKalmanFilter.hpp" #include "Acts/TrackFinding/MeasurementSelector.hpp" #include "Acts/TrackFinding/TrackSelector.hpp" @@ -32,7 +31,6 @@ #include #include #include -#include #include #include #include diff --git a/Examples/Algorithms/TrackFinding/include/ActsExamples/TrackFinding/TrackParamsEstimationAlgorithm.hpp b/Examples/Algorithms/TrackFinding/include/ActsExamples/TrackFinding/TrackParamsEstimationAlgorithm.hpp index 1df8dc87700..3e39b4c24e7 100644 --- a/Examples/Algorithms/TrackFinding/include/ActsExamples/TrackFinding/TrackParamsEstimationAlgorithm.hpp +++ b/Examples/Algorithms/TrackFinding/include/ActsExamples/TrackFinding/TrackParamsEstimationAlgorithm.hpp @@ -8,12 +8,9 @@ #pragma once -#include "Acts/Definitions/TrackParametrization.hpp" #include "Acts/Definitions/Units.hpp" #include "Acts/EventData/ParticleHypothesis.hpp" #include "Acts/Geometry/TrackingGeometry.hpp" -#include "Acts/MagneticField/ConstantBField.hpp" -#include "Acts/MagneticField/InterpolatedBFieldMap.hpp" #include "Acts/Utilities/Logger.hpp" #include "ActsExamples/EventData/ProtoTrack.hpp" #include "ActsExamples/EventData/SimSeed.hpp" @@ -21,14 +18,10 @@ #include "ActsExamples/Framework/DataHandle.hpp" #include "ActsExamples/Framework/IAlgorithm.hpp" #include "ActsExamples/Framework/ProcessCode.hpp" -#include "ActsExamples/MagneticField/MagneticField.hpp" -#include #include -#include #include #include -#include namespace Acts { class TrackingGeometry; diff --git a/Examples/Algorithms/TrackFinding/src/GbtsSeedingAlgorithm.cpp b/Examples/Algorithms/TrackFinding/src/GbtsSeedingAlgorithm.cpp index 677ba2b4c10..c126225aea1 100644 --- a/Examples/Algorithms/TrackFinding/src/GbtsSeedingAlgorithm.cpp +++ b/Examples/Algorithms/TrackFinding/src/GbtsSeedingAlgorithm.cpp @@ -355,7 +355,7 @@ ActsExamples::GbtsSeedingAlgorithm::LayerNumbering() const { } }); - for (long unsigned int i = 0; i < input_vector.size(); i++) { + for (std::size_t i = 0; i < input_vector.size(); i++) { input_vector[i].m_refCoord = input_vector[i].m_refCoord / count_vector[i]; } diff --git a/Examples/Algorithms/TrackFinding/src/SeedingAlgorithm.cpp b/Examples/Algorithms/TrackFinding/src/SeedingAlgorithm.cpp index 2cea4b7b505..fe69a290935 100644 --- a/Examples/Algorithms/TrackFinding/src/SeedingAlgorithm.cpp +++ b/Examples/Algorithms/TrackFinding/src/SeedingAlgorithm.cpp @@ -10,20 +10,15 @@ #include "Acts/Definitions/Algebra.hpp" #include "Acts/EventData/Seed.hpp" -#include "Acts/EventData/SpacePointData.hpp" #include "Acts/Seeding/BinnedGroup.hpp" #include "Acts/Seeding/SeedFilter.hpp" -#include "Acts/Utilities/BinningType.hpp" #include "Acts/Utilities/Delegate.hpp" -#include "Acts/Utilities/Grid.hpp" #include "Acts/Utilities/GridBinFinder.hpp" -#include "Acts/Utilities/Helpers.hpp" #include "ActsExamples/EventData/SimSeed.hpp" #include #include #include -#include #include #include #include diff --git a/Examples/Algorithms/TrackFinding/src/SpacePointMaker.cpp b/Examples/Algorithms/TrackFinding/src/SpacePointMaker.cpp index 673ffa8b103..36bf40a3544 100644 --- a/Examples/Algorithms/TrackFinding/src/SpacePointMaker.cpp +++ b/Examples/Algorithms/TrackFinding/src/SpacePointMaker.cpp @@ -9,7 +9,6 @@ #include "ActsExamples/TrackFinding/SpacePointMaker.hpp" #include "Acts/Definitions/Algebra.hpp" -#include "Acts/Definitions/TrackParametrization.hpp" #include "Acts/EventData/SourceLink.hpp" #include "Acts/SpacePointFormation/SpacePointBuilderConfig.hpp" #include "Acts/SpacePointFormation/SpacePointBuilderOptions.hpp" @@ -19,7 +18,6 @@ #include "ActsExamples/EventData/SimSpacePoint.hpp" #include "ActsExamples/Framework/AlgorithmContext.hpp" #include "ActsExamples/Utilities/GroupBy.hpp" -#include "ActsExamples/Utilities/Range.hpp" #include #include @@ -27,7 +25,6 @@ #include #include #include -#include ActsExamples::SpacePointMaker::SpacePointMaker(Config cfg, Acts::Logging::Level lvl) diff --git a/Examples/Algorithms/TrackFinding/src/TrackParamsEstimationAlgorithm.cpp b/Examples/Algorithms/TrackFinding/src/TrackParamsEstimationAlgorithm.cpp index f2711ce1d1a..8f349dd6193 100644 --- a/Examples/Algorithms/TrackFinding/src/TrackParamsEstimationAlgorithm.cpp +++ b/Examples/Algorithms/TrackFinding/src/TrackParamsEstimationAlgorithm.cpp @@ -13,9 +13,9 @@ #include "Acts/EventData/Seed.hpp" #include "Acts/Geometry/GeometryIdentifier.hpp" #include "Acts/Geometry/TrackingGeometry.hpp" +#include "Acts/MagneticField/MagneticFieldProvider.hpp" #include "Acts/Seeding/EstimateTrackParamsFromSeed.hpp" #include "Acts/Surfaces/Surface.hpp" -#include "Acts/Utilities/Result.hpp" #include "ActsExamples/EventData/IndexSourceLink.hpp" #include "ActsExamples/EventData/SimSpacePoint.hpp" #include "ActsExamples/EventData/Track.hpp" diff --git a/Examples/Algorithms/TruthTracking/ActsExamples/TruthTracking/TruthSeedingAlgorithm.cpp b/Examples/Algorithms/TruthTracking/ActsExamples/TruthTracking/TruthSeedingAlgorithm.cpp index b1e19293a6e..6ea0225e200 100644 --- a/Examples/Algorithms/TruthTracking/ActsExamples/TruthTracking/TruthSeedingAlgorithm.cpp +++ b/Examples/Algorithms/TruthTracking/ActsExamples/TruthTracking/TruthSeedingAlgorithm.cpp @@ -9,7 +9,6 @@ #include "ActsExamples/TruthTracking/TruthSeedingAlgorithm.hpp" #include "Acts/EventData/SourceLink.hpp" -#include "Acts/Utilities/MultiIndex.hpp" #include "ActsExamples/EventData/IndexSourceLink.hpp" #include "ActsExamples/EventData/SimParticle.hpp" #include "ActsExamples/Utilities/Range.hpp" diff --git a/Examples/Framework/include/ActsExamples/EventData/GeometryContainers.hpp b/Examples/Framework/include/ActsExamples/EventData/GeometryContainers.hpp index 0724ed8c4ae..e88e8e9db38 100644 --- a/Examples/Framework/include/ActsExamples/EventData/GeometryContainers.hpp +++ b/Examples/Framework/include/ActsExamples/EventData/GeometryContainers.hpp @@ -8,16 +8,12 @@ #pragma once -#include "Acts/EventData/SourceLink.hpp" #include "Acts/Geometry/GeometryIdentifier.hpp" -#include "Acts/Surfaces/Surface.hpp" #include "ActsExamples/Utilities/GroupBy.hpp" #include "ActsExamples/Utilities/Range.hpp" #include #include -#include -#include #include #include diff --git a/Examples/Framework/include/ActsExamples/EventData/Measurement.hpp b/Examples/Framework/include/ActsExamples/EventData/Measurement.hpp index 174dc05ef40..251d7bc293a 100644 --- a/Examples/Framework/include/ActsExamples/EventData/Measurement.hpp +++ b/Examples/Framework/include/ActsExamples/EventData/Measurement.hpp @@ -19,6 +19,7 @@ #include "ActsExamples/EventData/MeasurementConcept.hpp" #include +#include #include #include diff --git a/Examples/Framework/include/ActsExamples/EventData/SimSpacePoint.hpp b/Examples/Framework/include/ActsExamples/EventData/SimSpacePoint.hpp index bf5780c5a76..4593b3f9e3d 100644 --- a/Examples/Framework/include/ActsExamples/EventData/SimSpacePoint.hpp +++ b/Examples/Framework/include/ActsExamples/EventData/SimSpacePoint.hpp @@ -11,7 +11,6 @@ #include "Acts/Definitions/Algebra.hpp" #include "Acts/Definitions/Common.hpp" #include "Acts/EventData/SourceLink.hpp" -#include "ActsExamples/EventData/Index.hpp" #include "ActsExamples/EventData/IndexSourceLink.hpp" #include diff --git a/Examples/Framework/src/EventData/MeasurementCalibration.cpp b/Examples/Framework/src/EventData/MeasurementCalibration.cpp index d7b8c96da70..5bf28eb3ab4 100644 --- a/Examples/Framework/src/EventData/MeasurementCalibration.cpp +++ b/Examples/Framework/src/EventData/MeasurementCalibration.cpp @@ -8,13 +8,11 @@ #include "ActsExamples/EventData/MeasurementCalibration.hpp" -#include "Acts/Definitions/TrackParametrization.hpp" #include "Acts/EventData/SourceLink.hpp" #include "ActsExamples/EventData/IndexSourceLink.hpp" #include "ActsExamples/EventData/Measurement.hpp" #include -#include namespace Acts { class VectorMultiTrajectory; diff --git a/Examples/Io/Root/include/ActsExamples/Io/Root/RootAthenaDumpReader.hpp b/Examples/Io/Root/include/ActsExamples/Io/Root/RootAthenaDumpReader.hpp index 2a09d8492b2..f7873bd0e2a 100644 --- a/Examples/Io/Root/include/ActsExamples/Io/Root/RootAthenaDumpReader.hpp +++ b/Examples/Io/Root/include/ActsExamples/Io/Root/RootAthenaDumpReader.hpp @@ -172,7 +172,7 @@ class RootAthenaDumpReader : public IReader { /// Vector of {eventNr, entryMin, entryMax} std::vector> m_eventMap; std::shared_ptr m_inputchain; - long unsigned int m_events; + std::size_t m_events; bool m_haveStripFeatures = true; static constexpr unsigned int maxCL = 1500000; diff --git a/Examples/Io/Root/src/RootAthenaDumpReader.cpp b/Examples/Io/Root/src/RootAthenaDumpReader.cpp index 47e5150501a..421affa36ba 100644 --- a/Examples/Io/Root/src/RootAthenaDumpReader.cpp +++ b/Examples/Io/Root/src/RootAthenaDumpReader.cpp @@ -672,6 +672,7 @@ RootAthenaDumpReader::reprocessParticles( } auto newParticle = particle.withParticleId(fatrasBarcode); + newParticle.final().setNumberOfHits(std::distance(begin, end)); newParticles.push_back(newParticle); for (auto it = begin; it != end; ++it) { diff --git a/Examples/Scripts/GsfDebugger/src/processors.py b/Examples/Scripts/GsfDebugger/src/processors.py index 3d42d06c123..71c39f5a3a4 100644 --- a/Examples/Scripts/GsfDebugger/src/processors.py +++ b/Examples/Scripts/GsfDebugger/src/processors.py @@ -1,7 +1,5 @@ -import traceback import re import copy -import sys from itertools import cycle import numpy as np diff --git a/Plugins/DD4hep/src/ConvertDD4hepDetector.cpp b/Plugins/DD4hep/src/ConvertDD4hepDetector.cpp index 848de200db0..be76e7c8278 100644 --- a/Plugins/DD4hep/src/ConvertDD4hepDetector.cpp +++ b/Plugins/DD4hep/src/ConvertDD4hepDetector.cpp @@ -21,7 +21,6 @@ #include "Acts/Geometry/TrackingVolumeArrayCreator.hpp" #include "Acts/Geometry/Volume.hpp" #include "Acts/Material/ISurfaceMaterial.hpp" -#include "Acts/Material/ProtoSurfaceMaterial.hpp" #include "Acts/Plugins/DD4hep/DD4hepConversionHelpers.hpp" #include "Acts/Plugins/DD4hep/DD4hepLayerBuilder.hpp" #include "Acts/Plugins/DD4hep/DD4hepMaterialHelpers.hpp" @@ -31,9 +30,7 @@ #include #include #include -#include #include -#include #include #include #include diff --git a/Plugins/DD4hep/src/DD4hepDetectorSurfaceFactory.cpp b/Plugins/DD4hep/src/DD4hepDetectorSurfaceFactory.cpp index c043a58d347..7f0275ed1a8 100644 --- a/Plugins/DD4hep/src/DD4hepDetectorSurfaceFactory.cpp +++ b/Plugins/DD4hep/src/DD4hepDetectorSurfaceFactory.cpp @@ -15,7 +15,6 @@ #include "Acts/Plugins/DD4hep/DD4hepConversionHelpers.hpp" #include "Acts/Plugins/DD4hep/DD4hepDetectorElement.hpp" #include "Acts/Plugins/TGeo/TGeoMaterialConverter.hpp" -#include "Acts/Plugins/TGeo/TGeoPrimitivesHelper.hpp" #include "Acts/Plugins/TGeo/TGeoSurfaceConverter.hpp" #include "DD4hep/DetElement.h" diff --git a/Plugins/DD4hep/src/DD4hepLayerBuilder.cpp b/Plugins/DD4hep/src/DD4hepLayerBuilder.cpp index c7cffaaf5aa..3ae1ecd9145 100644 --- a/Plugins/DD4hep/src/DD4hepLayerBuilder.cpp +++ b/Plugins/DD4hep/src/DD4hepLayerBuilder.cpp @@ -25,15 +25,12 @@ #include "Acts/Surfaces/RadialBounds.hpp" #include "Acts/Surfaces/Surface.hpp" #include "Acts/Surfaces/SurfaceArray.hpp" -#include "Acts/Utilities/Helpers.hpp" #include "Acts/Utilities/Logger.hpp" #include -#include #include #include #include -#include #include #include #include diff --git a/Tests/UnitTests/Plugins/GeoModel/GeoBoxToVolumeTest.cpp b/Tests/UnitTests/Plugins/GeoModel/GeoBoxToVolumeTest.cpp index b905fda65ee..426b7cc07c3 100644 --- a/Tests/UnitTests/Plugins/GeoModel/GeoBoxToVolumeTest.cpp +++ b/Tests/UnitTests/Plugins/GeoModel/GeoBoxToVolumeTest.cpp @@ -58,7 +58,7 @@ BOOST_AUTO_TEST_CASE(GeoBoxToSensitiveConversion) { const auto* bounds = dynamic_cast(&volumeBox->volumeBounds()); std::vector convHls = bounds->values(); - for (long unsigned int i = 0; i < hls.size(); i++) { + for (std::size_t i = 0; i < hls.size(); i++) { BOOST_CHECK(hls[i] == convHls[i]); } } diff --git a/Tests/UnitTests/Plugins/GeoModel/GeoDetectorObjectTest.cpp b/Tests/UnitTests/Plugins/GeoModel/GeoDetectorObjectTest.cpp index 033f2c9cb4a..ae3c4ec0420 100644 --- a/Tests/UnitTests/Plugins/GeoModel/GeoDetectorObjectTest.cpp +++ b/Tests/UnitTests/Plugins/GeoModel/GeoDetectorObjectTest.cpp @@ -43,7 +43,7 @@ void test(const Acts::GeoModelDetectorObjectFactory::Cache& cache, GeoModelDetObj::GeoDims geoDims) { for (const auto& box : cache.boundingBoxes) { const Acts::VolumeBounds& bounds = box->volumeBounds(); - for (long unsigned int i = 0; i < geoDims.boxO.size(); i++) { + for (std::size_t i = 0; i < geoDims.boxO.size(); i++) { BOOST_CHECK(geoDims.boxO[i] == bounds.values()[i]); } std::vector surfaces = box->surfaces(); @@ -75,7 +75,7 @@ void test(const Acts::GeoModelDetectorObjectFactory::Cache& cache, dynamic_cast(&sbounds); std::vector trapVerts = trapBounds->vertices(); - for (long unsigned int i = 0; i < trapVerts.size(); i++) { + for (std::size_t i = 0; i < trapVerts.size(); i++) { BOOST_CHECK(trapVerts[i][0] == geoDims.trapVerts[i][0]); BOOST_CHECK(trapVerts[i][1] == geoDims.trapVerts[i][1]); } diff --git a/Tests/UnitTests/Plugins/GeoModel/GeoPolyConverterTests.cpp b/Tests/UnitTests/Plugins/GeoModel/GeoPolyConverterTests.cpp index b273b0a2364..a9ed6fa6f56 100644 --- a/Tests/UnitTests/Plugins/GeoModel/GeoPolyConverterTests.cpp +++ b/Tests/UnitTests/Plugins/GeoModel/GeoPolyConverterTests.cpp @@ -88,7 +88,7 @@ BOOST_AUTO_TEST_CASE(GeoModelDetectorObjectFactory) { const auto* polyBounds = dynamic_cast(&polySurface->bounds()); std::vector convPolyVerts = polyBounds->vertices(); - for (long unsigned int i = 0; i < polyVerts.size(); i++) { + for (std::size_t i = 0; i < polyVerts.size(); i++) { BOOST_CHECK(polyVerts[i][0] == convPolyVerts[i][0]); BOOST_CHECK(polyVerts[i][1] == convPolyVerts[i][1]); } @@ -96,7 +96,7 @@ BOOST_AUTO_TEST_CASE(GeoModelDetectorObjectFactory) { const auto* trapBounds = dynamic_cast(&trapSurface->bounds()); std::vector convTrapVerts = trapBounds->vertices(); - for (long unsigned int i = 0; i < trapVerts.size(); i++) { + for (std::size_t i = 0; i < trapVerts.size(); i++) { BOOST_CHECK(trapVerts[i][0] == convTrapVerts[i][0]); BOOST_CHECK(trapVerts[i][1] == convTrapVerts[i][1]); } diff --git a/Tests/UnitTests/Plugins/GeoModel/GeoTubeToVolumeTest.cpp b/Tests/UnitTests/Plugins/GeoModel/GeoTubeToVolumeTest.cpp index 64d368e7f2b..fd58df2f7ff 100644 --- a/Tests/UnitTests/Plugins/GeoModel/GeoTubeToVolumeTest.cpp +++ b/Tests/UnitTests/Plugins/GeoModel/GeoTubeToVolumeTest.cpp @@ -56,7 +56,7 @@ BOOST_AUTO_TEST_CASE(GeoBoxToSensitiveConversion) { const auto* bounds = dynamic_cast( &volumeTube->volumeBounds()); std::vector convDims = bounds->values(); - for (long unsigned int i = 0; i < dims.size(); i++) { + for (std::size_t i = 0; i < dims.size(); i++) { BOOST_CHECK(dims[i] == convDims[i]); } }