Skip to content

Commit

Permalink
shuffle namespace stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
ssdetlab committed Oct 20, 2024
1 parent 48cc771 commit 7619345
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 24 deletions.
13 changes: 3 additions & 10 deletions Core/include/Acts/Seeding/PathSeeder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,7 @@
#include "Acts/Utilities/Delegate.hpp"
#include "Acts/Utilities/GridIterator.hpp"

namespace {

template <typename grid_t>
concept SourceLinkGrid =
std::same_as<typename grid_t::value_type, std::vector<Acts::SourceLink>>;
}

namespace Acts::Experimental {
namespace Acts {

/// @brief Seeding algorigthm that extracts
/// the IP parameters and sorts the source links
Expand Down Expand Up @@ -117,7 +110,7 @@ class PathSeeder {
/// @param seedCollection The collection of seeds to fill
///
/// @return The vector of seeds
template <SourceLinkGrid grid_t, typename container_t>
template <Acts::detail::SourceLinkGrid grid_t, typename container_t>
void findSeeds(const GeometryContext& gctx,
const std::unordered_map<GeometryIdentifier, grid_t>&
sourceLinkGridLookup,
Expand Down Expand Up @@ -195,4 +188,4 @@ class PathSeeder {
Config m_cfg;
};

} // namespace Acts::Experimental
} // namespace Acts
29 changes: 18 additions & 11 deletions Core/include/Acts/Seeding/detail/UtilityFunctions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

#pragma once

#include "Acts/EventData/SourceLink.hpp"

#include <ranges>

namespace Acts::detail {
Expand All @@ -16,18 +18,22 @@ namespace Acts::detail {
template <typename external_t>
concept isCollectionThatSupportsPushBack =
std::ranges::range<external_t> && requires {
typename external_t::value_type;
} && requires(external_t coll, typename external_t::value_type val) {
coll.push_back(val);
};
typename external_t::value_type;
} && requires(external_t coll, typename external_t::value_type val) {
coll.push_back(val);
};

template <typename external_t>
concept isCollectionThatSupportsInsert =
std::ranges::range<external_t> && requires {
typename external_t::value_type;
} && requires(external_t coll, typename external_t::value_type val) {
coll.insert(std::ranges::end(coll), val);
};
typename external_t::value_type;
} && requires(external_t coll, typename external_t::value_type val) {
coll.insert(std::ranges::end(coll), val);
};

template <typename grid_t>
concept SourceLinkGrid =
std::same_as<typename grid_t::value_type, std::vector<Acts::SourceLink>>;

// Define some functions
template <typename value_t>
Expand All @@ -38,9 +44,10 @@ void pushBackOrInsertAtEnd(
}

template <std::ranges::range storage_t, typename value_t>
requires(!Acts::detail::isCollectionThatSupportsPushBack<storage_t> &&
Acts::detail::isCollectionThatSupportsInsert<storage_t>)
void pushBackOrInsertAtEnd(storage_t& storage, value_t&& value) {
requires(!Acts::detail::isCollectionThatSupportsPushBack<storage_t> &&
Acts::detail::isCollectionThatSupportsInsert<
storage_t>) void pushBackOrInsertAtEnd(storage_t& storage,
value_t&& value) {
storage.insert(std::ranges::end(storage), std::forward<value_t>(value));
}

Expand Down
6 changes: 3 additions & 3 deletions Tests/UnitTests/Core/Seeding/PathSeederTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ BOOST_AUTO_TEST_CASE(PathSeederZeroField) {
auto sourceLinks = createSourceLinks(gctx, *detector);

// Prepare the PathSeeder
auto pathSeederCfg = Acts::Experimental::PathSeeder::Config();
auto pathSeederCfg = Acts::PathSeeder::Config();

// Grid to bin the source links
SurfaceAccessor surfaceAccessor{*detector};
Expand Down Expand Up @@ -384,12 +384,12 @@ BOOST_AUTO_TEST_CASE(PathSeederZeroField) {
pathSeederCfg.refLayerIds.push_back(geoId);

// Create the PathSeeder
Acts::Experimental::PathSeeder pathSeeder(pathSeederCfg);
Acts::PathSeeder pathSeeder(pathSeederCfg);

// Get the seeds
pathWidthProvider.width = {1e-3, 1e-3};

std::vector<Acts::Experimental::PathSeeder::PathSeed> seeds;
std::vector<Acts::PathSeeder::PathSeed> seeds;

// SeedTreeContainer seeds;
pathSeeder.findSeeds(gctx, sourceLinkGrid, seeds);
Expand Down

0 comments on commit 7619345

Please sign in to comment.