6#ifndef YODA_BinningUtils_h
7#define YODA_BinningUtils_h
17 template <
typename... EdgeT>
18 using all_CAxes =
typename std::conjunction<std::is_floating_point<EdgeT>...>;
21 template <
typename... EdgeT>
25 template <
typename EdgeT>
26 using enable_if_CAxisT = std::enable_if_t<std::is_floating_point<EdgeT>::value, EdgeT>;
29 template <
typename EdgeT>
30 using enable_if_DAxisT = std::enable_if_t<!std::is_floating_point<EdgeT>::value, EdgeT>;
47 static const char*
name() {
return typeid(T).
name(); }
53 static const char*
name() {
return "s"; }
57 template<
typename A,
typename... As>
64 template <ssize_t DbnN,
typename A,
typename... As>
67 constexpr size_t N =
sizeof...(As)+1;
69 if constexpr (
all_CAxes<A, As...>::value) {
70 if constexpr (DbnN < 0) {
71 return "Estimate"+std::to_string(N)+
"D";
73 if constexpr (DbnN == N+1) {
74 return "Profile"+std::to_string(N)+
"D";
76 if constexpr (DbnN == N) {
77 return "Histo"+std::to_string(N)+
"D";
81 std::string type =
"Binned";
82 if (DbnN < 0) type +=
"Estimate";
83 else if (DbnN == N) type +=
"Histo";
84 else if (DbnN == N+1) type +=
"Profile";
85 else type +=
"Dbn" + std::to_string(DbnN);
89 return (type +
"<" + axes +
">");
93 template <
typename A,
typename... As>
Anonymous namespace to limit visibility.
std::string mkTypeString()
Helper function to construct the BinnedDbn and BinnedEstimate type names.
std::enable_if_t< all_CAxes< EdgeT... >::value > enable_if_all_CAxisT
Checks if all edge types are continuous.
std::string mkAxisConfig()
Helper function to construct the axis config.
typename std::conjunction< std::is_floating_point< EdgeT >... > all_CAxes
std::enable_if_t<!std::is_floating_point< EdgeT >::value, EdgeT > enable_if_DAxisT
Checks if edge type is discrete and returns edge type.
std::enable_if_t< std::is_floating_point< EdgeT >::value, EdgeT > enable_if_CAxisT
Checks if edge type is continuous and returns edge type.
static const char * name()
Returns the type ID as a character sequence.
static const char * name()