Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MaterialMapUtils.hpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file MaterialMapUtils.hpp
1 // This file is part of the Acts project.
2 //
3 // Copyright (C) 2019 CERN for the benefit of the Acts project
4 //
5 // This Source Code Form is subject to the terms of the Mozilla Public
6 // License, v. 2.0. If a copy of the MPL was not distributed with this
7 // file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 
9 #pragma once
10 
17 
18 #include <array>
19 #include <cstddef>
20 #include <functional>
21 #include <vector>
22 
23 // Convenience functions to ease creation of and Acts::InterpolatedMaterialMap
24 // and to avoid code duplication. Currently implemented for the two most common
25 // formats: rz and xyz.
26 
27 namespace Acts {
28 
29 class Material;
30 
62 MaterialMapper<detail::Grid<Material::ParametersVector, detail::EquidistantAxis,
64 materialMapperRZ(const std::function<size_t(std::array<size_t, 2> binsRZ,
65  std::array<size_t, 2> nBinsRZ)>&
66  materialVectorToGridMapper,
67  std::vector<double> rPos, std::vector<double> zPos,
68  const std::vector<Acts::Material>& material,
69  double lengthUnit = UnitConstants::mm);
70 
112 MaterialMapper<detail::Grid<Material::ParametersVector, detail::EquidistantAxis,
114 materialMapperXYZ(const std::function<size_t(std::array<size_t, 3> binsXYZ,
115  std::array<size_t, 3> nBinsXYZ)>&
116  materialVectorToGridMapper,
117  std::vector<double> xPos, std::vector<double> yPos,
118  std::vector<double> zPos,
119  const std::vector<Material>& material,
120  double lengthUnit = UnitConstants::mm);
121 
122 } // namespace Acts