24template <
typename Hist,
typename T>
27 if (engine.GetNDimensions() != 2) {
28 throw std::invalid_argument(
"TH2 requires two 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];
42 if constexpr (std::is_same_v<T, RBinWithError>) {
43 if (
sumw2 ==
nullptr) {
48 ret->GetArray()[i] =
c.fSum;
59 if (
index0.IsUnderflow()) {
61 }
else if (
index0.IsOverflow()) {
62 i0 =
axis0.GetNNormalBins() + 1;
70 if (
index1.IsUnderflow()) {
72 }
else if (
index1.IsOverflow()) {
84template <
typename Hist>
116namespace 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< TH2D > ConvertToTH2D(const RHistEngine< double > &engine)
Convert a two-dimensional histogram to TH2D.
std::unique_ptr< TH2F > ConvertToTH2F(const RHistEngine< float > &engine)
Convert a two-dimensional histogram to TH2F.
std::unique_ptr< TH2I > ConvertToTH2I(const RHistEngine< int > &engine)
Convert a two-dimensional histogram to TH2I.
std::unique_ptr< TH2C > ConvertToTH2C(const RHistEngine< char > &engine)
Convert a two-dimensional histogram to TH2C.
std::unique_ptr< TH2L > ConvertToTH2L(const RHistEngine< long > &engine)
Convert a two-dimensional histogram to TH2L.
std::unique_ptr< TH2S > ConvertToTH2S(const RHistEngine< short > &engine)
Convert a two-dimensional histogram to TH2S.
Namespace for ROOT features in testing.