ATLAS Offline Software
Loading...
Searching...
No Matches
HistAxis.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef HDF5Utils_HistAxis_H
6#define HDF5Utils_HistAxis_H
7
8#include <cstdint>
9#include <string>
10#include <utility>
11#include <variant>
12#include <vector>
13
15
17 double lower{};
18 double upper{};
19 size_t n_bins{};
20 bool operator==(const regular_axis_t&) const = default;
21};
22
23struct Axis
24{
25 // Encodes the axis kind:
26 // regular_axis_t – equal-width float axis (lower, upper, n_bins)
27 // vector<double> – variable-width float axis (N+1 edges for N bins)
28 // vector<int64_t> – non-contiguous integer category values
29 // vector<string> – string category labels
30 // pair<int64_t,int64_t>– contiguous integer range [first, last] inclusive
31 using edges_t = std::variant<
33 std::vector<double>,
34 std::vector<int64_t>,
35 std::vector<std::string>,
36 std::pair<int64_t,int64_t>
37 >;
39 std::string name{};
40 bool underflow{false};
41 bool overflow{false};
42 bool operator==(const Axis&) const = default;
43};
44
45} // namespace H5Utils::hist::detail
46
47#endif //> !HDF5Utils_HistAxis_H
bool operator==(const Axis &) const =default
std::variant< regular_axis_t, std::vector< double >, std::vector< int64_t >, std::vector< std::string >, std::pair< int64_t, int64_t > > edges_t
Definition HistAxis.h:31
bool operator==(const regular_axis_t &) const =default