File indexing completed on 2025-01-18 10:10:44
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 #ifndef ROOT7_RHistUtils
0016 #define ROOT7_RHistUtils
0017
0018 #include <array>
0019 #include <type_traits>
0020
0021 namespace ROOT {
0022 namespace Experimental {
0023
0024 class RLogChannel;
0025
0026 RLogChannel &HistLog();
0027
0028 namespace Hist {
0029
0030 template <int DIMENSIONS>
0031 struct RCoordArray: std::array<double, DIMENSIONS> {
0032 using Base_t = std::array<double, DIMENSIONS>;
0033
0034
0035 RCoordArray() = default;
0036
0037
0038 template<class...ELEMENTS, class = typename std::enable_if<sizeof...(ELEMENTS) + 1 == DIMENSIONS>::type>
0039 RCoordArray(double x, ELEMENTS...el): Base_t{{x, el...}} {}
0040
0041
0042
0043 template<class T, class...ELEMENTS, class = typename std::enable_if<sizeof...(ELEMENTS) + 1 != DIMENSIONS>::type>
0044 RCoordArray(T, ELEMENTS...) {
0045 static_assert(sizeof...(ELEMENTS) + 1 == DIMENSIONS, "Number of coordinates does not match DIMENSIONS");
0046 }
0047
0048
0049 RCoordArray(double (&arr)[DIMENSIONS]): Base_t(arr) {}
0050
0051
0052
0053 RCoordArray(const std::array<double, DIMENSIONS>& arr): Base_t(arr) {}
0054 };
0055
0056 template <int DIMENSIONS>
0057
0058 using CoordArray_t = RCoordArray<DIMENSIONS>;
0059
0060
0061 }
0062 }
0063 }
0064
0065 #endif