16#ifndef ROOT7_RNTupleReader
17#define ROOT7_RNTupleReader
39namespace Experimental {
75 std::unique_ptr<Internal::RPageStorage::RTaskScheduler>
fUnzipTasks;
77 std::unique_ptr<Internal::RPageSource>
fSource;
79 std::unique_ptr<RNTupleModel>
fModel;
92 RNTupleReader(std::unique_ptr<RNTupleModel> model, std::unique_ptr<Internal::RPageSource> source,
152 static std::unique_ptr<RNTupleReader>
Open(std::string_view ntupleName, std::string_view storage,
154 static std::unique_ptr<RNTupleReader>
157 static std::unique_ptr<RNTupleReader>
Open(std::unique_ptr<RNTupleModel> model, std::string_view ntupleName,
158 std::string_view storage,
160 static std::unique_ptr<RNTupleReader>
Open(std::unique_ptr<RNTupleModel> model,
const RNTuple &ntuple,
165 static std::unique_ptr<RNTupleReader>
167 std::unique_ptr<RNTupleReader>
Clone()
268 template <
typename T>
274 template <
typename T>
280 template <
typename T>
286 template <
typename T>
294 template <
typename T>
302 template <
typename T>
310 template <
typename T>
316 template <
typename T>
329 auto fieldId =
fSource->GetSharedDescriptorGuard()->FindFieldId(fieldName);
331 throw RException(
R__FAIL(
"no field named '" + std::string(fieldName) +
"' in RNTuple '" +
332 fSource->GetSharedDescriptorGuard()->GetName() +
"'"));
#define R__unlikely(expr)
#define R__FAIL(msg)
Short-hand to return an RResult<T> in an error state; the RError is implicitly converted into RResult...
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 r
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t index
A collection of Counter objects with a name, a unit, and a description.
The REntry is a collection of values in an ntuple corresponding to a complete row in the data set.
void Read(NTupleSize_t index)
Base class for all ROOT issued exceptions.
A view for a collection, that can itself generate new ntuple views for its nested fields.
static RNTupleCollectionView Create(DescriptorId_t fieldId, Internal::RPageSource *source)
The on-storage meta-data of an ntuple.
A view variant that provides direct access to the I/O buffers.
static RField< T > CreateField(DescriptorId_t fieldId, Internal::RPageSource &pageSource)
Used to loop over indexes (entries or collections) between start and end.
The RNTupleModel encapulates the schema of an ntuple.
Common user-tunable settings for reading ntuples.
void SetMetricsEnabled(bool enable)
NTupleSize_t difference_type
bool operator!=(const iterator &rh) const
bool operator==(const iterator &rh) const
RIterator(NTupleSize_t index)
std::forward_iterator_tag iterator_category
An RNTuple that is used to read data from storage.
RNTupleReader * GetDisplayReader()
RNTupleView< T > GetView(std::string_view fieldName, T *rawPtr)
DescriptorId_t RetrieveFieldId(std::string_view fieldName) const
void Show(NTupleSize_t index, std::ostream &output=std::cout)
Shows the values of the i-th entry/row, starting with 0 for the first entry.
RNTupleDirectAccessView< T > GetDirectAccessView(DescriptorId_t fieldId)
std::unique_ptr< RNTupleReader > Clone()
Detail::RNTupleMetrics fMetrics
std::unique_ptr< RNTupleReader > fDisplayReader
We use a dedicated on-demand reader for Show() and Scan().
void EnableMetrics()
Enable performance measurements (decompression time, bytes read from storage, etc....
const Detail::RNTupleMetrics & GetMetrics() const
RNTupleView< T > GetView(DescriptorId_t fieldId, std::shared_ptr< T > objPtr)
RNTupleView< T > GetView(std::string_view fieldName)
Provides access to an individual field that can contain either a scalar value or a collection,...
RNTupleView< T > GetView(std::string_view fieldName, std::shared_ptr< T > objPtr)
const RNTupleDescriptor & GetDescriptor()
Returns a cached copy of the page source descriptor.
NTupleSize_t GetNEntries() const
std::unique_ptr< RNTupleDescriptor > fCachedDescriptor
The ntuple descriptor in the page source is protected by a read-write lock.
static std::unique_ptr< RNTupleReader > OpenFriends(std::span< RNTupleOpenSpec > ntuples, const RNTupleReadOptions &options=RNTupleReadOptions())
Open RNTuples as one virtual, horizontally combined ntuple.
RNTupleCollectionView GetCollectionView(std::string_view fieldName)
Raises an exception if:
std::unique_ptr< Internal::RPageSource > fSource
RNTupleDirectAccessView< T > GetDirectAccessView(std::string_view fieldName)
RNTupleCollectionView GetCollectionView(DescriptorId_t fieldId)
const RNTupleModel & GetModel()
static std::unique_ptr< RNTupleReader > Open(std::string_view ntupleName, std::string_view storage, const RNTupleReadOptions &options=RNTupleReadOptions())
Open an RNTuple for reading.
RNTupleGlobalRange GetEntryRange()
Returns an iterator over the entry indices of the RNTuple.
std::unique_ptr< Internal::RPageStorage::RTaskScheduler > fUnzipTasks
Set as the page source's scheduler for parallel page decompression if IMT is on Needs to be destructe...
void InitPageSource(bool enableMetrics)
RNTupleView< T > GetView(DescriptorId_t fieldId)
void PrintInfo(const ENTupleInfo what=ENTupleInfo::kSummary, std::ostream &output=std::cout) const
Prints a detailed summary of the ntuple, including a list of fields.
void LoadEntry(NTupleSize_t index)
Analogous to Fill(), fills the default entry of the model.
std::unique_ptr< RNTupleModel > fModel
Needs to be destructed before fSource.
void LoadEntry(NTupleSize_t index, REntry &entry)
Fills a user provided entry after checking that the entry has been instantiated from the ntuple model...
void ConnectModel(RNTupleModel &model)
RNTupleView< T > GetView(DescriptorId_t fieldId, T *rawPtr)
static std::unique_ptr< RFieldBase > CreateField(DescriptorId_t fieldId, Internal::RPageSource &pageSource)
An RNTupleView for a known type.
Representation of an RNTuple data set in a ROOT file.
RNTupleGlobalRange GetFieldRange(const RFieldBase &field, const RPageSource &pageSource)
Helper to get the iteration space of the given field that needs to be connected to the given page sou...
ENTupleInfo
Listing of the different options that can be printed by RNTupleReader::GetInfo()
std::uint64_t NTupleSize_t
Integer type long enough to hold the maximum number of entries in a column.
std::uint64_t DescriptorId_t
Distriniguishes elements of the same type within a descriptor, e.g. different fields.
constexpr NTupleSize_t kInvalidNTupleIndex
constexpr DescriptorId_t kInvalidDescriptorId
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...