Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:55:40

0001 // AUTOMATICALLY GENERATED FILE - DO NOT EDIT
0002 
0003 #ifndef EDM4HEP_Vector4f_H
0004 #define EDM4HEP_Vector4f_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 /** @class Vector4f
0015  *  Generic vector for storing classical 4D coordinates in memory. Four momentum helper functions are in edm4hep::utils
0016  *  @author:
0017  */
0018 class Vector4f {
0019 public:
0020   float x{};
0021   float y{};
0022   float z{};
0023   float t{};
0024 
0025   constexpr Vector4f() : x(0), y(0), z(0), t(0) {
0026   }
0027   constexpr Vector4f(float xx, float yy, float zz, float tt) : x(xx), y(yy), z(zz), t(tt) {
0028   }
0029   constexpr Vector4f(const float* v) : x(v[0]), y(v[1]), z(v[2]), t(v[3]) {
0030   }
0031   constexpr bool operator==(const Vector4f& v) const {
0032     return (x == v.x && y == v.y && z == v.z && t == v.t);
0033   }
0034   constexpr float operator[](unsigned i) const {
0035     return *(&x + i);
0036   }
0037 };
0038 
0039 std::ostream& operator<<(std::ostream& o, const edm4hep::Vector4f& value);
0040 
0041 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0042 void to_json(nlohmann::json& j, const Vector4f& value);
0043 #endif
0044 
0045 } // namespace edm4hep
0046 
0047 #endif