Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 09:25:35

0001 // This file is part of the ACTS project.
0002 //
0003 // Copyright (C) 2016 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 https://mozilla.org/MPL/2.0/.
0008 
0009 #pragma once
0010 
0011 #include <cmath>
0012 #include <optional>
0013 
0014 namespace ActsTests {
0015 
0016 struct SpacePoint {
0017   // Member variables
0018   float m_x{};
0019   float m_y{};
0020   float m_z{};
0021   float m_r{};
0022   int layer{};
0023   float varianceR{};
0024   float varianceZ{};
0025   std::optional<float> m_t;
0026   std::optional<float> varianceT;
0027 
0028   // Default constructor
0029   SpacePoint() = default;
0030 
0031   // Constructor with parameters
0032   SpacePoint(float x, float y, float z, float r, int l, float varR, float varZ,
0033              std::optional<float> t, std::optional<float> varT)
0034       : m_x(x),
0035         m_y(y),
0036         m_z(z),
0037         m_r(r),
0038         layer(l),
0039         varianceR(varR),
0040         varianceZ(varZ),
0041         m_t(t),
0042         varianceT(varT) {}
0043 
0044   // Member functions
0045   float x() const { return m_x; }
0046   float y() const { return m_y; }
0047   float z() const { return m_z; }
0048   float r() const { return m_r; }
0049   std::optional<float> t() const { return m_t; }
0050 
0051   // Equality operator
0052   friend bool operator==(const SpacePoint &a, const SpacePoint &b) {
0053     return std::abs(a.m_x - b.m_x) < 1e-6 && std::abs(a.m_y - b.m_y) < 1e-6 &&
0054            std::abs(a.m_z - b.m_z) < 1e-6;
0055   }
0056 };
0057 
0058 }  // namespace ActsTests