File indexing completed on 2026-10-08 08:27:17
0001
0002
0003
0004
0005
0006
0007
0008
0009 #pragma once
0010
0011 #include "Acts/Definitions/Algebra.hpp"
0012 #include "Acts/Material/ISurfaceMaterial.hpp"
0013 #include "Acts/Material/MaterialSlab.hpp"
0014 #include "Acts/Utilities/BinUtility.hpp"
0015 #include "Acts/Utilities/MultiAxisSpec.hpp"
0016
0017 #include <iosfwd>
0018 #include <optional>
0019 #include <stdexcept>
0020 #include <string>
0021 #include <vector>
0022
0023 namespace Acts {
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036 template <typename BinningType>
0037 class ProtoSurfaceMaterialT : public ISurfaceMaterial {
0038 public:
0039
0040 ProtoSurfaceMaterialT() = default;
0041
0042
0043
0044
0045
0046 explicit ProtoSurfaceMaterialT(
0047 const BinningType& binning,
0048 MappingType mappingType = MappingType::Default,
0049 std::optional<std::string> materialKey = std::nullopt)
0050 : ISurfaceMaterial(1., mappingType),
0051 m_binning(binning),
0052 m_materialKey(std::move(materialKey)) {
0053 if (m_materialKey && m_materialKey->empty()) {
0054 throw std::invalid_argument("Material key must not be empty");
0055 }
0056 }
0057
0058
0059
0060
0061 ProtoSurfaceMaterialT(const ProtoSurfaceMaterialT<BinningType>& smproxy) =
0062 default;
0063
0064
0065
0066
0067 ProtoSurfaceMaterialT(ProtoSurfaceMaterialT<BinningType>&& smproxy) noexcept =
0068 default;
0069
0070
0071 ~ProtoSurfaceMaterialT() override = default;
0072
0073
0074
0075
0076
0077 ProtoSurfaceMaterialT<BinningType>& operator=(
0078 const ProtoSurfaceMaterialT<BinningType>& smproxy) = default;
0079
0080
0081
0082
0083
0084 ProtoSurfaceMaterialT<BinningType>& operator=(
0085 ProtoSurfaceMaterialT<BinningType>&& smproxy) noexcept = default;
0086
0087
0088
0089
0090 ProtoSurfaceMaterialT<BinningType>& scale(double ) final {
0091 return (*this);
0092 }
0093
0094
0095
0096 const std::optional<std::string>& materialKey() const {
0097 return m_materialKey;
0098 }
0099
0100
0101
0102 const BinningType& binning() const { return (m_binning); }
0103
0104
0105
0106
0107
0108 const MaterialSlab& materialSlab(const Vector2& ) const final {
0109 return (m_materialSlab);
0110 }
0111
0112
0113 std::vector<AxisDirection> localAxisDirections() const final { return {}; }
0114
0115 using ISurfaceMaterial::materialSlab;
0116
0117
0118
0119
0120
0121 std::ostream& toStream(std::ostream& sl) const final {
0122 sl << "Acts::ProtoSurfaceMaterial : " << std::endl;
0123 sl << m_binning << std::endl;
0124 return sl;
0125 }
0126
0127 private:
0128
0129 BinningType m_binning;
0130
0131 std::optional<std::string> m_materialKey;
0132
0133
0134 MaterialSlab m_materialSlab = MaterialSlab::Nothing();
0135 };
0136
0137
0138
0139 using ProtoSurfaceMaterial = ProtoSurfaceMaterialT<Acts::BinUtility>;
0140
0141
0142
0143
0144
0145 using ProtoGridSurfaceMaterial = ProtoSurfaceMaterialT<MultiAxisSpec2D>;
0146
0147
0148
0149 }