|
| 1 | +/** TRACCC library, part of the ACTS project (R&D line) |
| 2 | + * |
| 3 | + * (c) 2025 CERN for the benefit of the ACTS project |
| 4 | + * |
| 5 | + * Mozilla Public License Version 2.0 |
| 6 | + */ |
| 7 | + |
| 8 | +#pragma once |
| 9 | + |
| 10 | +// Local include(s). |
| 11 | +#include "traccc/alpaka/utils/queue.hpp" |
| 12 | + |
| 13 | +// Project include(s). |
| 14 | +#include "traccc/edm/measurement.hpp" |
| 15 | +#include "traccc/edm/track_candidate_collection.hpp" |
| 16 | +#include "traccc/edm/track_parameters.hpp" |
| 17 | +#include "traccc/finding/finding_config.hpp" |
| 18 | +#include "traccc/geometry/detector.hpp" |
| 19 | +#include "traccc/utils/algorithm.hpp" |
| 20 | +#include "traccc/utils/bfield.hpp" |
| 21 | +#include "traccc/utils/detector_type_utils.hpp" |
| 22 | +#include "traccc/utils/memory_resource.hpp" |
| 23 | +#include "traccc/utils/messaging.hpp" |
| 24 | + |
| 25 | +// VecMem include(s). |
| 26 | +#include <vecmem/utils/copy.hpp> |
| 27 | + |
| 28 | +// System include(s). |
| 29 | +#include <functional> |
| 30 | + |
| 31 | +namespace traccc::alpaka { |
| 32 | + |
| 33 | +/// CKF track finding algorithm |
| 34 | +class combinatorial_kalman_filter_algorithm |
| 35 | + : public algorithm<edm::track_candidate_collection<default_algebra>::buffer( |
| 36 | + const default_detector::view&, |
| 37 | + const covfie::field<traccc::const_bfield_backend_t< |
| 38 | + default_detector::device::scalar_type>>::view_t&, |
| 39 | + const measurement_collection_types::const_view&, |
| 40 | + const bound_track_parameters_collection_types::const_view&)>, |
| 41 | + public algorithm<edm::track_candidate_collection<default_algebra>::buffer( |
| 42 | + const telescope_detector::view&, |
| 43 | + const covfie::field<traccc::const_bfield_backend_t< |
| 44 | + default_detector::device::scalar_type>>::view_t&, |
| 45 | + const measurement_collection_types::const_view&, |
| 46 | + const bound_track_parameters_collection_types::const_view&)>, |
| 47 | + public messaging { |
| 48 | + |
| 49 | + public: |
| 50 | + /// Configuration type |
| 51 | + using config_type = finding_config; |
| 52 | + /// Output type |
| 53 | + using output_type = |
| 54 | + edm::track_candidate_collection<default_algebra>::buffer; |
| 55 | + |
| 56 | + /// Constructor with the algorithm's configuration |
| 57 | + explicit combinatorial_kalman_filter_algorithm( |
| 58 | + const config_type& config, const traccc::memory_resource& mr, |
| 59 | + vecmem::copy& copy, queue& q, |
| 60 | + std::unique_ptr<const Logger> logger = getDummyLogger().clone()); |
| 61 | + |
| 62 | + /// Execute the algorithm |
| 63 | + /// |
| 64 | + /// @param det The (default) detector object |
| 65 | + /// @param field The (constant) magnetic field object |
| 66 | + /// @param measurements All measurements in an event |
| 67 | + /// @param seeds All seeds in an event to start the track finding |
| 68 | + /// with |
| 69 | + /// |
| 70 | + /// @return A container of the found track candidates |
| 71 | + /// |
| 72 | + output_type operator()( |
| 73 | + const default_detector::view& det, |
| 74 | + const covfie::field<const_bfield_backend_t< |
| 75 | + telescope_detector::device::scalar_type>>::view_t& field, |
| 76 | + const measurement_collection_types::const_view& measurements, |
| 77 | + const bound_track_parameters_collection_types::const_view& seeds) |
| 78 | + const override; |
| 79 | + |
| 80 | + /// Execute the algorithm |
| 81 | + /// |
| 82 | + /// @param det The (telescope) detector object |
| 83 | + /// @param field The (constant) magnetic field object |
| 84 | + /// @param measurements All measurements in an event |
| 85 | + /// @param seeds All seeds in an event to start the track finding |
| 86 | + /// with |
| 87 | + /// |
| 88 | + /// @return A container of the found track candidates |
| 89 | + /// |
| 90 | + output_type operator()( |
| 91 | + const telescope_detector::view& det, |
| 92 | + const covfie::field<const_bfield_backend_t< |
| 93 | + telescope_detector::device::scalar_type>>::view_t& field, |
| 94 | + const measurement_collection_types::const_view& measurements, |
| 95 | + const bound_track_parameters_collection_types::const_view& seeds) |
| 96 | + const override; |
| 97 | + |
| 98 | + private: |
| 99 | + /// Algorithm configuration |
| 100 | + config_type m_config; |
| 101 | + /// Memory resource used by the algorithm |
| 102 | + traccc::memory_resource m_mr; |
| 103 | + /// Copy object used by the algorithm |
| 104 | + std::reference_wrapper<vecmem::copy> m_copy; |
| 105 | + /// Alpaka queue |
| 106 | + std::reference_wrapper<queue> m_queue; |
| 107 | + |
| 108 | +}; // class combinatorial_kalman_filter_algorithm |
| 109 | + |
| 110 | +} // namespace traccc::alpaka |
0 commit comments