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/** @class Cov2f
15 *
16 * @author:
17 */
18class Cov2f {
19public:
20 float xx{};
21 float yy{};
22 float xy{};
23
24 Cov2f() : xx{0}, yy{0}, xy{0} {}
25 Cov2f(double vx, double vy, double vxy = 0)
26 : xx{static_cast<float>(vx)}, yy{static_cast<float>(vy)}, xy{static_cast<float>(vxy)} {}
27 float operator()(unsigned i, unsigned j) const {
28 // diagonal
29 if (i == j) {
30 return *(&xx + i);
31 }
32 // off-diagonal
33 // we have as options (0, 1), and (1, 0)
34 // note that, starting from xy, we find the correct element at (i+j+1)/2)
35 return *(&xy + (i + j + 1) / 2);
36 }
37
38
39};
40
41std::ostream& operator<<(std::ostream& o, const edm4eic::Cov2f& value);
42
43#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
44void to_json(nlohmann::json& j, const Cov2f& value);
45#endif
46
47} // namespace edm4eic
48
49
50#endif
Definition Cov2f.h:18
float operator()(unsigned i, unsigned j) const
Definition Cov2f.h:27
Cov2f()
Definition Cov2f.h:24
float yy
Definition Cov2f.h:21
float xx
Definition Cov2f.h:20
Cov2f(double vx, double vy, double vxy=0)
Definition Cov2f.h:25
float xy
Definition Cov2f.h:22
Definition CalorimeterHit.cc:18
std::ostream & operator<<(std::ostream &o, const CalorimeterHit &value)
Definition CalorimeterHit.cc:97