Skip to content

Commit

Permalink
refactor: replace long unsigned int with std::size_t (#3930)
Browse files Browse the repository at this point in the history
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

- **New Features**
	- Enhanced error handling for input space points in the GbtsSeedingAlgorithm.
	- Improved seed finding logic based on internal ROI descriptors.

- **Bug Fixes**
	- Updated handling of mapping logic to ensure clarity and prevent missing keys.

- **Refactor**
	- Changed variable types from `long unsigned int` to `std::size_t` across multiple components for improved type safety.

- **Tests**
	- Updated loop index types in various test cases to enhance type safety and align with best practices.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
  • Loading branch information
AJPfleger authored Dec 2, 2024
1 parent bf997eb commit 4a506f8
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ class RootAthenaDumpReader : public IReader {
/// Vector of {eventNr, entryMin, entryMax}
std::vector<std::tuple<std::uint32_t, std::size_t, std::size_t>> m_eventMap;
std::shared_ptr<TChain> m_inputchain;
long unsigned int m_events;
std::size_t m_events;
bool m_haveStripFeatures = true;

static constexpr unsigned int maxCL = 1500000;
Expand Down
2 changes: 1 addition & 1 deletion Tests/UnitTests/Plugins/GeoModel/GeoBoxToVolumeTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ BOOST_AUTO_TEST_CASE(GeoBoxToSensitiveConversion) {
const auto* bounds =
dynamic_cast<const Acts::CuboidVolumeBounds*>(&volumeBox->volumeBounds());
std::vector<double> 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]);
}
}
Expand Down
4 changes: 2 additions & 2 deletions Tests/UnitTests/Plugins/GeoModel/GeoDetectorObjectTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<const Acts::Surface*> surfaces = box->surfaces();
Expand Down Expand Up @@ -75,7 +75,7 @@ void test(const Acts::GeoModelDetectorObjectFactory::Cache& cache,
dynamic_cast<const Acts::TrapezoidBounds*>(&sbounds);
std::vector<Acts::Vector2> 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]);
}
Expand Down
4 changes: 2 additions & 2 deletions Tests/UnitTests/Plugins/GeoModel/GeoPolyConverterTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,15 @@ BOOST_AUTO_TEST_CASE(GeoModelDetectorObjectFactory) {
const auto* polyBounds =
dynamic_cast<const Acts::DiamondBounds*>(&polySurface->bounds());
std::vector<Acts::Vector2> 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]);
}

const auto* trapBounds =
dynamic_cast<const Acts::TrapezoidBounds*>(&trapSurface->bounds());
std::vector<Acts::Vector2> 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]);
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/UnitTests/Plugins/GeoModel/GeoTubeToVolumeTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ BOOST_AUTO_TEST_CASE(GeoBoxToSensitiveConversion) {
const auto* bounds = dynamic_cast<const Acts::CylinderVolumeBounds*>(
&volumeTube->volumeBounds());
std::vector<double> 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]);
}
}
Expand Down

0 comments on commit 4a506f8

Please sign in to comment.