34namespace Experimental {
41 std::unique_ptr<RFieldBase> fField;
45 std::unique_ptr<RFieldBase> MakeField(
const std::string &colName, RPageSource &source)
47 const auto &descriptor = source.GetDescriptor();
48 const auto fieldId = descriptor.FindFieldId(colName);
49 const auto &fieldDescriptor = descriptor.GetFieldDescriptor(fieldId);
50 const auto typeName = fieldDescriptor.GetTypeName();
57 RNTupleColumnReader(
const std::string &colName, RPageSource &source)
58 : fField(MakeField(colName, source)), fValue(fField->GenerateValue()), fLastEntry(-1)
64 if (entry != fLastEntry) {
65 fField->Read(entry, &fValue);
68 return fValue.GetRawPtr();
87 const auto &descriptor = pageSource->GetDescriptor();
89 AddFields(descriptor, descriptor.GetFieldZeroId());
91 fSources.emplace_back(std::move(pageSource));
100std::unique_ptr<ROOT::Detail::RDF::RColumnReaderBase>
103 return std::make_unique<ROOT::Experimental::Detail::RNTupleColumnReader>(std::string(
name), *
fSources[slot]);
114 std::vector<std::pair<ULong64_t, ULong64_t>> ranges;
117 auto nEntries =
fSources[0]->GetNEntries();
118 const auto chunkSize = nEntries /
fNSlots;
125 ranges.emplace_back(start, end);
128 ranges.back().second += reminder;
136 const auto index = std::distance(
166 for (
unsigned int i = 1; i <
fNSlots; ++i) {
unsigned long long ULong64_t
typedef void((*Func_t)())
static RResult< std::unique_ptr< RFieldBase > > Create(const std::string &fieldName, const std::string &typeName)
Factory method to resurrect a field from the stored on-disk type information.
static void ConnectRecursively(DescriptorId_t fieldId, RPageSource &pageSource, RFieldBase &field)
Connect the field columns and all sub field columns.
Abstract interface to read data from an ntuple.
static std::unique_ptr< RPageSource > Create(std::string_view ntupleName, std::string_view location, const RNTupleReadOptions &options=RNTupleReadOptions())
Guess the concrete derived page source from the file name (location)
A field translates read and write calls from/to underlying columns to/from tree values.
Represents transient storage of simple or complex C++ values.
std::unique_ptr< ROOT::Detail::RDF::RColumnReaderBase > GetColumnReaders(unsigned int, std::string_view, const std::type_info &) final
If the other GetColumnReaders overload returns an empty vector, this overload will be called instead.
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.
std::vector< std::unique_ptr< ROOT::Experimental::Detail::RPageSource > > fSources
Clones of the first source, one for each 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::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::Detail::RPageSource > pageSource)
bool HasColumn(std::string_view colName) const final
Checks if the dataset has a certain column.
void Finalise() final
Convenience method called after concluding an event-loop.
std::vector< std::string > fColumnTypes
void AddFields(const RNTupleDescriptor &desc, DescriptorId_t parentId)
void Initialise() final
Convenience method called before starting an event-loop.
The on-storage meta-data of an ntuple.
RFieldDescriptorRange GetFieldRange(const RFieldDescriptor &fieldDesc) const
std::string GetQualifiedFieldName(DescriptorId_t fieldId) const
Walks up the parents of the field ID and returns a field name of the form a.b.c.d In case of invalid ...
std::vector< void * > Record_t
ROOT's RDataFrame offers a high level interface for analyses of data stored in TTrees,...
RDataFrame MakeNTupleDataFrame(std::string_view ntupleName, std::string_view fileName)
std::uint64_t DescriptorId_t
Distriniguishes elements of the same type within a descriptor, e.g. different fields.
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
TSeq< unsigned int > TSeqU