Skip to content

Commit

Permalink
feat: throw runtime_error in seed finder if deltaR values were not in…
Browse files Browse the repository at this point in the history
…itialised (#1782)

PR #1378 has changed the default values of `deltaRMinTopSP`, `deltaRMaxTopSP`, `deltaRMinBottomSP` and `deltaRMaxBottomSP` to NAN.

As suggested by @osbornjd, we need to check that these variables have been correctly initialised in the seeder itself and not just in the SeedingAlgorithm, since the experiments will have their own seeding algorithms implemented within their own frameworks. This PR adds checks and exceptions to seedFinder if those values were NAN.
  • Loading branch information
LuisFelipeCoelho authored Jan 16, 2023
1 parent de3d999 commit 75886d6
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Core/include/Acts/Seeding/SeedFinder.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,18 @@ SeedFinder<external_spacepoint_t, platform_t>::SeedFinder(
throw std::runtime_error(
"SeedFinderConfig not in ACTS internal units in SeedFinder");
}
if (std::isnan(config.deltaRMaxTopSP)) {
throw std::runtime_error("Value of deltaRMaxTopSP was not initialised");
}
if (std::isnan(config.deltaRMinTopSP)) {
throw std::runtime_error("Value of deltaRMinTopSP was not initialised");
}
if (std::isnan(config.deltaRMaxBottomSP)) {
throw std::runtime_error("Value of deltaRMaxBottomSP was not initialised");
}
if (std::isnan(config.deltaRMinBottomSP)) {
throw std::runtime_error("Value of deltaRMinBottomSP was not initialised");
}
}

template <typename external_spacepoint_t, typename platform_t>
Expand Down
12 changes: 12 additions & 0 deletions Plugins/Cuda/include/Acts/Plugins/Cuda/Seeding/SeedFinder.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,18 @@ SeedFinder<external_spacepoint_t, Acts::Cuda>::SeedFinder(
throw std::runtime_error(
"SeedFinderOptions not in ACTS internal units in "
"Cuda/Seeding/SeedFinder");
if (std::isnan(m_config.deltaRMaxTopSP)) {
throw std::runtime_error("Value of deltaRMaxTopSP was not initialised");
}
if (std::isnan(m_config.deltaRMinTopSP)) {
throw std::runtime_error("Value of deltaRMinTopSP was not initialised");
}
if (std::isnan(m_config.deltaRMaxBottomSP)) {
throw std::runtime_error("Value of deltaRMaxBottomSP was not initialised");
}
if (std::isnan(m_config.deltaRMinBottomSP)) {
throw std::runtime_error("Value of deltaRMinBottomSP was not initialised");
}
}

// CUDA seed finding
Expand Down
12 changes: 12 additions & 0 deletions Plugins/Cuda/include/Acts/Plugins/Cuda/Seeding2/SeedFinder.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,18 @@ SeedFinder<external_spacepoint_t>::SeedFinder(
throw std::runtime_error(
"SeedFilterConfig not in ACTS internal units in "
"Cuda/Seeding2/SeedFinder");
if (std::isnan(m_commonConfig.deltaRMaxTopSP)) {
throw std::runtime_error("Value of deltaRMaxTopSP was not initialised");
}
if (std::isnan(m_commonConfig.deltaRMinTopSP)) {
throw std::runtime_error("Value of deltaRMinTopSP was not initialised");
}
if (std::isnan(m_commonConfig.deltaRMaxBottomSP)) {
throw std::runtime_error("Value of deltaRMaxBottomSP was not initialised");
}
if (std::isnan(m_commonConfig.deltaRMinBottomSP)) {
throw std::runtime_error("Value of deltaRMinBottomSP was not initialised");
}

// Tell the user what CUDA device will be used by the object.
if (static_cast<std::size_t>(m_device) < Info::instance().devices().size()) {
Expand Down

0 comments on commit 75886d6

Please sign in to comment.