Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-19 09:23:24

0001 // This file is part of the Acts project.
0002 //
0003 // Copyright (C) 2020 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 http://mozilla.org/MPL/2.0/.
0008 
0009 #pragma once
0010 
0011 #include "Acts/Definitions/Algebra.hpp"
0012 #include "Acts/Material/AccumulatedVolumeMaterial.hpp"
0013 #include "Acts/Material/Material.hpp"
0014 #include "Acts/Utilities/BinUtility.hpp"
0015 #include "Acts/Utilities/BinningType.hpp"
0016 #include "Acts/Utilities/Grid.hpp"
0017 #include "Acts/Utilities/detail/Axis.hpp"
0018 #include "Acts/Utilities/detail/AxisFwd.hpp"
0019 
0020 #include <array>
0021 #include <cstddef>
0022 #include <functional>
0023 #include <tuple>
0024 #include <utility>
0025 #include <vector>
0026 
0027 namespace Acts {
0028 
0029 class MaterialSlab;
0030 
0031 using EAxis = Acts::detail::EquidistantAxis;
0032 using Grid2D = Acts::Grid<Acts::AccumulatedVolumeMaterial, EAxis, EAxis>;
0033 using Grid3D = Acts::Grid<Acts::AccumulatedVolumeMaterial, EAxis, EAxis, EAxis>;
0034 using MaterialGrid2D =
0035     Acts::Grid<Acts::Material::ParametersVector, EAxis, EAxis>;
0036 using MaterialGrid3D =
0037     Acts::Grid<Acts::Material::ParametersVector, EAxis, EAxis, EAxis>;
0038 
0039 using MaterialGridAxisData = std::tuple<double, double, std::size_t>;
0040 
0041 /// @brief Helper method that creates the cache grid for the mapping. This
0042 /// grid allows the collection of material at a the anchor points.
0043 ///
0044 /// @param [in] gridAxis1 Axis data
0045 /// @param [in] gridAxis2 Axis data
0046 /// @note The data of the axes is given in the std::array as {minimum value,
0047 /// maximum value, number of bins}
0048 ///
0049 /// @return The grid
0050 Grid2D createGrid(MaterialGridAxisData gridAxis1,
0051                   MaterialGridAxisData gridAxis2);
0052 
0053 /// @brief Helper method that creates the cache grid for the mapping. This
0054 /// grid allows the collection of material at a the anchor points.
0055 ///
0056 /// @param [in] gridAxis1 Axis data
0057 /// @param [in] gridAxis2 Axis data
0058 /// @param [in] gridAxis3 Axis data
0059 /// @note The data of the axes is given in the std::array as {minimum value,
0060 /// maximum value, number of bins}
0061 ///
0062 /// @return The grid
0063 Grid3D createGrid(MaterialGridAxisData gridAxis1,
0064                   MaterialGridAxisData gridAxis2,
0065                   MaterialGridAxisData gridAxis3);
0066 
0067 /// @brief return a function that return the coordinate corresponding to type of
0068 /// bin
0069 ///
0070 /// @param [in] type Type of bin
0071 ///
0072 /// @return a coordinate transform function
0073 std::function<double(Acts::Vector3)> globalToLocalFromBin(
0074     Acts::BinningValue& type);
0075 
0076 /// @brief Create a 2DGrid using a BinUtility.
0077 /// Also determine the corresponding global to local transform and grid mapping
0078 /// function
0079 ///
0080 /// @param [in] bins BinUtility of the volume to be mapped
0081 /// @param [in] transfoGlobalToLocal Global to local transform to be updated.
0082 ///
0083 /// @return the 3D grid
0084 Grid2D createGrid2D(
0085     const BinUtility& bins,
0086     std::function<Acts::Vector2(Acts::Vector3)>& transfoGlobalToLocal);
0087 
0088 /// @brief Create a 3DGrid using a BinUtility.
0089 /// Also determine the corresponding global to local transform and grid mapping
0090 /// function
0091 ///
0092 /// @param [in] bins BinUtility of the volume to be mapped
0093 /// @param [in] transfoGlobalToLocal Global to local transform to be updated.
0094 ///
0095 /// @return the 3D grid
0096 Grid3D createGrid3D(
0097     const BinUtility& bins,
0098     std::function<Acts::Vector3(Acts::Vector3)>& transfoGlobalToLocal);
0099 
0100 /// @brief Average the material collected in a 2D grid and use it to create a 2D material grid
0101 ///
0102 /// @param [in] grid The material collecting grid
0103 /// coordinate
0104 ///
0105 /// @return The average material grid decomposed into classification numbers
0106 MaterialGrid2D mapMaterialPoints(Grid2D& grid);
0107 
0108 /// @brief Average the material collected in a 3D grid and use it to create a 3D material grid
0109 ///
0110 /// @param [in] grid The material collecting grid
0111 /// coordinate
0112 ///
0113 /// @return The average material grid decomposed into classification numbers
0114 MaterialGrid3D mapMaterialPoints(Grid3D& grid);
0115 
0116 }  // namespace Acts