15 #ifndef ROOT7_THistBufferedFill 16 #define ROOT7_THistBufferedFill 18 #include "ROOT/RArrayView.hxx" 21 namespace Experimental {
24 template<
class DERIVED,
class HIST,
int SIZE>
32 std::array<CoordArray_t, SIZE>
fXBuf;
33 std::array<Weight_t, SIZE>
fWBuf;
39 DERIVED&
toDerived() {
return *
static_cast<DERIVED*
>(
this); }
40 const DERIVED&
toDerived()
const {
return *
static_cast<const DERIVED*
>(
this); }
43 return std::array_view<CoordArray_t>(fXBuf.begin(), fXBuf.begin() +
fCursor);
46 return std::array_view<Weight_t>(fWBuf.begin(), fWBuf.begin() +
fCursor);
51 fWBuf[fCursor++] = weight;
52 if (fCursor == SIZE) {
74 template <
class HIST,
int SIZE = 1024>
85 std::array<CoordArray_t, SIZE>
fXBuf;
86 std::array<Weight_t, SIZE>
fWBuf;
91 void FillN(
const std::array_view<CoordArray_t> xN,
92 const std::array_view<Weight_t> weightN) {
93 fHist.FillN(xN, weightN);
96 void FillN(
const std::array_view<CoordArray_t> xN) {
112 static constexpr
int GetNDim() {
return HIST::GetNDim(); }
void Fill(const CoordArray_t &x, Weight_t weight=1.)
std::array< double, DIMENSIONS > CoordArray_t
static constexpr int GetNDim()
Namespace for new ROOT classes and functions.
typename HIST::Weight_t Weight_t
std::array< CoordArray_t, SIZE > fXBuf
typename HIST::Weight_t Weight_t
const DERIVED & toDerived() const
typename HIST::CoordArray_t CoordArray_t
void FillN(const std::array_view< CoordArray_t > xN, const std::array_view< Weight_t > weightN)
void FillN(const std::array_view< CoordArray_t > xN)
std::array< Weight_t, SIZE > fWBuf
std::array< CoordArray_t, SIZE > fXBuf
THistBufferedFill(Hist_t &hist)
typename HIST::CoordArray_t CoordArray_t
std::array< Weight_t, SIZE > fWBuf
std::array_view< CoordArray_t > GetCoords() const
std::array_view< Weight_t > GetWeights() const