24template <
typename Hist,
typename T>
27 if (engine.GetNDimensions() != 3) {
28 throw std::invalid_argument(
"TH3 requires three dimensions");
31 auto ret = std::make_unique<Hist>();
32 ret->SetDirectory(
nullptr);
34 const auto &
axis0 = engine.GetAxes()[0];
36 const auto &
axis1 = engine.GetAxes()[1];
38 const auto &
axis2 = engine.GetAxes()[2];
44 if constexpr (std::is_same_v<T, RBinWithError>) {
45 if (
sumw2 ==
nullptr) {
50 ret->GetArray()[i] =
c.fSum;
61 if (
index0.IsUnderflow()) {
63 }
else if (
index0.IsOverflow()) {
64 i0 =
axis0.GetNNormalBins() + 1;
73 if (
index1.IsUnderflow()) {
75 }
else if (
index1.IsOverflow()) {
76 i1 =
axis1.GetNNormalBins() + 1;
85 if (
index2.IsUnderflow()) {
87 }
else if (
index2.IsOverflow()) {
88 i2 =
axis2.GetNNormalBins() + 1;
103template <
typename Hist>
145namespace Experimental {
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
A bin index with special values for underflow and overflow bins.
Histogram statistics of unbinned values.
const RDimensionStats & GetDimensionStats(std::size_t dim=0) const
Get the statistics object for one dimension.
std::uint64_t GetNEntries() const
bool IsEnabled(std::size_t dim) const
void ConvertAxis(TAxis &dst, const RAxisVariant &src)
Convert a single axis object to TAxis.
std::unique_ptr< TH3S > ConvertToTH3S(const RHistEngine< short > &engine)
Convert a three-dimensional histogram to TH3S.
std::unique_ptr< TH3C > ConvertToTH3C(const RHistEngine< char > &engine)
Convert a three-dimensional histogram to TH3C.
std::unique_ptr< TH3F > ConvertToTH3F(const RHistEngine< float > &engine)
Convert a three-dimensional histogram to TH3F.
std::unique_ptr< TH3I > ConvertToTH3I(const RHistEngine< int > &engine)
Convert a three-dimensional histogram to TH3I.
std::unique_ptr< TH3L > ConvertToTH3L(const RHistEngine< long > &engine)
Convert a three-dimensional histogram to TH3L.
std::unique_ptr< TH3D > ConvertToTH3D(const RHistEngine< double > &engine)
Convert a three-dimensional histogram to TH3D.
Namespace for ROOT features in testing.