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