Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-10-16 08:03:43

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/Navigation/InternalNavigation.hpp"
0012 #include "Acts/Utilities/BinningData.hpp"
0013 #include "Acts/Utilities/IAxis.hpp"
0014 #include "Acts/Utilities/Logger.hpp"
0015 #include "Acts/Utilities/TypeList.hpp"
0016 
0017 #include <detray/io/frontend/payloads.hpp>
0018 
0019 namespace Acts {
0020 
0021 class Surface;
0022 class SurfaceBounds;
0023 class IAxis;
0024 
0025 namespace Experimental {
0026 class Detector;
0027 }
0028 }  // namespace Acts
0029 
0030 namespace ActsPlugins::DetraySurfaceGridsConverter {
0031 
0032 /// Conversion method for axis objects to detray::axis payloads
0033 ///
0034 /// @param ia the axis to be converted
0035 ///
0036 /// @return the axis_payload(bounds, binning, bins, edges)
0037 detray::io::axis_payload convertAxis(const Acts::IAxis& ia);
0038 
0039 /// Conversion method for grid objects to detray::grid payloads
0040 ///
0041 /// @param grid the grid to be converted
0042 /// @param swapAxis the flag for swapping the axes
0043 ///
0044 /// @return the grid_payload(axes, bins)
0045 template <typename grid_type>
0046 detray::io::grid_payload<std::size_t, detray::io::accel_id> convertGrid(
0047     const grid_type& grid, bool swapAxis = false);
0048 
0049 /// Conversion method for index grid objects to detray::grid payloads
0050 ///
0051 /// @param indexGrid the index grid to be converted
0052 ///
0053 /// @return the grid_payload(axes, bins)
0054 template <typename index_grid>
0055 detray::io::grid_payload<std::size_t, detray::io::accel_id> convertImpl(
0056     const index_grid& indexGrid);
0057 
0058 /// Conversion method for instance objects to detray::grid payloads
0059 ///
0060 /// @param delegate the internal navigation delegate
0061 /// @param refInstance the reference instance
0062 ///
0063 /// @return the grid_payload(axes, bins)
0064 template <typename instance_type>
0065 std::optional<detray::io::grid_payload<std::size_t, detray::io::accel_id>>
0066 convert(const Acts::Experimental::InternalNavigationDelegate& delegate,
0067         [[maybe_unused]] const instance_type& refInstance);
0068 
0069 /// Conversion method for instance objects to detray::grid payloads
0070 ///
0071 /// @param delegate the internal navigation delegate
0072 /// @param refInstance the reference instance
0073 ///
0074 /// @return the grid_payload(axes, bins)
0075 template <typename... Args>
0076 std::vector<detray::io::grid_payload<std::size_t, detray::io::accel_id>>
0077 unrollConvert(const Acts::Experimental::InternalNavigationDelegate& delegate,
0078               Acts::TypeList<Args...> /*unused*/);
0079 
0080 /// Conversion method for instance objects to detray::grid payloads
0081 ///
0082 /// @param delegate the internal navigation delegate
0083 /// @param refInstance the reference instance
0084 ///
0085 /// @return the grid_payload(axes, bins)
0086 detray::io::detector_grids_payload<std::size_t, detray::io::accel_id>
0087 convertSurfaceGrids(const Acts::Experimental::Detector& detector);
0088 
0089 }  // namespace ActsPlugins::DetraySurfaceGridsConverter