23template <
typename Hist,
typename T>
26 if (engine.GetNDimensions() != 1) {
27 throw std::invalid_argument(
"TH1 requires one dimension");
30 std::unique_ptr<Hist>
ret;
33 if constexpr (std::is_same_v<T, RBinWithError>) {
34 if (
sumw2 ==
nullptr) {
39 ret->GetArray()[i] =
c.fSum;
43 ret->GetArray()[i] = engine.GetBinContent(
index);
47 const auto &axes = engine.GetAxes();
49 if (
auto *
regular = std::get_if<RRegularAxis>(&axes[0])) {
62 throw std::logic_error(
"unimplemented axis type");
66 ret->SetDirectory(
nullptr);
76template <
typename Hist>
92namespace 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.
static RBinIndex Overflow()
static RBinIndex Underflow()
Histogram statistics of unbinned values.
const RDimensionStats & GetDimensionStats(std::size_t dim=0) const
std::uint64_t GetNEntries() const
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.