File indexing completed on 2026-09-16 09:07:48
0001
0002
0003 #ifndef EDM4HEP_Vector2f_H
0004 #define EDM4HEP_Vector2f_H
0005
0006 #include <cstddef>
0007 #include <ostream>
0008
0009 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0010 #include "nlohmann/json_fwd.hpp"
0011 #endif
0012
0013 namespace edm4hep {
0014
0015
0016
0017
0018
0019 class Vector2f {
0020 public:
0021 float a{};
0022 float b{};
0023
0024 constexpr Vector2f() : a(0), b(0) {}
0025 constexpr Vector2f(float aa, float bb) : a(aa), b(bb) {}
0026 constexpr Vector2f(const float* v) : a(v[0]), b(v[1]) {}
0027 constexpr bool operator==(const Vector2f& v) const { return (a == v.a && b == v.b); }
0028 constexpr bool operator!=(const Vector2f& v) const { return !(*this == v); }
0029 constexpr float operator[](unsigned i) const {
0030 static_assert(offsetof(Vector2f, a) + sizeof(Vector2f::a) == offsetof(Vector2f, b),
0031 "operator[] requires no padding");
0032 return *(&a + i);
0033 }
0034 };
0035
0036 std::ostream& operator<<(std::ostream& o, const Vector2f& value);
0037
0038 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0039 void to_json(nlohmann::json& j, const Vector2f& value);
0040 #endif
0041
0042 namespace v6 {
0043 using Vector2f = edm4hep::Vector2f;
0044 }
0045
0046
0047 namespace v5 {
0048
0049 class Vector2f {
0050 public:
0051 float a{};
0052 float b{};
0053 };
0054
0055 }
0056 namespace v4 {
0057
0058 class Vector2f {
0059 public:
0060 float a{};
0061 float b{};
0062 };
0063
0064 }
0065 namespace v3 {
0066
0067 class Vector2f {
0068 public:
0069 float a{};
0070 float b{};
0071 };
0072
0073 }
0074 namespace v2 {
0075
0076 class Vector2f {
0077 public:
0078 float a{};
0079 float b{};
0080 };
0081
0082 }
0083
0084 }
0085
0086 #endif