Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-29 09:09:22

0001 // AUTOMATICALLY GENERATED FILE - DO NOT EDIT
0002 
0003 #ifndef EDM4HEP_Vector3d_H
0004 #define EDM4HEP_Vector3d_H
0005 
0006 #include <cstddef>
0007 #include <edm4hep/Vector3f.h>
0008 #include <ostream>
0009 
0010 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0011 #include "nlohmann/json_fwd.hpp"
0012 #endif
0013 
0014 namespace edm4hep {
0015 
0016 /** @class Vector3d
0017  *
0018  *  @author:
0019  */
0020 class Vector3d {
0021 public:
0022   double x{};
0023   double y{};
0024   double z{};
0025 
0026   constexpr Vector3d() : x(0), y(0), z(0) {}
0027   constexpr Vector3d(double xx, double yy, double zz) : x(xx), y(yy), z(zz) {}
0028   constexpr Vector3d(const double* v) : x(v[0]), y(v[1]), z(v[2]) {}
0029   constexpr Vector3d(const float* v) : x(v[0]), y(v[1]), z(v[2]) {}
0030   constexpr bool operator==(const Vector3d& v) const { return (x == v.x && y == v.y && z == v.z); }
0031   constexpr bool operator!=(const Vector3d& v) const { return !(*this == v); }
0032   constexpr double operator[](unsigned i) const {
0033     static_assert((offsetof(Vector3d, x) + sizeof(Vector3d::x) == offsetof(Vector3d, y)) &&
0034                       (offsetof(Vector3d, y) + sizeof(Vector3d::y) == offsetof(Vector3d, z)),
0035                   "operator[] requires no padding");
0036     return *(&x + i);
0037   }
0038 };
0039 
0040 std::ostream& operator<<(std::ostream& o, const Vector3d& value);
0041 
0042 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0043 void to_json(nlohmann::json& j, const Vector3d& value);
0044 #endif
0045 
0046 namespace v6 {
0047   using Vector3d = edm4hep::Vector3d;
0048 } // namespace v6
0049 
0050 // Definitions for older versions
0051 namespace v5 {
0052 
0053   class Vector3d {
0054   public:
0055     double x{};
0056     double y{};
0057     double z{};
0058   };
0059 
0060 } // namespace v5
0061 namespace v4 {
0062 
0063   class Vector3d {
0064   public:
0065     double x{};
0066     double y{};
0067     double z{};
0068   };
0069 
0070 } // namespace v4
0071 namespace v3 {
0072 
0073   class Vector3d {
0074   public:
0075     double x{};
0076     double y{};
0077     double z{};
0078   };
0079 
0080 } // namespace v3
0081 namespace v2 {
0082 
0083   class Vector3d {
0084   public:
0085     double x{};
0086     double y{};
0087     double z{};
0088   };
0089 
0090 } // namespace v2
0091 
0092 } // namespace edm4hep
0093 
0094 #endif