16 #ifndef ROOT7_THistBufferedFill 17 #define ROOT7_THistBufferedFill 22 namespace Experimental {
25 template <
class DERIVED,
class HIST,
int SIZE>
33 std::array<CoordArray_t, SIZE>
fXBuf;
34 std::array<Weight_t, SIZE>
fWBuf;
40 DERIVED &
toDerived() {
return *
static_cast<DERIVED *
>(
this); }
41 const DERIVED &
toDerived()
const {
return *
static_cast<const DERIVED *
>(
this); }
45 return std::span<CoordArray_t>(fXBuf.begin(), fXBuf.begin() +
fCursor);
49 return std::span<Weight_t>(fWBuf.begin(), fWBuf.begin() +
fCursor);
55 fWBuf[fCursor++] = weight;
56 if (fCursor == SIZE) {
77 template <
class HIST,
int SIZE = 1024>
87 std::array<CoordArray_t, SIZE>
fXBuf;
88 std::array<Weight_t, SIZE>
fWBuf;
93 void FillN(
const std::span<CoordArray_t> xN,
const std::span<Weight_t> weightN)
95 fHist.FillN(xN, weightN);
98 void FillN(
const std::span<CoordArray_t> xN) { fHist.FillN(xN); }
109 static constexpr
int GetNDim() {
return HIST::GetNDim(); }
void Fill(const CoordArray_t &x, Weight_t weight=1.)
static constexpr int GetNDim()
Namespace for new ROOT classes and functions.
typename HIST::Weight_t Weight_t
void FillN(const std::span< CoordArray_t > xN, const std::span< Weight_t > weightN)
std::array< CoordArray_t, SIZE > fXBuf
typename HIST::Weight_t Weight_t
const DERIVED & toDerived() const
typename HIST::CoordArray_t CoordArray_t
std::array< Weight_t, SIZE > fWBuf
TCoordArray< DIMENSIONS > CoordArray_t
std::array< CoordArray_t, SIZE > fXBuf
THistBufferedFill(Hist_t &hist)
std::span< CoordArray_t > GetCoords() const
std::span< Weight_t > GetWeights() const
typename HIST::CoordArray_t CoordArray_t
void FillN(const std::span< CoordArray_t > xN)
std::array< Weight_t, SIZE > fWBuf