From ababa392397e64afeaf2e8b577341ffa2c570621 Mon Sep 17 00:00:00 2001 From: Paul Gessinger Date: Thu, 2 Nov 2023 15:47:48 +0100 Subject: [PATCH 1/4] refactor: Use `std::size_t` consistently --- .../GreedyAmbiguityResolution.hpp | 2 +- .../Acts/Clusterization/Clusterization.hpp | 8 +- .../Acts/Clusterization/Clusterization.ipp | 44 ++-- .../Acts/Definitions/TrackParametrization.hpp | 8 +- Core/include/Acts/Detector/Detector.hpp | 2 +- Core/include/Acts/Detector/DetectorVolume.hpp | 12 +- .../Acts/Detector/KdtSurfacesProvider.hpp | 4 +- .../Detector/detail/ReferenceGenerators.hpp | 2 +- .../Acts/Detector/detail/SupportHelper.hpp | 2 +- .../Digitization/CartesianSegmentation.hpp | 2 +- .../Acts/Digitization/DigitizationCell.hpp | 6 +- Core/include/Acts/EventData/Measurement.hpp | 12 +- .../Acts/EventData/MeasurementHelpers.hpp | 6 +- .../Acts/EventData/MultiTrajectory.hpp | 38 ++-- .../Acts/EventData/MultiTrajectory.ipp | 12 +- .../MultiTrajectoryBackendConcept.hpp | 2 +- .../Acts/EventData/MultiTrajectoryHelpers.hpp | 16 +- .../include/Acts/EventData/TrackStateType.hpp | 2 +- .../Acts/EventData/VectorMultiTrajectory.hpp | 24 +- .../Acts/EventData/VectorTrackContainer.hpp | 2 +- .../EventData/detail/CalculateResiduals.hpp | 6 +- .../Acts/EventData/detail/DynamicColumn.hpp | 42 ++-- .../Acts/EventData/detail/ParameterTraits.hpp | 6 +- .../EventData/detail/covariance_helper.hpp | 2 +- .../Acts/Geometry/CuboidVolumeBuilder.hpp | 4 +- .../Geometry/GenericCuboidVolumeBounds.hpp | 2 +- .../KDTreeTrackingGeometryBuilder.hpp | 2 +- Core/include/Acts/Geometry/LayerCreator.hpp | 12 +- Core/include/Acts/Geometry/Polyhedron.hpp | 2 +- .../Acts/Geometry/SurfaceArrayCreator.hpp | 24 +- Core/include/Acts/Geometry/TrackingVolume.hpp | 2 +- .../Acts/MagneticField/BFieldMapUtils.hpp | 27 ++- .../MagneticField/InterpolatedBFieldMap.hpp | 14 +- .../Acts/MagneticField/SolenoidBField.hpp | 2 +- .../Material/AccumulatedSurfaceMaterial.hpp | 8 +- .../Acts/Material/BinnedSurfaceMaterial.hpp | 6 +- .../Material/HomogeneousSurfaceMaterial.hpp | 6 +- .../Acts/Material/ISurfaceMaterial.hpp | 2 +- .../Acts/Material/InterpolatedMaterialMap.hpp | 14 +- .../Acts/Material/MaterialGridHelper.hpp | 2 +- .../Acts/Material/MaterialMapUtils.hpp | 32 +-- .../Acts/Material/ProtoSurfaceMaterial.hpp | 4 +- .../Acts/Navigation/DetectorVolumeFinders.hpp | 2 +- Core/include/Acts/Propagator/AtlasStepper.hpp | 6 +- .../Acts/Propagator/ConstrainedStep.hpp | 2 +- Core/include/Acts/Propagator/EigenStepper.ipp | 2 +- Core/include/Acts/Seeding/BinFinder.hpp | 4 +- Core/include/Acts/Seeding/BinFinder.ipp | 4 +- Core/include/Acts/Seeding/BinnedSPGroup.hpp | 8 +- Core/include/Acts/Seeding/BinnedSPGroup.ipp | 16 +- .../Seeding/EstimateTrackParamsFromSeed.hpp | 6 +- Core/include/Acts/Seeding/GNN_DataStorage.hpp | 4 +- Core/include/Acts/Seeding/SeedFilter.hpp | 2 +- Core/include/Acts/Seeding/SeedFilter.ipp | 12 +- .../include/Acts/Seeding/SeedFilterConfig.hpp | 2 +- Core/include/Acts/Seeding/SeedFinder.ipp | 6 +- .../include/Acts/Seeding/SeedFinderConfig.hpp | 2 +- .../Acts/Seeding/SeedFinderOrthogonal.ipp | 10 +- Core/include/Acts/Surfaces/ConeSurface.hpp | 2 +- .../Acts/Surfaces/ConvexPolygonBounds.hpp | 4 +- .../Acts/Surfaces/ConvexPolygonBounds.ipp | 14 +- Core/include/Acts/Surfaces/CylinderBounds.hpp | 2 +- .../include/Acts/Surfaces/CylinderSurface.hpp | 2 +- Core/include/Acts/Surfaces/DiscSurface.hpp | 2 +- Core/include/Acts/Surfaces/PerigeeSurface.hpp | 2 +- Core/include/Acts/Surfaces/PlaneSurface.hpp | 2 +- Core/include/Acts/Surfaces/StrawSurface.hpp | 2 +- Core/include/Acts/Surfaces/Surface.hpp | 2 +- Core/include/Acts/Surfaces/SurfaceArray.hpp | 78 +++---- .../Acts/Surfaces/detail/FacesHelper.hpp | 16 +- .../CombinatorialKalmanFilter.hpp | 36 +-- .../Acts/TrackFinding/MeasurementSelector.hpp | 6 +- .../Acts/TrackFinding/RoiDescriptor.hpp | 2 +- .../SourceLinkAccessorConcept.hpp | 2 +- .../Acts/TrackFitting/GainMatrixSmoother.hpp | 2 +- .../TrackFitting/GlobalChiSquareFitter.hpp | 34 +-- .../Acts/TrackFitting/KalmanFitter.hpp | 18 +- .../detail/KalmanGlobalCovariance.hpp | 18 +- .../detail/KalmanUpdateHelpers.hpp | 8 +- .../detail/VoidFitterComponents.hpp | 2 +- .../include/Acts/Utilities/AlgebraHelpers.hpp | 8 +- Core/include/Acts/Utilities/Any.hpp | 12 +- Core/include/Acts/Utilities/BinUtility.hpp | 40 ++-- Core/include/Acts/Utilities/BinnedArray.hpp | 8 +- Core/include/Acts/Utilities/BinnedArrayXD.hpp | 14 +- Core/include/Acts/Utilities/BinningData.hpp | 48 ++-- Core/include/Acts/Utilities/BoundingBox.hpp | 18 +- Core/include/Acts/Utilities/BoundingBox.ipp | 88 ++++---- Core/include/Acts/Utilities/Frustum.hpp | 16 +- Core/include/Acts/Utilities/Frustum.ipp | 38 ++-- Core/include/Acts/Utilities/Grid.hpp | 32 +-- Core/include/Acts/Utilities/Helpers.hpp | 14 +- Core/include/Acts/Utilities/IAxis.hpp | 2 +- Core/include/Acts/Utilities/Interpolation.hpp | 2 +- Core/include/Acts/Utilities/Ray.hpp | 6 +- Core/include/Acts/Utilities/Ray.ipp | 16 +- Core/include/Acts/Utilities/detail/Axis.hpp | 88 ++++---- .../Acts/Utilities/detail/MPL/at_index.hpp | 4 +- .../Acts/Utilities/detail/Subspace.hpp | 20 +- .../Acts/Utilities/detail/grid_helper.hpp | 208 +++++++++--------- .../Utilities/detail/interpolation_impl.hpp | 18 +- .../Acts/Visualization/EventDataView3D.hpp | 6 +- .../Acts/Visualization/IVisualization3D.hpp | 2 +- .../Acts/Visualization/ObjVisualization3D.hpp | 8 +- .../Acts/Visualization/PlyVisualization3D.hpp | 2 +- .../detail/ObjVisualization3D.ipp | 10 +- .../detail/PlyVisualization3D.ipp | 10 +- Core/src/Detector/DetectorVolume.cpp | 4 +- Core/src/Detector/LayerStructureBuilder.cpp | 6 +- Core/src/Detector/Portal.cpp | 2 +- .../detail/CylindricalDetectorHelper.cpp | 6 +- Core/src/Detector/detail/SupportHelper.cpp | 2 +- .../Digitization/CartesianSegmentation.cpp | 8 +- Core/src/Digitization/DigitizationModule.cpp | 8 +- Core/src/Digitization/PlanarModuleStepper.cpp | 2 +- .../CorrectedTransformationFreeToBound.cpp | 2 +- Core/src/EventData/VectorMultiTrajectory.cpp | 4 +- Core/src/Geometry/CuboidVolumeBuilder.cpp | 2 +- Core/src/Geometry/CylinderLayer.cpp | 2 +- Core/src/Geometry/CylinderVolumeHelper.cpp | 10 +- Core/src/Geometry/Extent.cpp | 4 +- .../Geometry/GenericCuboidVolumeBounds.cpp | 20 +- Core/src/Geometry/LayerCreator.cpp | 20 +- Core/src/Geometry/PassiveLayerBuilder.cpp | 8 +- Core/src/Geometry/Polyhedron.cpp | 8 +- Core/src/Geometry/SurfaceArrayCreator.cpp | 40 ++-- Core/src/Geometry/TrackingGeometry.cpp | 2 +- Core/src/Geometry/TrackingVolume.cpp | 2 +- Core/src/Geometry/TrapezoidVolumeBounds.cpp | 2 +- Core/src/MagneticField/BFieldMapUtils.cpp | 64 +++--- Core/src/MagneticField/SolenoidBField.cpp | 2 +- .../Material/AccumulatedSurfaceMaterial.cpp | 30 +-- Core/src/Material/BinnedSurfaceMaterial.cpp | 8 +- Core/src/Material/MaterialGridHelper.cpp | 24 +- Core/src/Material/MaterialMapUtils.cpp | 32 +-- Core/src/Material/SurfaceMaterialMapper.cpp | 14 +- Core/src/Material/VolumeMaterialMapper.cpp | 2 +- Core/src/Surfaces/ConeSurface.cpp | 8 +- Core/src/Surfaces/ConvexPolygonBounds.cpp | 2 +- Core/src/Surfaces/CylinderBounds.cpp | 4 +- Core/src/Surfaces/CylinderSurface.cpp | 2 +- Core/src/Surfaces/DiscSurface.cpp | 2 +- Core/src/Surfaces/PerigeeSurface.cpp | 2 +- Core/src/Surfaces/PlaneSurface.cpp | 2 +- Core/src/Surfaces/StrawSurface.cpp | 6 +- Core/src/Surfaces/SurfaceArray.cpp | 4 +- Core/src/Surfaces/VerticesHelper.cpp | 2 +- Core/src/TrackFinding/MeasurementSelector.cpp | 2 +- Core/src/TrackFitting/GainMatrixUpdater.cpp | 2 +- Core/src/TrackFitting/GsfUtils.cpp | 2 +- Core/src/Visualization/GeometryView3D.cpp | 4 +- .../Alignment/src/AlignmentAlgorithm.cpp | 2 +- .../GreedyAmbiguityResolutionAlgorithm.cpp | 4 +- .../src/DigitizationAlgorithm.cpp | 2 +- .../src/PlanarSteppingAlgorithm.cpp | 2 +- .../ActsExamples/Geant4/EventStore.hpp | 18 +- .../src/TelescopeG4DetectorConstruction.cpp | 2 +- .../Geometry/VolumeAssociationTest.hpp | 2 +- .../Geometry/src/VolumeAssociationTest.cpp | 6 +- .../Printers/TrackParametersPrinter.cpp | 2 +- .../TrackFinding/TrackFindingAlgorithm.hpp | 12 +- .../TrackFinding/src/SeedingAlgorithm.cpp | 4 +- .../src/TrackFindingAlgorithm.cpp | 2 +- .../src/TrackParamsEstimationAlgorithm.cpp | 2 +- .../TrackFindingAlgorithmExaTrkX.hpp | 2 +- .../src/PrototracksToParameters.cpp | 4 +- .../src/TrackFindingAlgorithmExaTrkX.cpp | 12 +- .../TrackFindingFromPrototrackAlgorithm.cpp | 6 +- .../TrackFitting/TrackFitterFunction.hpp | 2 +- .../TrackFitting/src/GsfFitterFunction.cpp | 4 +- .../src/SurfaceSortingAlgorithm.cpp | 2 +- .../src/TrackFittingAlgorithm.cpp | 2 +- .../TruthTracking/ParticleSelector.cpp | 12 +- .../TruthTracking/ParticleSelector.hpp | 4 +- .../TruthTracking/ParticleSmearing.cpp | 2 +- .../src/MockupSectorBuilder.cpp | 2 +- .../ActsExamples/Framework/Sequencer.hpp | 10 +- .../ActsExamples/Framework/WhiteBoard.hpp | 4 +- .../include/ActsExamples/Utilities/Range.hpp | 2 +- .../Framework/src/Framework/Sequencer.cpp | 6 +- .../Framework/src/Framework/WhiteBoard.cpp | 12 +- .../ActsExamples/Io/Csv/CsvBFieldWriter.hpp | 4 +- .../Io/Csv/CsvTrackingGeometryWriter.hpp | 2 +- Examples/Io/Csv/src/CsvBFieldWriter.cpp | 26 +-- Examples/Io/Csv/src/CsvMeasurementReader.cpp | 6 +- Examples/Io/Csv/src/CsvOutputData.hpp | 2 +- .../Io/Csv/src/CsvPlanarClusterReader.cpp | 2 +- .../ActsExamples/Io/EDM4hep/EDM4hepUtil.hpp | 2 +- Examples/Io/EDM4hep/src/EDM4hepUtil.cpp | 2 +- .../Io/Json/JsonSurfacesWriter.hpp | 2 +- .../Io/Performance/CKFPerformanceWriter.cpp | 2 +- .../Performance/SeedingPerformanceWriter.cpp | 2 +- .../TrackFinderPerformanceWriter.cpp | 4 +- .../Performance/VertexPerformanceWriter.cpp | 4 +- .../Io/Root/RootAthenaNTupleReader.hpp | 4 +- .../ActsExamples/Io/Root/RootSimHitReader.hpp | 2 +- .../Io/Root/src/RootMaterialTrackWriter.cpp | 2 +- Examples/Io/Root/src/RootSimHitReader.cpp | 2 +- Examples/Python/src/Framework.cpp | 2 +- Examples/Python/src/Geometry.cpp | 6 +- Examples/Python/src/TrackFitting.cpp | 2 +- Examples/Scripts/compareRootFiles.C | 18 +- Examples/Scripts/compareRootFiles.hpp | 36 +-- .../ActsFatras/Kernel/InteractionList.hpp | 8 +- .../include/ActsFatras/Kernel/Simulation.hpp | 2 +- .../Selectors/detail/combine_selectors.hpp | 2 +- .../ActSVG/IndexedSurfacesSvgConverter.hpp | 10 +- .../Acts/Plugins/Cuda/Seeding/SeedFinder.hpp | 2 +- .../Acts/Plugins/Cuda/Seeding/SeedFinder.ipp | 6 +- .../Cuda/Seeding2/Details/CountDublets.hpp | 2 +- .../Cuda/Seeding2/Details/FindDublets.hpp | 14 +- .../Cuda/Seeding2/Details/FindTriplets.hpp | 12 +- .../Acts/Plugins/Cuda/Seeding2/SeedFinder.hpp | 2 +- .../Acts/Plugins/Cuda/Seeding2/SeedFinder.ipp | 16 +- .../Acts/Plugins/Cuda/Utilities/Arrays.hpp | 12 +- .../Acts/Plugins/Cuda/Utilities/Info.hpp | 2 +- .../Plugins/Cuda/Utilities/MemoryManager.hpp | 8 +- Plugins/Cuda/src/Seeding2/CountDublets.cu | 4 +- Plugins/Cuda/src/Seeding2/FindDublets.cu | 20 +- Plugins/Cuda/src/Seeding2/FindTriplets.cu | 92 ++++---- Plugins/Cuda/src/Utilities/Arrays.cu | 24 +- Plugins/Cuda/src/Utilities/Info.cu | 8 +- Plugins/Cuda/src/Utilities/MemoryManager.cu | 20 +- .../DD4hep/DD4hepDetectorSurfaceFactory.hpp | 4 +- .../Plugins/ExaTrkX/OnnxMetricLearning.hpp | 2 +- .../include/Acts/Plugins/ExaTrkX/Stages.hpp | 2 +- .../Plugins/ExaTrkX/TorchMetricLearning.hpp | 2 +- .../ExaTrkX/detail/TensorVectorConversion.hpp | 2 +- Plugins/ExaTrkX/src/BoostTrackBuilding.cpp | 2 +- Plugins/ExaTrkX/src/OnnxMetricLearning.cpp | 2 +- Plugins/ExaTrkX/src/TorchMetricLearning.cpp | 2 +- Plugins/ExaTrkX/src/printCudaMemInfo.hpp | 2 +- .../Acts/Plugins/FpeMonitoring/FpeMonitor.hpp | 26 +-- Plugins/FpeMonitoring/src/FpeMonitor.cpp | 12 +- .../Geant4/Geant4DetectorSurfaceFactory.hpp | 6 +- Plugins/Geant4/src/Geant4Converters.cpp | 4 +- .../src/Geant4DetectorSurfaceFactory.cpp | 4 +- .../GeometryHierarchyMapJsonConverter.hpp | 2 +- .../Acts/Plugins/Json/GridJsonConverter.hpp | 10 +- .../Json/IndexedSurfacesJsonConverter.hpp | 4 +- .../Acts/Plugins/Json/PortalJsonConverter.hpp | 2 +- Plugins/Json/src/DetectorJsonConverter.cpp | 8 +- .../Json/src/IndexedSurfacesJsonConverter.cpp | 4 +- Plugins/Json/src/PortalJsonConverter.cpp | 6 +- .../Plugins/Podio/PodioTrackContainer.hpp | 6 +- .../Podio/PodioTrackStateContainer.hpp | 2 +- .../Acts/Plugins/Sycl/Seeding/SeedFinder.hpp | 2 +- .../Acts/Plugins/Sycl/Seeding/SeedFinder.ipp | 6 +- .../src/Seeding/CreateSeedsForGroupSycl.cpp | 4 +- Plugins/Sycl/src/Utilities/Arrays.hpp | 2 +- .../CommonHelpers/WhiteBoardUtilities.hpp | 14 +- .../Fatras/FatrasSimulationTests.cpp | 2 +- .../IndexedSurfaceGridFillerTests.cpp | 20 +- .../IndexedSurfacesGeneratorTests.cpp | 12 +- .../MultiWireStructureBuilderTests.cpp | 8 +- Tests/UnitTests/Core/EventData/TrackTests.cpp | 2 +- .../Navigation/DetectorVolumeFindersTests.cpp | 2 +- .../Navigation/MultiWireNavigationTests.cpp | 8 +- .../Core/Propagator/MultiStepperTests.cpp | 6 +- Tests/UnitTests/Core/Seeding/ATLASCuts.hpp | 4 +- .../TrackFitting/GsfComponentMergingTests.cpp | 2 +- .../TrackFitting/GsfMixtureReductionTests.cpp | 4 +- .../UnitTests/Core/Utilities/HelpersTests.cpp | 2 +- .../UnitTests/Core/Utilities/KDTreeTests.cpp | 4 +- .../Core/Utilities/MultiIndexTests.cpp | 4 +- .../Core/Utilities/SubspaceTests.cpp | 14 +- .../Io/Csv/MeasurementReaderWriterTests.cpp | 2 +- .../Io/Root/SimhitReaderWriterTests.cpp | 2 +- .../ActSVG/PortalSvgConverterTests.cpp | 4 +- .../Plugins/Cuda/Seeding/ATLASCuts.hpp | 4 +- .../Cuda/Seeding2/CommandLineArguments.hpp | 4 +- .../Plugins/Cuda/Seeding2/ReadSeedFile.cpp | 2 +- .../Plugins/Cuda/Seeding2/TestHostCuts.cpp | 4 +- .../UnitTests/Plugins/Cuda/Seeding2/main.cpp | 14 +- .../Plugins/Sycl/Seeding/ATLASCuts.hpp | 4 +- docs/core/seeding.md | 2 +- 276 files changed, 1368 insertions(+), 1353 deletions(-) diff --git a/Core/include/Acts/AmbiguityResolution/GreedyAmbiguityResolution.hpp b/Core/include/Acts/AmbiguityResolution/GreedyAmbiguityResolution.hpp index 76490d76eae..39f967b3494 100644 --- a/Core/include/Acts/AmbiguityResolution/GreedyAmbiguityResolution.hpp +++ b/Core/include/Acts/AmbiguityResolution/GreedyAmbiguityResolution.hpp @@ -43,7 +43,7 @@ class GreedyAmbiguityResolution { std::uint32_t maximumIterations = 1000; /// Minimum number of measurement to form a track. - size_t nMeasurementsMin = 7; + std::size_t nMeasurementsMin = 7; }; struct State { diff --git a/Core/include/Acts/Clusterization/Clusterization.hpp b/Core/include/Acts/Clusterization/Clusterization.hpp index 806b5c70e2e..e371393aafb 100644 --- a/Core/include/Acts/Clusterization/Clusterization.hpp +++ b/Core/include/Acts/Clusterization/Clusterization.hpp @@ -42,7 +42,7 @@ struct Connect1D { }; // Default connection type based on GridDim -template +template struct DefaultConnect { static_assert(GridDim != 1 && GridDim != 2, "Only grid dimensions of 1 or 2 are supported"); @@ -67,7 +67,7 @@ struct DefaultConnect : public Connect1D {}; /// /// @param [in] cells the cell collection to be labeled /// @param [in] connect the connection type (see DefaultConnect) -template > void labelClusters(CellCollection& cells, Connect connect = Connect()); @@ -80,13 +80,13 @@ void labelClusters(CellCollection& cells, Connect connect = Connect()); /// void clusterAddCell(Cluster&, const Cell&) /// /// @return nothing -template +template ClusterCollection mergeClusters(CellCollection& /*cells*/); /// @brief createClusters /// Convenience function which runs both labelClusters and createClusters. template > ClusterCollection createClusters(CellCollection& cells, diff --git a/Core/include/Acts/Clusterization/Clusterization.ipp b/Core/include/Acts/Clusterization/Clusterization.ipp index 13ccee6acb0..6be344dc372 100644 --- a/Core/include/Acts/Clusterization/Clusterization.ipp +++ b/Core/include/Acts/Clusterization/Clusterization.ipp @@ -15,7 +15,7 @@ namespace Acts::Ccl::internal { // Machinery for validating generic Cell/Cluster types at compile-time -template +template struct cellTypeHasRequiredFunctions : std::false_type {}; template @@ -42,14 +42,14 @@ struct clusterTypeHasRequiredFunctions< std::void_t(), std::declval()))>> : std::true_type {}; -template +template constexpr void staticCheckGridDim() { static_assert( GridDim == 1 || GridDim == 2, "mergeClusters is only defined for grid dimensions of 1 or 2. "); } -template +template constexpr void staticCheckCellType() { constexpr bool hasFns = cellTypeHasRequiredFunctions(); static_assert(hasFns, @@ -67,7 +67,7 @@ constexpr void staticCheckClusterType() { "'void clusterAddCell(Cluster&, const Cell&)'"); } -template +template struct Compare { static_assert(GridDim != 1 && GridDim != 2, "Only grid dimensions of 1 or 2 are supported"); @@ -101,7 +101,7 @@ struct Compare { // wrapping, but it's way slower class DisjointSets { public: - explicit DisjointSets(size_t initial_size = 128) + explicit DisjointSets(std::size_t initial_size = 128) : m_size(initial_size), m_rank(m_size), m_parent(m_size), @@ -114,31 +114,31 @@ class DisjointSets { m_size *= 2; m_rank.resize(m_size); m_parent.resize(m_size); - m_ds = boost::disjoint_sets(&m_rank[0], &m_parent[0]); + m_ds = boost::disjoint_sets(&m_rank[0], &m_parent[0]); } m_ds.make_set(m_globalId); return static_cast