File indexing completed on 2025-12-15 10:12:02
0001
0002
0003 #ifndef EDM4EIC_Cov2f_H
0004 #define EDM4EIC_Cov2f_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
0019 class Cov2f {
0020 public:
0021 float xx{};
0022 float yy{};
0023 float xy{};
0024
0025 Cov2f() : xx{0}, yy{0}, xy{0} {}
0026 Cov2f(double vx, double vy, double vxy = 0)
0027 : xx{static_cast<float>(vx)}, yy{static_cast<float>(vy)}, xy{static_cast<float>(vxy)} {}
0028 float operator()(unsigned i, unsigned j) const {
0029
0030 if (i == j) {
0031 return *(&xx + i);
0032 }
0033
0034
0035
0036 return *(&xy + (i + j + 1) / 2);
0037 }
0038
0039
0040 };
0041
0042 std::ostream& operator<<(std::ostream& o, const Cov2f& value);
0043
0044 #if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
0045 void to_json(nlohmann::json& j, const Cov2f& value);
0046 #endif
0047
0048 namespace v850 {
0049 using Cov2f = edm4eic::Cov2f;
0050 }
0051
0052
0053 }
0054
0055
0056 #endif