Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-07-26 08:22:09

0001 /** TRACCC library, part of the ACTS project (R&D line)
0002  *
0003  * (c) 2022-2026 CERN for the benefit of the ACTS project
0004  *
0005  * Mozilla Public License Version 2.0
0006  */
0007 
0008 #pragma once
0009 
0010 // Library include(s).
0011 #include "traccc/cuda/utils/algorithm_base.hpp"
0012 #include "traccc/cuda/utils/stream_wrapper.hpp"
0013 
0014 // Project include(s).
0015 #include "traccc/fitting/device/kalman_fitting_algorithm.hpp"
0016 
0017 namespace traccc::cuda {
0018 
0019 /// Kalman filter based track fitting algorithm using CUDA
0020 class kalman_fitting_algorithm : public device::kalman_fitting_algorithm,
0021                                  public cuda::algorithm_base {
0022  public:
0023   /// Constructor with the algorithm's configuration
0024   ///
0025   /// @param config The configuration object
0026   /// @param mr     The memory resource(s) used by the algorithm
0027   /// @param copy   The copy object used by the algorithm
0028   /// @param str    The CUDA stream used by the algorithm
0029   /// @param logger The logger used by the algorithm
0030   ///
0031   kalman_fitting_algorithm(
0032       const config_type& config, const traccc::memory_resource& mr,
0033       const vecmem::copy& copy, const stream_wrapper& str,
0034       std::unique_ptr<const Logger> logger = getDummyLogger().clone());
0035 
0036  private:
0037   /// @name Function(s) implemented from @c device::kalman_fitting_algorithm
0038   /// @{
0039 
0040   /// Prepare a buffer with the index order with which to fit the tracks
0041   ///
0042   /// @param[in] tracks The tracks to be fitted
0043   /// @param[out] track_sort_keys Buffer storing temporary sorting keys
0044   /// @param[out] track_indices The buffer to write the fitting order into
0045   ///
0046   void prepare_track_fit_order(
0047       const edm::track_collection<default_algebra>::const_view& tracks,
0048       vecmem::data::vector_view<device::sort_key>& track_sort_keys,
0049       vecmem::data::vector_view<unsigned int>& track_indices) const override;
0050 
0051   /// Kernel to prepare the fitting payloads
0052   ///
0053   /// @param payload The payload for the kernel(s)
0054   ///
0055   void fit_prelude_kernel(
0056       const device::fit_prelude_payload& payload) const override;
0057 
0058   /// Function preparing the fitting payload
0059   ///
0060   /// @param det             The detector buffer to prepare the payload for
0061   /// @param field           The magnetic field to prepare the payload for
0062   /// @param n_surfaces      The number of surfaces for each track to be
0063   ///                        fitted
0064   /// @param payload         The (non-templated) payload for the kernel(s)
0065   ///
0066   /// @return The prepared payload for the fitting kernel(s)
0067   ///
0068   fit_payload prepare_fit_payload(
0069       const detector_buffer& det, const magnetic_field& field,
0070       const std::vector<unsigned int>& n_surfaces,
0071       const device::fit_payload& payload) const override;
0072 
0073   /// Function launching the "forward fitting" kernel(s)
0074   ///
0075   /// @param config The fitting configuration
0076   /// @param payload The payload for the fitting kernel(s)
0077   ///
0078   void fit_forward_kernel(const fitting_config& config,
0079                           const fit_payload& payload) const override;
0080 
0081   /// Function launching the "backward fitting" kernel(s)
0082   ///
0083   /// @param config The fitting configuration
0084   /// @param payload The payload for the fitting kernel(s)
0085   ///
0086   void fit_backward_kernel(const fitting_config& config,
0087                            const fit_payload& payload) const override;
0088 
0089   /// @}
0090 
0091 };  // class kalman_fitting_algorithm
0092 
0093 }  // namespace traccc::cuda