Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-07-15 08:11:59

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/Seeding/BinnedGroupIterator.hpp"
0012 #include "Acts/Utilities/GridBinFinder.hpp"
0013 
0014 #include <vector>
0015 
0016 namespace Acts {
0017 
0018 /// @class BinnedGroup
0019 /// @tparam grid_t Type of the grid the group owns
0020 ///
0021 /// The assumption is that the grid has ownership of the space points and
0022 /// that the grid value_type (i.e. T in Grid<T, Axes ...>) is an iterable
0023 /// object of space points, such as a vector< ... >
0024 template <typename grid_t>
0025 class BinnedGroup {
0026  public:
0027   friend BinnedGroupIterator<grid_t>;
0028 
0029   static constexpr std::size_t DIM = grid_t::DIM;
0030 
0031   /// @brief Default constructor
0032   BinnedGroup() = delete;
0033 
0034   /// brief Constructor
0035   BinnedGroup(grid_t&& grid, const GridBinFinder<DIM>& bottomFinder,
0036               const GridBinFinder<DIM>& topFinder,
0037               std::array<std::vector<std::size_t>, DIM> navigation =
0038                   std::array<std::vector<std::size_t>, DIM>());
0039 
0040   BinnedGroup(grid_t&& grid, std::vector<bool> mask,
0041               const GridBinFinder<DIM>& bottomFinder,
0042               const GridBinFinder<DIM>& topFinder,
0043               std::array<std::vector<std::size_t>, DIM> navigation =
0044                   std::array<std::vector<std::size_t>, DIM>());
0045 
0046   BinnedGroup(grid_t& grid, const GridBinFinder<DIM>& bottomFinder,
0047               const GridBinFinder<DIM>& topFinder,
0048               std::array<std::vector<std::size_t>, DIM> navigation =
0049                   std::array<std::vector<std::size_t>, DIM>()) = delete;
0050 
0051   /// @brief Copy constructor
0052   /// @param [in] other The BinnedGroup to copy
0053   BinnedGroup(const BinnedGroup<grid_t>& other) = delete;
0054   /// @brief Copy assignment
0055   /// @param [in] other The BinnedGroup to copy
0056   /// @return The copied BinnedGroup
0057   BinnedGroup<grid_t>& operator=(const BinnedGroup<grid_t>& other) = delete;
0058 
0059   /// @brief Move Constructor
0060   /// @param [in] other The BinnedGroup to move
0061   BinnedGroup(BinnedGroup<grid_t>&& other) noexcept = default;
0062   /// @brief Move Assignment
0063   /// @param [in] other The BinnedGroup to move
0064   /// @return The moved BinnedGroup
0065   BinnedGroup<grid_t>& operator=(BinnedGroup<grid_t>&& other) noexcept =
0066       default;
0067 
0068   /// @brief Default destructor
0069   ~BinnedGroup() = default;
0070 
0071   /// @brief Retrieve const reference to the Grid
0072   /// @return Const reference to the stored grid
0073   const grid_t& grid() const;
0074   /// @brief Retrieve mutable reference to the Grid
0075   /// @return Mutable reference to the stored grid
0076   grid_t& grid();
0077 
0078   /// @brief Retrieve the mask
0079   /// Only const accessor is supported
0080   /// @return The mask
0081   const std::vector<bool>& mask() const;
0082 
0083   /// @brief Get the begin iterator
0084   /// @return The iterator
0085   BinnedGroupIterator<grid_t> begin() const;
0086   /// @brief Get the end iterator
0087   /// @return The iterator
0088   BinnedGroupIterator<grid_t> end() const;
0089 
0090  private:
0091   /// @brief The N-dimentional grid
0092   grid_t m_grid;
0093   /// @brief The mask to be applied to the grid. The size of this vector
0094   /// corresponds to the global bins in the grid
0095   std::vector<bool> m_mask{};
0096   /// @brief The Grid Bin Finder for bottom candidates
0097   const GridBinFinder<DIM>* m_bottomBinFinder{nullptr};
0098   /// @brief The Grid Bin Finder for top candidates
0099   const GridBinFinder<DIM>* m_topBinFinder{nullptr};
0100   /// @brief Order of bins to loop over when searching for SPs
0101   std::array<std::vector<std::size_t>, DIM> m_bins{};
0102 };
0103 
0104 }  // namespace Acts
0105 
0106 #include "Acts/Seeding/BinnedGroup.ipp"