15 #include <fmt/format.h>
28 template <
typename Key>
40 template <
typename Key,
typename Histo>
44 template <
typename OWNER, std::invocable<Key const&> FormatName, std::invocable<Key const&> FormatTitle>
46 typename Histo::AxisTupleType&& allAxis )
47 :
m_makeHisto{ [owner, fname, ftitle, allAxis,
this](
Key const& k ) -> Histo& {
49 .emplace( std::piecewise_construct, std::forward_as_tuple( k ),
50 std::forward_as_tuple( owner, fname( k ), ftitle( k ), allAxis ) )
54 template <
typename OWNER>
56 typename Histo::AxisTupleType&& allAxis )
59 .emplace( std::piecewise_construct, std::forward_as_tuple( k ),
67 auto it =
m_map.find( k );
68 if ( it !=
m_map.end() )
return it->second;
73 mutable std::map<Key, Histo>
m_map;
123 template <
typename Key,
typename Histo,
124 typename Seq = std::make_integer_sequence<unsigned int, std::tuple_size_v<typename Histo::AxisTupleType>>>
126 template <
typename Key,
typename Histo,
unsigned int... ND>
129 template <
typename OWNER,
typename FormatName,
typename FormatTitle>
130 HistogramMap( OWNER* owner, FormatName&& fname, FormatTitle&& ftitle,
typename Histo::AxisTupleType&& allAxis )
131 :
details::HistogramMapInternal<
Key, Histo>( owner, fname, ftitle,
132 std::forward<typename Histo::AxisTupleType>( allAxis ) ) {}
134 template <
unsigned int I>
135 using AxisType = std::tuple_element_t<I, typename Histo::AxisTupleType>;
137 template <
typename OWNER,
typename FormatName,
typename FormatTitle>
139 :
HistogramMap( owner, fname, ftitle,
std::make_tuple( allAxis... ) ) {}