Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:11:00

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