Skip to content

Commit

Permalink
adressing comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Corentin-Allaire committed Nov 21, 2024
1 parent 4135c0e commit fa8d97b
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 20 deletions.
34 changes: 18 additions & 16 deletions Core/include/Acts/AmbiguityResolution/AmbiguityNetworkConcept.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,21 +36,23 @@ using DummyTrackContainer =
///
/// @tparam N the type of the network
template <typename network_t>
concept AmbiguityNetworkConcept = requires(
DummyTrackContainer &tracks,
std::unordered_map<std::size_t, std::vector<std::size_t>> &clusters,
std::vector<std::vector<float>> &outputTensor, const char *modelPath,
network_t &n) {
requires TrackContainerFrontend<DummyTrackContainer>;

{ network_t(modelPath) } -> std::same_as<network_t>;

{
n.inferScores(clusters, tracks)
} -> std::same_as<std::vector<std::vector<float>>>;
{
n.trackSelection(clusters, outputTensor)
} -> std::same_as<std::vector<std::size_t>>;
};
concept AmbiguityNetworkConcept =
TrackContainerFrontend<DummyTrackContainer> &&
requires(
DummyTrackContainer &tracks,
std::unordered_map<std::size_t, std::vector<std::size_t>> &clusters,
std::vector<std::vector<float>> &outputTensor, const char *modelPath,
network_t &n) {
requires TrackContainerFrontend<DummyTrackContainer>;

{ network_t(modelPath) } -> std::same_as<network_t>;

{
n.inferScores(clusters, tracks)
} -> std::same_as<std::vector<std::vector<float>>>;
{
n.trackSelection(clusters, outputTensor)
} -> std::same_as<std::vector<std::size_t>>;
};

} // namespace Acts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ class AmbiguityResolutionML {
typename source_link_hash_t, typename source_link_equality_t>
std::multimap<int, std::pair<std::size_t, std::vector<std::size_t>>>
mapTrackHits(const track_container_t& tracks,
source_link_hash_t&& sourceLinkHash,
source_link_equality_t&& sourceLinkEquality) const {
const source_link_hash_t& sourceLinkHash,
const source_link_equality_t& sourceLinkEquality) const {
// A map to store (and generate) the measurement index for each source link
auto measurementIndexMap =
std::unordered_map<SourceLink, std::size_t, source_link_hash_t,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@
#include <iterator>
#include <map>

std::size_t sourceLinkHash(const Acts::SourceLink& a) {
static std::size_t sourceLinkHash(const Acts::SourceLink& a) {
return static_cast<std::size_t>(
a.get<ActsExamples::IndexSourceLink>().index());
}

bool sourceLinkEquality(const Acts::SourceLink& a, const Acts::SourceLink& b) {
static bool sourceLinkEquality(const Acts::SourceLink& a,
const Acts::SourceLink& b) {
return a.get<ActsExamples::IndexSourceLink>().index() ==
b.get<ActsExamples::IndexSourceLink>().index();
}
Expand Down

0 comments on commit fa8d97b

Please sign in to comment.