Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:12:49

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 #include <cmath>
0010 #include <optional>
0011 
0012 #pragma once
0013 
0014 struct SpacePoint {
0015   float m_x{};
0016   float m_y{};
0017   float m_z{};
0018   float m_r{};
0019   int layer{};
0020   float varianceR{};
0021   float varianceZ{};
0022   std::optional<float> m_t;
0023   std::optional<float> varianceT;
0024   float x() const { return m_x; }
0025   float y() const { return m_y; }
0026   float z() const { return m_z; }
0027   float r() const { return m_r; }
0028   std::optional<float> t() const { return m_t; }
0029 };
0030 
0031 bool operator==(SpacePoint a, SpacePoint b) {
0032   if (std::abs(a.m_x - b.m_x) < 1e-6 && std::abs(a.m_y - b.m_y) < 1e-6 &&
0033       std::abs(a.m_z - b.m_z) < 1e-6) {
0034     return true;
0035   } else {
0036     return false;
0037   }
0038 }