EDM4eic
EIC data model
Loading...
Searching...
No Matches
Cov4f.h
Go to the documentation of this file.
1// AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2
3#ifndef EDM4EIC_Cov4f_H
4#define EDM4EIC_Cov4f_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 Cov4f
15 *
16 * @author:
17 */
18class Cov4f {
19public:
20 float xx{};
21 float yy{};
22 float zz{};
23 float tt{};
24 float xy{};
25 float xz{};
26 float xt{};
27 float yz{};
28 float yt{};
29 float zt{};
30
31 Cov4f() : xx{0}, yy{0}, zz{0}, tt{0}, xy{0}, xz{0}, xt{0}, yz{0}, yt{0}, zt{0} {}
32 Cov4f(double vx, double vy, double vz, double vt,
33 double vxy = 0, double vxz = 0, double vxt = 0,
34 double vyz = 0, double vyt = 0, double vzt = 0)
35 : xx{static_cast<float>(vx)}, yy{static_cast<float>(vy)}, zz{static_cast<float>(vz)}, tt{static_cast<float>(vt)},
36 xy{static_cast<float>(vxy)}, xz{static_cast<float>(vxz)}, xt{static_cast<float>(vxt)},
37 yz{static_cast<float>(vyz)}, yt{static_cast<float>(vyt)}, zt{static_cast<float>(vzt)} {}
38 float operator()(unsigned i, unsigned j) const {
39 // diagonal
40 if (i == j) {
41 return *(&xx + i);
42 // off-diagonal, can probably be done with less if statements
43 } else {
44 if (i > j) {
45 std::swap(i,j);
46 }
47 if (i == 0) {
48 return *(&xy + j - 1);
49 } else if (i == 1) {
50 return *(&yz + j - 2);
51 } else {
52 return zt;
53 }
54 }
55 }
56
57
58};
59
60std::ostream& operator<<(std::ostream& o, const edm4eic::Cov4f& value);
61
62#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
63void to_json(nlohmann::json& j, const Cov4f& value);
64#endif
65
66} // namespace edm4eic
67
68
69#endif
Definition Cov4f.h:18
float yz
Definition Cov4f.h:27
float yt
Definition Cov4f.h:28
float xy
Definition Cov4f.h:24
float zz
Definition Cov4f.h:22
Cov4f(double vx, double vy, double vz, double vt, double vxy=0, double vxz=0, double vxt=0, double vyz=0, double vyt=0, double vzt=0)
Definition Cov4f.h:32
float xz
Definition Cov4f.h:25
float operator()(unsigned i, unsigned j) const
Definition Cov4f.h:38
Cov4f()
Definition Cov4f.h:31
float yy
Definition Cov4f.h:21
float zt
Definition Cov4f.h:29
float xt
Definition Cov4f.h:26
float tt
Definition Cov4f.h:23
float xx
Definition Cov4f.h:20
Definition CalorimeterHit.cc:18
std::ostream & operator<<(std::ostream &o, const CalorimeterHit &value)
Definition CalorimeterHit.cc:97