File indexing completed on 2025-03-13 09:07:34
0001
0002
0003 #ifndef EDM4HEP_Vector2f_H
0004 #define EDM4HEP_Vector2f_H
0005
0006 #include <ostream>
0007
0008 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0009 #include "nlohmann/json_fwd.hpp"
0010 #endif
0011
0012 namespace edm4hep {
0013
0014
0015
0016
0017
0018 class Vector2f {
0019 public:
0020 float a{};
0021 float b{};
0022
0023 constexpr Vector2f() : a(0), b(0) {
0024 }
0025 constexpr Vector2f(float aa, float bb) : a(aa), b(bb) {
0026 }
0027 constexpr Vector2f(const float* v) : a(v[0]), b(v[1]) {
0028 }
0029 constexpr bool operator==(const Vector2f& v) const {
0030 return (a == v.a && b == v.b);
0031 }
0032 constexpr float operator[](unsigned i) const {
0033 return *(&a + i);
0034 }
0035 };
0036
0037 std::ostream& operator<<(std::ostream& o, const edm4hep::Vector2f& value);
0038
0039 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0040 void to_json(nlohmann::json& j, const Vector2f& value);
0041 #endif
0042
0043 }
0044
0045 #endif