EDM4eic
EIC data model
Loading...
Searching...
No Matches
Cov6f.h
Go to the documentation of this file.
1// AUTOMATICALLY GENERATED FILE - DO NOT EDIT
2
3#ifndef EDM4EIC_Cov6f_H
4#define EDM4EIC_Cov6f_H
5
6#include <array>
7#include <ostream>
8
9#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
10#include "nlohmann/json_fwd.hpp"
11#endif
12
13namespace edm4eic {
14
15/** @class Cov6f
16 *
17 * @author:
18 */
19class Cov6f {
20public:
21 std::array<float, 21> covariance{}; ///< 6d triangular packed covariance matrix
22
24 Cov6f(std::array<float, 21> vcov) : covariance{vcov}{}
25 float operator()(unsigned i, unsigned j) const {
26 if(i > j) {
27 std::swap(i, j);
28 }
29 return covariance[i + 1 + (j + 1) * (j) / 2 - 1];
30 }
31 float& operator()(unsigned i, unsigned j) {
32 if(i > j) {
33 std::swap(i, j);
34 }
35 return covariance[i + 1 + (j + 1) * (j) / 2 - 1];
36 }
37
38
39};
40
41std::ostream& operator<<(std::ostream& o, const edm4eic::Cov6f& value);
42
43#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
44void to_json(nlohmann::json& j, const Cov6f& value);
45#endif
46
47} // namespace edm4eic
48
49
50#endif
Definition Cov6f.h:19
std::array< float, 21 > covariance
6d triangular packed covariance matrix
Definition Cov6f.h:21
Cov6f(std::array< float, 21 > vcov)
Definition Cov6f.h:24
float operator()(unsigned i, unsigned j) const
Definition Cov6f.h:25
Cov6f()
Definition Cov6f.h:23
float & operator()(unsigned i, unsigned j)
Definition Cov6f.h:31
Definition CalorimeterHit.cc:18
std::ostream & operator<<(std::ostream &o, const CalorimeterHit &value)
Definition CalorimeterHit.cc:97