File indexing completed on 2025-01-18 09:27:40
0001
0002
0003
0004
0005
0006
0007
0008
0009 #pragma once
0010
0011 #include "Acts/Definitions/Algebra.hpp"
0012 #include "Acts/Material/Material.hpp"
0013
0014 #include <iosfwd>
0015 #include <utility>
0016 #include <vector>
0017
0018 namespace Acts {
0019
0020
0021
0022
0023
0024
0025 class MaterialSlab {
0026 public:
0027
0028
0029
0030
0031
0032
0033
0034 static MaterialSlab averageLayers(const MaterialSlab& layerA,
0035 const MaterialSlab& layerB);
0036
0037
0038
0039
0040
0041
0042
0043 static MaterialSlab averageLayers(const std::vector<MaterialSlab>& layers);
0044
0045
0046 MaterialSlab() = default;
0047
0048 MaterialSlab(float thickness);
0049
0050
0051
0052
0053 MaterialSlab(const Material& material, float thickness);
0054 ~MaterialSlab() = default;
0055
0056 MaterialSlab(MaterialSlab&&) = default;
0057 MaterialSlab(const MaterialSlab&) = default;
0058 MaterialSlab& operator=(MaterialSlab&&) = default;
0059 MaterialSlab& operator=(const MaterialSlab&) = default;
0060
0061
0062 void scaleThickness(float scale);
0063
0064
0065 constexpr operator bool() const { return m_material && (0.0f < m_thickness); }
0066
0067
0068 constexpr const Material& material() const { return m_material; }
0069
0070 constexpr float thickness() const { return m_thickness; }
0071
0072 constexpr float thicknessInX0() const { return m_thicknessInX0; }
0073
0074 constexpr float thicknessInL0() const { return m_thicknessInL0; }
0075
0076 private:
0077 Material m_material;
0078 float m_thickness = 0.0f;
0079 float m_thicknessInX0 = 0.0f;
0080 float m_thicknessInL0 = 0.0f;
0081
0082 friend constexpr bool operator==(const MaterialSlab& lhs,
0083 const MaterialSlab& rhs) {
0084
0085 return (lhs.m_material == rhs.m_material) &&
0086 (lhs.m_thickness == rhs.m_thickness);
0087 }
0088 friend constexpr bool operator!=(const MaterialSlab& lhs,
0089 const MaterialSlab& rhs) {
0090 return !(lhs == rhs);
0091 }
0092 };
0093
0094 std::ostream& operator<<(std::ostream& os, const MaterialSlab& materialSlab);
0095
0096
0097 using MaterialSlabVector = std::vector<MaterialSlab>;
0098 using MaterialSlabMatrix = std::vector<MaterialSlabVector>;
0099
0100
0101 using RecordedMaterialVolumePoint =
0102 std::vector<std::pair<Acts::MaterialSlab, std::vector<Acts::Vector3>>>;
0103
0104 }