Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:10:44

0001 // This file is part of the ACTS project.
0002 //
0003 // Copyright (C) 2016 CERN for the benefit of the ACTS project
0004 //
0005 // This Source Code Form is subject to the terms of the Mozilla Public
0006 // License, v. 2.0. If a copy of the MPL was not distributed with this
0007 // file, You can obtain one at https://mozilla.org/MPL/2.0/.
0008 
0009 #pragma once
0010 
0011 #include "Acts/EventData/TrackContainer.hpp"
0012 #include "Acts/EventData/TrackContainerFrontendConcept.hpp"
0013 #include "Acts/EventData/VectorMultiTrajectory.hpp"
0014 #include "Acts/EventData/VectorTrackContainer.hpp"
0015 #include "Acts/Utilities/Concepts.hpp"
0016 
0017 namespace Acts {
0018 
0019 /// @brief Concept for the ambiguity network used in the ambiguity resolution
0020 ///
0021 /// The ambiguity network correspond to the AmbiguityTrackClassifier found in
0022 /// the Onnx plugin. It is used to score the tracks and select the best ones.
0023 ///
0024 /// The constructor of the Ambiguity Solver network should take string as input
0025 /// corresponding to the path of the ONNX model.
0026 /// The implementation of the Ambiguity Solver network should have two methods:
0027 /// - inferScores: takes clusters (a list of track ID associated with a cluster
0028 /// ID) and the track container and return an outputTensor (list of scores for
0029 ///                each track in the clusters).
0030 /// - trackSelection: Takes clusters and the output tensor from the inferScores
0031 ///                   method and return the list of track ID to keep.
0032 ///
0033 /// @tparam N the type of the network
0034 template <typename network_t>
0035 concept AmbiguityNetworkConcept = requires(
0036     TrackContainer<VectorTrackContainer, VectorMultiTrajectory,
0037                    detail::ValueHolder> &tracks,
0038     std::unordered_map<std::size_t, std::vector<std::size_t>> &clusters,
0039     std::vector<std::vector<float>> &outputTensor, const char *modelPath,
0040     network_t &n) {
0041   { network_t(modelPath) } -> std::same_as<network_t>;
0042 
0043   {
0044     n.inferScores(clusters, tracks)
0045   } -> std::same_as<std::vector<std::vector<float>>>;
0046   {
0047     n.trackSelection(clusters, outputTensor)
0048   } -> std::same_as<std::vector<std::size_t>>;
0049 };
0050 
0051 }  // namespace Acts