File indexing completed on 2025-01-18 09:13:10
0001
0002
0003
0004
0005
0006
0007
0008
0009 #pragma once
0010
0011 #include <cmath>
0012 #include <optional>
0013
0014 struct SpacePoint {
0015
0016 float m_x{};
0017 float m_y{};
0018 float m_z{};
0019 float m_r{};
0020 int layer{};
0021 float varianceR{};
0022 float varianceZ{};
0023 std::optional<float> m_t;
0024 std::optional<float> varianceT;
0025
0026
0027 SpacePoint() = default;
0028
0029
0030 SpacePoint(float x, float y, float z, float r, int l, float varR, float varZ,
0031 std::optional<float> t, std::optional<float> varT)
0032 : m_x(x),
0033 m_y(y),
0034 m_z(z),
0035 m_r(r),
0036 layer(l),
0037 varianceR(varR),
0038 varianceZ(varZ),
0039 m_t(t),
0040 varianceT(varT) {}
0041
0042
0043 float x() const { return m_x; }
0044 float y() const { return m_y; }
0045 float z() const { return m_z; }
0046 float r() const { return m_r; }
0047 std::optional<float> t() const { return m_t; }
0048
0049
0050 friend bool operator==(const SpacePoint &a, const SpacePoint &b) {
0051 return std::abs(a.m_x - b.m_x) < 1e-6 && std::abs(a.m_y - b.m_y) < 1e-6 &&
0052 std::abs(a.m_z - b.m_z) < 1e-6;
0053 }
0054 };