Skip to content

Commit

Permalink
refactor: simplify track selection logic in AlignmentAlgorithm (#3934)
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

- **Bug Fixes**
	- Improved logic for determining the number of tracks in the alignment process, enhancing clarity and efficiency.
- **Chores**
	- Maintained existing error handling for input collections, ensuring stability in case of empty collections.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
  • Loading branch information
AJPfleger authored Feb 3, 2025
1 parent 839c38d commit 2c23141
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Examples/Algorithms/Alignment/src/AlignmentAlgorithm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ ActsExamples::ProcessCode ActsExamples::AlignmentAlgorithm::execute(
}

std::size_t numTracksUsed = protoTracks.size();
if (m_cfg.maxNumTracks > 0 &&
m_cfg.maxNumTracks < static_cast<int>(protoTracks.size())) {
numTracksUsed = m_cfg.maxNumTracks;
if (m_cfg.maxNumTracks > 0) {
numTracksUsed =
std::min(static_cast<std::size_t>(m_cfg.maxNumTracks), numTracksUsed);
}

// Prepare the input track collection
Expand Down

0 comments on commit 2c23141

Please sign in to comment.