24template <
typename Hist,
typename T>
27 if (engine.GetNDimensions() != 1) {
28 throw std::invalid_argument(
"TH1 requires one dimension");
31 auto ret = std::make_unique<Hist>();
32 ret->SetDirectory(
nullptr);
39 if constexpr (std::is_same_v<T, RBinWithError>) {
40 if (
sumw2 ==
nullptr) {
45 ret->GetArray()[i] =
c.fSum;
49 ret->GetArray()[i] = engine.GetBinContent(
index);
54 const auto &axis = engine.GetAxes()[0];
55 for (
auto index : axis.GetFullRange()) {
56 if (
index.IsUnderflow()) {
58 }
else if (
index.IsOverflow()) {
69template <
typename Hist>
85namespace Experimental {
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
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
void ConvertAxis(TAxis &dst, const RAxisVariant &src)
Convert a single axis object to TAxis.
std::unique_ptr< TH1I > ConvertToTH1I(const RHistEngine< int > &engine)
Convert a one-dimensional histogram to TH1I.
std::unique_ptr< TH1S > ConvertToTH1S(const RHistEngine< short > &engine)
Convert a one-dimensional histogram to TH1S.
std::unique_ptr< TH1L > ConvertToTH1L(const RHistEngine< long > &engine)
Convert a one-dimensional histogram to TH1L.
std::unique_ptr< TH1F > ConvertToTH1F(const RHistEngine< float > &engine)
Convert a one-dimensional histogram to TH1F.
std::unique_ptr< TH1C > ConvertToTH1C(const RHistEngine< char > &engine)
Convert a one-dimensional histogram to TH1C.
std::unique_ptr< TH1D > ConvertToTH1D(const RHistEngine< double > &engine)
Convert a one-dimensional histogram to TH1D.
A special bin content type to compute the bin error in weighted filling.