38 template <
typename HistogramType,
40 std::make_integer_sequence<unsigned int, std::tuple_size_v<typename HistogramType::AxisTupleType>>>
42 template <
typename HistogramType,
unsigned int... ND>
48 template <
unsigned int I>
49 using AxisType = std::tuple_element_t<I, AxisTupleType>;
52 template <
typename OWNER>
54 typename HistogramType::AxisTupleType axis = {},
bool doNotInitialize = false )
55 : m_name{
name }, m_title{ title }, m_axis{ axis } {
57 owner->declareProperty( titlePropertyName(), m_title,
fmt::format(
"Title of histogram {}",
name ) )
58 ->template setOwnerType<OWNER>();
60 ->declareProperty( axisPropertyName<ND>(), std::get<ND>( m_axis ),
62 ->template setOwnerType<OWNER>(),
65 if ( !doNotInitialize ) {
69 createHistogram( *owner );
77 template <
typename OWNER>
79 typename HistogramType::AxisTupleType axis = {} )
80 : m_name{
name }, m_title{ title }, m_axis{ axis } {
81 createHistogram( *owner );
84 template <
typename OWNER>
89 [[nodiscard]]
auto operator[](
typename HistogramType::AxisTupleArithmeticType
v ) {
93 return m_histo.value()[
v];
97 template <
typename OWNER>
99 m_histo.emplace( &owner, m_name, m_title, m_axis );
106 j =
h.m_histo.value();
113 fmt::format(
"Cannot modify title of histogram {} after it has been initialized", m_name ) );
116 template <
unsigned int N>
117 void setAxis( std::tuple_element_t<N, typename HistogramType::AxisTupleType>
const& axis ) {
120 fmt::format(
"Cannot modify axis {} of histogram {} after it has been initialized",
N, m_name ) );
121 std::get<N>( m_axis ) = axis;
124 template <
unsigned int N>
128 fmt::format(
"Cannot get axis {} of histogram {} before it has been initialized",
N, m_name ) );
129 return m_histo->template axis<N>();
135 fmt::format(
"Cannot get axis of histogram {} before it has been initialized", m_name ) );
136 return m_histo->axis();
145 return m_histo->buffer();
158 template <
unsigned int N>
160 return fmt::format(
"{}_Axis{}", basePropertyName(),
N );
166 typename HistogramType::AxisTupleType m_axis{};
167 std::optional<HistogramType> m_histo{};
170 template <
typename HistogramType>