28namespace Experimental {
32 fReaders.emplace_back(std::move(ntuple));
33 auto rootField = fReaders[0]->GetModel()->GetRootField();
34 for (
auto &
f : *rootField) {
35 if (
f.GetParent() != rootField)
37 fColumnNames.push_back(
f.GetName());
38 fColumnTypes.push_back(
f.GetType());
50 const auto index = std::distance(
55 std::vector<void*> ptrs;
56 for (
unsigned i = 0; i <
fNSlots; ++i)
71 std::vector<std::pair<ULong64_t, ULong64_t>> ranges;
74 auto nEntries =
fReaders[0]->GetNEntries();
75 const auto chunkSize = nEntries /
fNSlots;
82 ranges.emplace_back(start, end);
85 ranges.back().second += reminder;
93 const auto index = std::distance(
118 for (
unsigned int i = 1; i <
fNSlots; ++i) {
122 for (
unsigned int i = 0; i <
fNSlots; ++i) {
123 auto entry =
fReaders[i]->GetModel()->CreateEntry();
124 fValuePtrs.emplace_back(std::vector<void*>());
128 fEntries.emplace_back(std::move(entry));
unsigned long long ULong64_t
typedef void((*Func_t)())
const std::vector< std::string > & GetColumnNames() const final
Returns a reference to the collection of the dataset's column names.
void SetNSlots(unsigned int nSlots) final
Inform RDataSource of the number of processing slots (i.e.
bool SetEntry(unsigned int slot, ULong64_t entry) final
Advance the "cursors" returned by GetColumnReaders to the selected entry for a particular slot.
Record_t GetColumnReadersImpl(std::string_view name, const std::type_info &) final
type-erased vector of pointers to pointers to column values - one per slot
std::vector< std::unique_ptr< ROOT::Experimental::RNTupleReader > > fReaders
Clones of the first reader, one for each slot.
std::vector< std::string > fColumnNames
std::string GetTypeName(std::string_view colName) const final
Type of a column as a string, e.g.
std::vector< std::pair< ULong64_t, ULong64_t > > GetEntryRanges() final
Return ranges of entries to distribute to tasks.
RNTupleDS(std::unique_ptr< ROOT::Experimental::RNTupleReader > ntuple)
bool HasColumn(std::string_view colName) const final
Checks if the dataset has a certain column.
std::vector< std::string > fColumnTypes
std::vector< std::unique_ptr< ROOT::Experimental::REntry > > fEntries
void Initialise() final
Convenience method called before starting an event-loop.
std::vector< std::vector< void * > > fValuePtrs
The raw pointers wrapped by the RValue items of fEntries.
static std::unique_ptr< RNTupleReader > Open(std::unique_ptr< RNTupleModel > model, std::string_view ntupleName, std::string_view storage)
std::vector< void * > Record_t
ROOT's RDataFrame offers a high level interface for analyses of data stored in TTrees,...
A pseudo container class which is a generator of indices.
basic_string_view< char > string_view
RDataFrame MakeNTupleDataFrame(std::string_view ntupleName, std::string_view fileName)
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...