ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
PhysicsAnalysis
AnalysisCommon
HDF5Utils
HDF5Utils
histogram.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#ifndef H5_HISTOGRAMS_H
6
#define H5_HISTOGRAMS_H
7
8
namespace
H5
{
9
class
Group
;
10
}
11
12
#include <string>
13
14
// the main user-facing functions are defined as members of a struct
15
// rather than free functions to ensure that the full set of overloads
16
// here matches those in the `.icc` file. The struct has one global
17
// instance, `write_hist_to_group`, that behaves exactly like a free
18
// function.
19
20
21
namespace
H5Utils::hist::detail
{
22
struct
write_hist_to_group_fn
{
23
// Simple form, writes boost::histogram to an HDF5 group with some
24
// name.
25
template
<
typename
T>
26
void
operator()
(
27
H5::Group& group,
28
const
T&
hist
,
29
const
std::string& name)
const
;
30
31
// Overload with external label override (positional list or name
32
// map). By default axes are labeled in the boost::histogram
33
// metadata, but this can be overwritten when writing. Several
34
// forms for `Labels` are allowed:
35
//
36
// - A mapping from axis name to axis labeling overrides. All keys
37
// must be valid axis names in the existing histogram, but any
38
// axes without an override are left unchanged.
39
//
40
// - A list of axis labeling overrides. This list must be equal in
41
// length to the number of axes in the histogram.
42
//
43
// The axis labeling itself specifies bin names in discrete axes,
44
// and can either be a list of labels (in the same order in which
45
// bins were specified) or a mapping between the discrete bin
46
// values and the label names. For more examples see
47
// `util/test-histogram.cxx`.
48
//
49
template
<
typename
T,
typename
Labels>
50
void
operator()
(
51
H5::Group& group,
52
const
T&
hist
,
53
const
std::string& name,
54
const
Labels& labels)
const
;
55
};
56
}
57
58
namespace
H5Utils::hist
{
59
inline
constexpr
detail::write_hist_to_group_fn
write_hist_to_group
{};
60
}
61
62
#include "
histogram.icc
"
63
64
#endif
histogram.icc
H5Utils::hist::detail
Definition
HistAxis.h:14
H5Utils::hist
Definition
HistAxis.h:14
H5Utils::hist::write_hist_to_group
constexpr detail::write_hist_to_group_fn write_hist_to_group
Definition
histogram.h:59
H5
HDF5 Traits.
Definition
H5Traits.h:17
TrigDefs::Group
Group
Properties of a chain group.
Definition
GroupProperties.h:13
H5Utils::hist::detail::write_hist_to_group_fn
Definition
histogram.h:22
H5Utils::hist::detail::write_hist_to_group_fn::operator()
void operator()(H5::Group &group, const T &hist, const std::string &name, const Labels &labels) const
H5Utils::hist::detail::write_hist_to_group_fn::operator()
void operator()(H5::Group &group, const T &hist, const std::string &name) const
Generated on
for ATLAS Offline Software by
1.17.0