EDM4eic
EIC data model
Loading...
Searching...
No Matches
Cov3f.h
Go to the documentation of this file.
1// AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2
3#ifndef EDM4EIC_Cov3f_H
4#define EDM4EIC_Cov3f_H
5
6#include <ostream>
7
8#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
9#include "nlohmann/json_fwd.hpp"
10#endif
11
12namespace edm4eic {
13
14/** @class Cov3f
15 *
16 * @author:
17 */
18class Cov3f {
19public:
20 float xx{};
21 float yy{};
22 float zz{};
23 float xy{};
24 float xz{};
25 float yz{};
26
27 Cov3f() : xx{0}, yy{0}, zz{0}, xy{0}, xz{0}, yz{0} {}
28 Cov3f(double vx, double vy, double vz, double vxy = 0, double vxz = 0, double vyz = 0)
29 : xx{static_cast<float>(vx)}, yy{static_cast<float>(vy)}, zz{static_cast<float>(vz)},
30 xy{static_cast<float>(vxy)}, xz{static_cast<float>(vxz)}, yz{static_cast<float>(vyz)} {}
31 float operator()(unsigned i, unsigned j) const {
32 // diagonal
33 if (i == j) {
34 return *(&xx + i);
35 }
36 // off-diagonal
37 // we have as options (0, 1), (0, 2) and (1, 2) (and mirrored)
38 // note that, starting from xy, we find the correct element at (i+j-1)
39 return *(&xy + i + j - 1);
40 }
41
42
43};
44
45std::ostream& operator<<(std::ostream& o, const edm4eic::Cov3f& value);
46
47#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
48void to_json(nlohmann::json& j, const Cov3f& value);
49#endif
50
51} // namespace edm4eic
52
53
54#endif
Definition Cov3f.h:18
float yy
Definition Cov3f.h:21
float xy
Definition Cov3f.h:23
Cov3f()
Definition Cov3f.h:27
float operator()(unsigned i, unsigned j) const
Definition Cov3f.h:31
float xx
Definition Cov3f.h:20
float yz
Definition Cov3f.h:25
float xz
Definition Cov3f.h:24
Cov3f(double vx, double vy, double vz, double vxy=0, double vxz=0, double vyz=0)
Definition Cov3f.h:28
float zz
Definition Cov3f.h:22
Definition CalorimeterHit.cc:18
std::ostream & operator<<(std::ostream &o, const CalorimeterHit &value)
Definition CalorimeterHit.cc:97