File indexing completed on 2025-01-18 09:55:28
0001
0002
0003 #ifndef EDM4EIC_Cov3f_H
0004 #define EDM4EIC_Cov3f_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 edm4eic {
0013
0014
0015
0016
0017
0018 class Cov3f {
0019 public:
0020 float xx{};
0021 float yy{};
0022 float zz{};
0023 float xy{};
0024 float xz{};
0025 float yz{};
0026
0027 Cov3f() : xx{0}, yy{0}, zz{0}, xy{0}, xz{0}, yz{0} {}
0028 Cov3f(double vx, double vy, double vz, double vxy = 0, double vxz = 0, double vyz = 0)
0029 : xx{static_cast<float>(vx)}, yy{static_cast<float>(vy)}, zz{static_cast<float>(vz)},
0030 xy{static_cast<float>(vxy)}, xz{static_cast<float>(vxz)}, yz{static_cast<float>(vyz)} {}
0031 float operator()(unsigned i, unsigned j) const {
0032
0033 if (i == j) {
0034 return *(&xx + i);
0035 }
0036
0037
0038
0039 return *(&xy + i + j - 1);
0040 }
0041
0042
0043 };
0044
0045 std::ostream& operator<<(std::ostream& o, const edm4eic::Cov3f& value);
0046
0047 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0048 void to_json(nlohmann::json& j, const Cov3f& value);
0049 #endif
0050
0051 }
0052
0053
0054 #endif