Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RNTupleDS.hxx
Go to the documentation of this file.
1/// \file RNTupleDS.hxx
2/// \author Jakob Blomer <jblomer@cern.ch>
3/// \author Enrico Guiraud <enrico.guiraud@cern.ch>
4/// \date 2018-10-04
5/// \warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback
6/// is welcome!
7
8/*************************************************************************
9 * Copyright (C) 1995-2025, Rene Brun and Fons Rademakers. *
10 * All rights reserved. *
11 * *
12 * For the licensing terms see $ROOTSYS/LICENSE. *
13 * For the list of contributors see $ROOTSYS/README/CREDITS. *
14 *************************************************************************/
15
16#ifndef ROOT_RNTupleDS
17#define ROOT_RNTupleDS
18
19#include <ROOT/RDataSource.hxx>
21#include <ROOT/RNTupleTypes.hxx>
22#include <string_view>
23
24#include <condition_variable>
25#include <cstdint>
26#include <memory>
27#include <mutex>
28#include <optional>
29#include <string>
30#include <thread>
31#include <vector>
32#include <unordered_map>
33
34// Follow RDF namespace convention
35namespace ROOT {
36class RDataFrame;
37}
38
39namespace ROOT::Detail::RDF {
40class RLoopManager;
41}
42
43namespace ROOT::Internal {
44class RSlotStack;
45}
46
47namespace ROOT {
48class RFieldBase;
49class RDataFrame;
50class RNTuple;
51} // namespace ROOT
52namespace ROOT::Detail::RDF {
53class RNodeBase;
54}
55namespace ROOT::RDF {
56template <typename T>
57class RInterface;
58}
59namespace ROOT::Internal::RDF {
60class RNTupleColumnReader;
61std::vector<std::pair<std::uint64_t, std::uint64_t>>
63} // namespace ROOT::Internal::RDF
64namespace ROOT::Internal {
65class RPageSource;
66}
67
68namespace ROOT::Internal::RDF {
69/**
70 * \brief Internal overload of the function that allows passing a range of entries
71 *
72 * The event range will be respected when processing this RNTuple. It is assumed
73 * that processing happens within one thread only.
74 */
75ROOT::RDataFrame FromRNTuple(std::string_view ntupleName, const std::vector<std::string> &fileNames,
76 const std::pair<ULong64_t, ULong64_t> &range);
77/**
78 * \brief Retrieves the cluster boundaries and the number of entries for the input RNTuple
79 *
80 * \param[in] ntupleName The name of the RNTuple dataset
81 * \param[in] location The location of the RNTuple dataset (e.g. a path to a file)
82 *
83 * \note This function is a helper for the Python side to avoid having to deal
84 * with the shared descriptor guard.
85 */
86std::pair<std::vector<ROOT::Internal::RNTupleClusterBoundaries>, ROOT::NTupleSize_t>
87GetClustersAndEntries(std::string_view ntupleName, std::string_view location);
88} // namespace ROOT::Internal::RDF
89
90#ifdef R__USE_IMT
91namespace ROOT {
92class TThreadExecutor;
93}
95class RAbstractTBBRangeImpl;
96}
97#endif
98
99namespace ROOT::RDF {
100class RNTupleDS final : public ROOT::RDF::RDataSource {
102
103 /// \brief Page source information consumed while running the computation graph
104 ///
105 /// REntryRangeDS objects are populated differently in single-thread and multi-thread mode.
106 ///
107 /// In single-thread mode, the PrepareNextRanges() method populates the fNextRanges list with REntryRangeDS records.
108 /// The GetEntryRanges() swaps fNextRanges and fCurrentRanges and uses the list of REntryRangeDS records to return
109 /// the list of ranges ready to use by the RDF loop manager.
110 ///
111 /// In multi-thread mode, the task being executed by a thread injects an REntryRangeDS into the fActiveRangesPerSlot
112 /// member, which is then retrievable for relevant operations e.g. connecting the column readers to the page source
113 /// and populating the sample information.
115 /// The page source. It can be shared between this object and other multithreaded tasks.
116 std::shared_ptr<ROOT::Internal::RPageSource> fSource;
117 ULong64_t fFirstEntry = 0; ///< First entry index in fSource
118 /// End entry index in fSource, e.g. the number of entries in the range is fLastEntry - fFirstEntry
120
121 // TODO(vpadulan): Having to have the entry offset is ugly, currently it's necessary because the implementation of
122 // RNTupleColumnReader::GetImpl interprets the 'entry' input argument as a "global" entry w.r.t. some offset. For
123 // lack of a better communication strategy at the moment, we carry this offset over with REntryRangeDS as it is
124 // also used by the RLoopManager e.g. to decide the values for rdfentry_ for a given slot
125
126 ULong64_t fEntryOffset = 0; /// Offset of both first and last entries w.r.t. the page source
127 std::string_view fFileName; ///< Storage location of the current RNTuple
128 };
129
130 /// A clone of the first pages source's descriptor.
132
133 /// The data source may be constructed with an ntuple name and a list of files
134 std::string fNTupleName;
135 std::vector<std::string> fFileNames;
136 /// The staging area is relevant for chains of files, i.e. when fFileNames is not empty. In this case,
137 /// files are opened in the background in batches of size `fNSlots` and kept in the staging area.
138 /// The first file (chains or no chains) is always opened on construction in order to process the schema.
139 /// For all subsequent files, the corresponding page sources in the staging area only executed `LoadStructure()`,
140 /// i.e. they should have a compressed buffer of the meta-data available.
141 /// Concretely:
142 /// 1. We open the first file on construction to read the schema and then move the corresponding page source
143 /// in the staging area.
144 /// 2. On `Initialize()`, we start the I/O background thread, which in turn opens the first batch of files.
145 /// 3. At the beginning of `GetEntryRanges()`, we
146 /// a) wait for the I/O thread to finish,
147 /// b) call `PrepareNextRanges()` in the main thread to move the page sources from the staging area
148 /// into `fNextRanges`; this will also call `Attach()` on the page sources (i.e., deserialize the meta-data),
149 /// and
150 /// c) trigger staging of the next batch of files in the I/O background thread.
151 /// 4. On `Finalize()`, the I/O background thread is stopped.
152 std::vector<std::shared_ptr<ROOT::Internal::RPageSource>> fStagingArea;
153 std::size_t fNextFileIndex = 0; ///< Index into fFileNames to the next file to process
154
155 /// We prepare a prototype field for every column. If a column reader is actually requested
156 /// in GetColumnReaders(), we move a clone of the field into a new column reader for RDataFrame.
157 /// Only the clone connects to the backing page store and acquires I/O resources.
158 /// The field IDs are set in the context of the first source and used as keys in fFieldId2QualifiedName.
159 std::vector<std::unique_ptr<ROOT::RFieldBase>> fProtoFields;
160 /// Columns may be requested with types other than with which they were initially added as proto fields. For example,
161 /// a column with a `ROOT::RVec<float>` proto field may instead be requested as a `std::vector<float>`. In case this
162 /// happens, we create an alternative proto field and store it here, with the original index in `fProtoFields` as
163 /// key. A single column can have more than one alternative proto fields.
164 std::unordered_map<std::size_t, std::vector<std::unique_ptr<ROOT::RFieldBase>>> fAlternativeProtoFields;
165 /// Connects the IDs of active proto fields and their subfields to their fully qualified name (a.b.c.d).
166 /// This enables the column reader to rewire the field IDs when the file changes (chain),
167 /// using the fully qualified name as a search key in the descriptor of the other page sources.
168 std::unordered_map<ROOT::DescriptorId_t, std::string> fFieldId2QualifiedName;
169 std::vector<std::string> fColumnNames;
170 std::vector<std::string> fColumnTypes;
171 std::vector<std::string> fTopLevelFieldNames;
172 /// List of column readers returned by GetColumnReaders() organized by slot. Used to reconnect readers
173 /// to new page sources when the files in the chain change.
174 std::vector<std::vector<ROOT::Internal::RDF::RNTupleColumnReader *>> fActiveColumnReaders;
175
176 ULong64_t fSeenEntriesNoGlobalRange = 0; ///< The number of entries seen so far in GetEntryRanges()
177
178 std::vector<REntryRangeDS> fCurrentRanges; ///< Basis for the ranges returned by the last GetEntryRanges() call
179 std::vector<REntryRangeDS> fNextRanges; ///< Basis for the ranges populated by the PrepareNextRanges() call
180
181 /// The page source and entry window seen by an active thread task in multi-threaded runs
182 std::vector<REntryRangeDS> fActiveRangesPerSlot;
183 /// Maps the first entries from the ranges of the last GetEntryRanges() call to their corresponding index in
184 /// the fCurrentRanges vectors. This is necessary because the returned ranges get distributed arbitrarily
185 /// onto slots. In the InitSlot method, the column readers use this map to find the correct range to connect to.
186 std::unordered_map<ULong64_t, std::size_t> fFirstEntry2RangeIdx;
187 // Keep track of the scheduled entries - necessary for processing of GlobalEntries
188 std::vector<std::pair<ULong64_t, ULong64_t>> fOriginalRanges;
189
190 /// The background thread that runs StageNextSources()
191 std::thread fThreadStaging;
192 /// Protects the shared state between the main thread and the I/O thread
193 std::mutex fMutexStaging;
194 /// Signal for the state information of fIsReadyForStaging and fHasNextSources
195 std::condition_variable fCvStaging;
196 /// Is true when the staging thread should start working
197 bool fIsReadyForStaging = false;
198 /// Is true when the staging thread has populated the next batch of files to fStagingArea
199 bool fHasNextSources = false;
200 /// Is true when the I/O thread should quit
202
203 /// \brief Holds useful information about fields added to the RNTupleDS
204 struct RFieldInfo {
206 std::size_t fNRepetitions;
207 // Enable `std::vector::emplace_back` for this type
208 RFieldInfo(ROOT::DescriptorId_t fieldId, std::size_t nRepetitions)
209 : fFieldId(fieldId), fNRepetitions(nRepetitions)
210 {
211 }
212 };
213
214 /// Provides the RDF column "colName" given the field identified by fieldID. For records and collections,
215 /// AddField recurses into the sub fields. The fieldInfos argument is a list of objects holding info
216 /// about the fields of the outer collection(s) (w.r.t. fieldId). For instance, if fieldId refers to an
217 /// `std::vector<Jet>`, with
218 /// ~~~{.cpp}
219 /// struct Jet {
220 /// float pt;
221 /// float eta;
222 /// };
223 /// ~~~
224 /// AddField will recurse into `Jet.pt` and `Jet.eta` and provide the two inner fields as `ROOT::VecOps::RVec<float>`
225 /// each.
226 ///
227 /// In case the field is a collection of type `ROOT::VecOps::RVec`, `std::vector` or `std::array`, its corresponding
228 /// column is added as a `ROOT::VecOps::RVec`. Otherwise, the collection field's on-disk type is used. Note, however,
229 /// that inner record members of such collections will still be added as `ROOT::VecOps::RVec` (e.g., `std::set<Jet>
230 /// will be added as a `std::set`, but `Jet.[pt|eta] will be added as `ROOT::VecOps::RVec<float>).
231 void AddField(const ROOT::RNTupleDescriptor &desc, std::string_view colName, ROOT::DescriptorId_t fieldId,
232 std::vector<RFieldInfo> fieldInfos, bool convertToRVec = true);
233
234 /// The main function of the fThreadStaging background thread
235 void ExecStaging();
236 /// Starting from `fNextFileIndex`, opens the next `fNSlots` files. Calls `LoadStructure()` on the opened files.
237 /// The very first file is already available from the constructor.
238 void StageNextSources();
239 /// Populates fNextRanges with the next set of entry ranges. Moves files from the staging area as necessary
240 /// and aligns ranges with cluster boundaries for scheduling the tail of files.
241 /// Upon return, the fNextRanges list is ordered. It has usually fNSlots elements; fewer if there
242 /// is not enough work to give at least one cluster to every slot.
243 void PrepareNextRanges();
244
245 explicit RNTupleDS(std::unique_ptr<ROOT::Internal::RPageSource> pageSource);
246
247 ROOT::RFieldBase *GetFieldWithTypeChecks(std::string_view fieldName, const std::type_info &tid);
248
249 friend ROOT::RDataFrame ROOT::Internal::RDF::FromRNTuple(std::string_view ntupleName,
250 const std::vector<std::string> &fileNames,
251 const std::pair<ULong64_t, ULong64_t> &range);
252
253 // This function needs to acess private members fNTupleName and fFileNames
254 friend std::vector<std::pair<std::uint64_t, std::uint64_t>> ROOT::Internal::RDF::GetDatasetGlobalClusterBoundaries(
256
257 explicit RNTupleDS(std::string_view ntupleName, const std::vector<std::string> &fileNames,
258 const std::pair<ULong64_t, ULong64_t> &range);
259#ifdef R__USE_IMT
260
261 // Helpers for the MT scheduling
262
263 void InsertActiveEntryRange(unsigned int slot, std::string_view fileName,
264 std::shared_ptr<ROOT::Internal::RPageSource> pageSource, std::uint64_t beginEntry,
265 std::uint64_t endEntry, std::uint64_t offset);
266 void ParallelForBody(std::shared_ptr<ROOT::Internal::RPageSource> pageSource,
268 ROOT::Detail::RDF::RLoopManager &lm, std::string_view fileName,
269 ROOT::Internal::RSlotStack &slotStack, std::atomic<ULong64_t> &processedEntries,
270 ULong64_t columnReaderOffset);
271 void ScheduleTaskForPageSource(ROOT::TThreadExecutor &pool, std::unique_ptr<ROOT::Internal::RPageSource> pageSource,
272 std::string_view fileName,
273 std::span<const ROOT::Internal::RNTupleClusterBoundaries> clusterBoundaries,
274 std::uint64_t nEntries, ROOT::Detail::RDF::RLoopManager &lm,
275 ROOT::Internal::RSlotStack &slotStack, std::atomic<ULong64_t> &processedEntries,
276 std::atomic<ULong64_t> &globalEntries);
277 std::vector<std::uint64_t> ComputeGlobalEntryOffsets(ROOT::TThreadExecutor &pool) const;
278 void ScheduleTasksForFileWithGlobalOffset(std::size_t fileIdx, const std::vector<std::uint64_t> &globalFileOffsets,
281 std::atomic<ULong64_t> &processedEntries,
282 std::atomic<ULong64_t> &globalEntries);
284 ROOT::Internal::RSlotStack &slotStack, std::atomic<ULong64_t> &processedEntries,
285 std::atomic<ULong64_t> &globalEntries);
287
288#endif
289public:
290 RNTupleDS(std::string_view ntupleName, std::string_view fileName);
291 RNTupleDS(std::string_view ntupleName, const std::vector<std::string> &fileNames);
292 // Rule of five
293 RNTupleDS(const RNTupleDS &) = delete;
294 RNTupleDS &operator=(const RNTupleDS &) = delete;
295 RNTupleDS(RNTupleDS &&) = delete;
297 ~RNTupleDS() final;
298
299 void SetNSlots(unsigned int nSlots) final;
300 std::size_t GetNFiles() const final { return fFileNames.empty() ? 1 : fFileNames.size(); }
301 const std::vector<std::string> &GetColumnNames() const final { return fColumnNames; }
302 const std::vector<std::string> &GetTopLevelFieldNames() const final { return fTopLevelFieldNames; }
303 bool HasColumn(std::string_view colName) const final;
304 std::string GetTypeName(std::string_view colName) const final;
305 std::vector<std::pair<ULong64_t, ULong64_t>> GetEntryRanges() final;
306 std::string GetLabel() final { return "RNTupleDS"; }
307
308 void Initialize() final;
309 void InitSlot(unsigned int slot, ULong64_t firstEntry) final;
310 void FinalizeSlot(unsigned int slot) final;
311 void Finalize() final;
312
313 std::unique_ptr<ROOT::Detail::RDF::RColumnReaderBase>
314 GetColumnReaders(unsigned int /*slot*/, std::string_view /*name*/, const std::type_info &) final;
315
316 ROOT::RDF::RSampleInfo
317 CreateSampleInfo(unsigned int,
318 const std::unordered_map<std::string, ROOT::RDF::Experimental::RSample *> &) const final;
319
320 // Old API, unused
321 bool SetEntry(unsigned int, ULong64_t) final { return true; }
322
323protected:
324 Record_t GetColumnReadersImpl(std::string_view name, const std::type_info &) final;
325};
326} // namespace ROOT::RDF
327
328namespace ROOT::RDF {
329RDataFrame FromRNTuple(std::string_view ntupleName, std::string_view fileName);
330RDataFrame FromRNTuple(std::string_view ntupleName, const std::vector<std::string> &fileNames);
331} // namespace ROOT::RDF
332
333#endif
unsigned long long ULong64_t
Portable unsigned long integer 8 bytes.
Definition RtypesCore.h:85
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h offset
char name[80]
Definition TGX11.cxx:142
The head node of a RDF computation graph.
Abstract implementation of the oneAPI Range requirements.
Pure virtual base class for all column reader types.
Every RDF column is represented by exactly one RNTuple field.
Definition RNTupleDS.cxx:65
Abstract interface to read data from an ntuple.
A thread-safe list of N indexes (0 to size - 1).
RDataSource defines an API that RDataFrame can use to read arbitrary data formats.
friend ROOT::RDF::RSampleInfo ROOT::Internal::RDF::CreateSampleInfo(const ROOT::RDF::RDataSource &, unsigned int, const std::unordered_map< std::string, ROOT::RDF::Experimental::RSample * > &)
std::vector< void * > Record_t
friend void ROOT::Internal::RDF::ProcessMT(RDataSource &, ROOT::Detail::RDF::RLoopManager &)
The public interface to the RDataFrame federation of classes.
The RDataSource implementation for RNTuple.
bool fHasNextSources
Is true when the staging thread has populated the next batch of files to fStagingArea.
const std::vector< std::string > & GetColumnNames() const final
Returns a reference to the collection of the dataset's column names.
void AddField(const ROOT::RNTupleDescriptor &desc, std::string_view colName, ROOT::DescriptorId_t fieldId, std::vector< RFieldInfo > fieldInfos, bool convertToRVec=true)
Provides the RDF column "colName" given the field identified by fieldID.
std::vector< std::pair< ULong64_t, ULong64_t > > GetEntryRanges() final
Return ranges of entries to distribute to tasks.
std::size_t GetNFiles() const final
Returns the number of files from which the dataset is constructed.
void ScheduleTaskForPageSource(ROOT::TThreadExecutor &pool, std::unique_ptr< ROOT::Internal::RPageSource > pageSource, std::string_view fileName, std::span< const ROOT::Internal::RNTupleClusterBoundaries > clusterBoundaries, std::uint64_t nEntries, ROOT::Detail::RDF::RLoopManager &lm, ROOT::Internal::RSlotStack &slotStack, std::atomic< ULong64_t > &processedEntries, std::atomic< ULong64_t > &globalEntries)
Call parallel_for to schedule a splittable task for a page source.
void InsertActiveEntryRange(unsigned int slot, std::string_view fileName, std::shared_ptr< ROOT::Internal::RPageSource > pageSource, std::uint64_t beginEntry, std::uint64_t endEntry, std::uint64_t offset)
std::vector< REntryRangeDS > fNextRanges
Basis for the ranges populated by the PrepareNextRanges() call.
std::unordered_map< ULong64_t, std::size_t > fFirstEntry2RangeIdx
Maps the first entries from the ranges of the last GetEntryRanges() call to their corresponding index...
void ExecStaging()
The main function of the fThreadStaging background thread.
bool fStagingThreadShouldTerminate
Is true when the I/O thread should quit.
RNTupleDS(RNTupleDS &&)=delete
std::vector< std::vector< ROOT::Internal::RDF::RNTupleColumnReader * > > fActiveColumnReaders
List of column readers returned by GetColumnReaders() organized by slot.
void ScheduleTasksForFile(std::size_t fileIdx, ROOT::TThreadExecutor &pool, ROOT::Detail::RDF::RLoopManager &lm, ROOT::Internal::RSlotStack &slotStack, std::atomic< ULong64_t > &processedEntries, std::atomic< ULong64_t > &globalEntries)
Launch the task(s) for the input file index.
std::vector< std::pair< ULong64_t, ULong64_t > > fOriginalRanges
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.
std::vector< std::unique_ptr< ROOT::RFieldBase > > fProtoFields
We prepare a prototype field for every column.
void SetNSlots(unsigned int nSlots) final
Inform RDataSource of the number of processing slots (i.e.
ROOT::RFieldBase * GetFieldWithTypeChecks(std::string_view fieldName, const std::type_info &tid)
RNTupleDS & operator=(const RNTupleDS &)=delete
std::vector< std::string > fFileNames
bool fIsReadyForStaging
Is true when the staging thread should start working.
void InitSlot(unsigned int slot, ULong64_t firstEntry) final
Convenience method called at the start of the data processing associated to a slot.
ROOT::RNTupleDescriptor fPrincipalDescriptor
A clone of the first pages source's descriptor.
ULong64_t fSeenEntriesNoGlobalRange
The number of entries seen so far in GetEntryRanges()
std::vector< REntryRangeDS > fCurrentRanges
Basis for the ranges returned by the last GetEntryRanges() call.
std::vector< std::string > fTopLevelFieldNames
RNTupleDS(std::unique_ptr< ROOT::Internal::RPageSource > pageSource)
void ParallelForBody(std::shared_ptr< ROOT::Internal::RPageSource > pageSource, const ROOT::Internal::IMTUtils::RAbstractTBBRangeImpl &rangeImpl, ROOT::Detail::RDF::RLoopManager &lm, std::string_view fileName, ROOT::Internal::RSlotStack &slotStack, std::atomic< ULong64_t > &processedEntries, ULong64_t columnReaderOffset)
Apply the computation graph to an input range.
std::string GetTypeName(std::string_view colName) const final
Type of a column as a string, e.g.
std::size_t fNextFileIndex
Index into fFileNames to the next file to process.
const std::vector< std::string > & GetTopLevelFieldNames() const final
std::unordered_map< ROOT::DescriptorId_t, std::string > fFieldId2QualifiedName
Connects the IDs of active proto fields and their subfields to their fully qualified name (a....
std::string fNTupleName
The data source may be constructed with an ntuple name and a list of files.
void ScheduleTasksForFileWithGlobalOffset(std::size_t fileIdx, const std::vector< std::uint64_t > &globalFileOffsets, ROOT::TThreadExecutor &pool, ROOT::Detail::RDF::RLoopManager &lm, ROOT::Internal::RSlotStack &slotStack, std::atomic< ULong64_t > &processedEntries, std::atomic< ULong64_t > &globalEntries)
Launch the task(s) for the input file index, taking into account dataset global entry offsets.
void PrepareNextRanges()
Populates fNextRanges with the next set of entry ranges.
void StageNextSources()
Starting from fNextFileIndex, opens the next fNSlots files.
std::condition_variable fCvStaging
Signal for the state information of fIsReadyForStaging and fHasNextSources.
RNTupleDS(const RNTupleDS &)=delete
std::vector< std::uint64_t > ComputeGlobalEntryOffsets(ROOT::TThreadExecutor &pool) const
Computes global entry offsets for the dataset.
std::vector< REntryRangeDS > fActiveRangesPerSlot
The page source and entry window seen by an active thread task in multi-threaded runs.
void Finalize() final
Convenience method called after concluding an event-loop.
std::string GetLabel() final
Return a string representation of the datasource type.
RNTupleDS & operator=(RNTupleDS &&)=delete
std::thread fThreadStaging
The background thread that runs StageNextSources()
std::mutex fMutexStaging
Protects the shared state between the main thread and the I/O thread.
std::unordered_map< std::size_t, std::vector< std::unique_ptr< ROOT::RFieldBase > > > fAlternativeProtoFields
Columns may be requested with types other than with which they were initially added as proto fields.
std::vector< std::shared_ptr< ROOT::Internal::RPageSource > > fStagingArea
The staging area is relevant for chains of files, i.e.
bool SetEntry(unsigned int, ULong64_t) final
Advance the "cursors" returned by GetColumnReaders to the selected entry for a particular slot.
std::vector< std::string > fColumnTypes
void Initialize() final
Convenience method called before starting an event-loop.
std::vector< std::string > fColumnNames
bool HasColumn(std::string_view colName) const final
Checks if the dataset has a certain column.
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
void FinalizeSlot(unsigned int slot) final
Convenience method called at the end of the data processing associated to a slot.
This type represents a sample identifier, to be used in conjunction with RDataFrame features such as ...
ROOT's RDataFrame offers a modern, high-level interface for analysis of data stored in TTree ,...
A field translates read and write calls from/to underlying columns to/from tree values.
The on-storage metadata of an RNTuple.
This class provides a simple interface to execute the same task multiple times in parallel threads,...
ROOT::RDataFrame FromRNTuple(std::string_view ntupleName, const std::vector< std::string > &fileNames, const std::pair< ULong64_t, ULong64_t > &range)
Internal overload of the function that allows passing a range of entries.
std::pair< std::vector< ROOT::Internal::RNTupleClusterBoundaries >, ROOT::NTupleSize_t > GetClustersAndEntries(std::string_view ntupleName, std::string_view location)
Retrieves the cluster boundaries and the number of entries for the input RNTuple.
std::vector< std::pair< std::uint64_t, std::uint64_t > > GetDatasetGlobalClusterBoundaries(const RNode &node)
Retrieve the cluster boundaries for each cluster in the dataset, across files, with a global offset.
std::uint64_t DescriptorId_t
Distriniguishes elements of the same type within a descriptor, e.g. different fields.
std::uint64_t NTupleSize_t
Integer type long enough to hold the maximum number of entries in a column.
Page source information consumed while running the computation graph.
std::string_view fFileName
Offset of both first and last entries w.r.t. the page source.
ULong64_t fLastEntry
End entry index in fSource, e.g. the number of entries in the range is fLastEntry - fFirstEntry.
ULong64_t fFirstEntry
First entry index in fSource.
std::shared_ptr< ROOT::Internal::RPageSource > fSource
The page source. It can be shared between this object and other multithreaded tasks.
Holds useful information about fields added to the RNTupleDS.
RFieldInfo(ROOT::DescriptorId_t fieldId, std::size_t nRepetitions)
ROOT::DescriptorId_t fFieldId