14#ifndef ROOT_RNTupleReader
15#define ROOT_RNTupleReader
70 std::unique_ptr<Internal::RPageStorage::RTaskScheduler>
fUnzipTasks;
72 std::unique_ptr<Internal::RPageSource>
fSource;
74 std::unique_ptr<ROOT::RNTupleModel>
fModel;
89 RNTupleReader(std::unique_ptr<ROOT::RNTupleModel> model, std::unique_ptr<Internal::RPageSource>
source,
149 static std::unique_ptr<RNTupleReader>
153 static std::unique_ptr<RNTupleReader>
Open(std::unique_ptr<ROOT::RNTupleModel> model, std::string_view
ntupleName,
156 static std::unique_ptr<RNTupleReader>
Open(std::unique_ptr<ROOT::RNTupleModel> model,
const RNTuple &
ntuple,
166 std::unique_ptr<RNTupleReader>
Clone()
270 template <
typename T>
299 template <
typename T>
308 template <
typename T>
333 template <
typename T>
344 template <
typename T>
355 template <
typename T>
389 template <
typename T>
398 template <
typename T>
418 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...
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
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 RNTuple corresponding to a complete row in the data set.
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(ROOT::DescriptorId_t fieldId, ROOT::Internal::RPageSource *source)
The on-storage metadata of an RNTuple.
A view variant that provides direct access to the I/O buffers.
static ROOT::RField< T > CreateField(ROOT::DescriptorId_t fieldId, ROOT::Internal::RPageSource &pageSource)
Used to loop over indexes (entries or collections) between start and end.
The RNTupleModel encapulates the schema of an RNTuple.
Common user-tunable settings for reading RNTuples.
void SetEnableMetrics(bool val)
bool operator!=(const iterator &rh) const
RIterator(ROOT::NTupleSize_t index)
ROOT::NTupleSize_t fIndex
ROOT::NTupleSize_t difference_type
ROOT::NTupleSize_t value_type
ROOT::NTupleSize_t & reference
ROOT::NTupleSize_t * pointer
std::forward_iterator_tag iterator_category
bool operator==(const iterator &rh) const
Reads RNTuple data from storage.
ROOT::RNTupleGlobalRange GetEntryRange()
Returns an iterator over the entry indices of the RNTuple.
ROOT::RNTupleView< T > GetView(ROOT::DescriptorId_t fieldId, T *rawPtr)
Provides access to an individual (sub)field from its on-disk ID, reading its values into rawPtr.
ROOT::RNTupleView< T > GetView(std::string_view fieldName, std::shared_ptr< T > objPtr)
Provides access to an individual (sub)field, reading its values into objPtr.
std::unique_ptr< RNTupleReader > fDisplayReader
We use a dedicated on-demand reader for Show().
ROOT::RNTupleView< T > GetView(ROOT::DescriptorId_t fieldId)
Provides access to an individual (sub)field from its on-disk ID.
std::unique_ptr< ROOT::REntry > CreateEntry()
static std::unique_ptr< RNTupleReader > Open(std::string_view ntupleName, std::string_view storage, const ROOT::RNTupleReadOptions &options=ROOT::RNTupleReadOptions())
Open an RNTuple for reading.
void InitPageSource(bool enableMetrics)
ROOT::RNTupleDirectAccessView< T > GetDirectAccessView(ROOT::DescriptorId_t fieldId)
Provides direct access to the I/O buffers of a mappable (sub)field from its on-disk ID.
std::unique_ptr< Internal::RPageStorage::RTaskScheduler > fUnzipTasks
Set as the page source's scheduler for parallel page decompression if implicit multi-threading (IMT) ...
ROOT::RNTupleView< T > GetView(std::string_view fieldName)
Provides access to an individual (sub)field, e.g.
std::unique_ptr< ROOT::RNTupleModel > fModel
Needs to be destructed before fSource.
const Experimental::Detail::RNTupleMetrics & GetMetrics() const
ROOT::RNTupleCollectionView GetCollectionView(std::string_view fieldName)
Provides access to a collection field, that can itself generate new RNTupleViews for its nested field...
ROOT::RNTupleDirectAccessView< T > GetDirectAccessView(std::string_view fieldName)
Provides direct access to the I/O buffers of a mappable (sub)field.
const ROOT::RNTupleDescriptor & GetDescriptor()
Returns a cached copy of the page source descriptor.
ROOT::RNTupleView< void > GetView(std::string_view fieldName, void *rawPtr, std::string_view typeName)
Provides access to an individual (sub)field, reading its values into rawPtr as the type provided by t...
std::optional< ROOT::RNTupleDescriptor::RCreateModelOptions > fCreateModelOptions
If not nullopt, these will be used when creating the model.
void PrintInfo(const ENTupleInfo what=ENTupleInfo::kSummary, std::ostream &output=std::cout) const
Prints a detailed summary of the RNTuple, including a list of fields.
std::unique_ptr< Internal::RPageSource > fSource
RNTupleReader(std::unique_ptr< ROOT::RNTupleModel > model, std::unique_ptr< Internal::RPageSource > source, const ROOT::RNTupleReadOptions &options)
const ROOT::RNTupleModel & GetModel()
ROOT::RNTupleView< void > GetView(ROOT::DescriptorId_t fieldId, void *rawPtr, std::string_view typeName)
Provides access to an individual (sub)field from its on-disk ID, reading its values into rawPtr as th...
std::optional< ROOT::RNTupleDescriptor > fCachedDescriptor
The RNTuple descriptor in the page source is protected by a read-write lock.
ROOT::RNTupleCollectionView GetCollectionView(ROOT::DescriptorId_t fieldId)
Provides access to a collection field from its on-disk ID, that can itself generate new RNTupleViews ...
std::unique_ptr< RNTupleReader > Clone()
void ConnectModel(ROOT::RNTupleModel &model)
ROOT::NTupleSize_t GetNEntries() const
ROOT::RNTupleView< void > GetView(std::string_view fieldName, void *rawPtr, const std::type_info &ti)
Provides access to an individual (sub)field, reading its values into rawPtr as the type provided by t...
ROOT::DescriptorId_t RetrieveFieldId(std::string_view fieldName) const
void Show(ROOT::NTupleSize_t index, std::ostream &output=std::cout)
Shows the values of the i-th entry/row, starting with 0 for the first entry.
ROOT::RNTupleView< T > GetView(std::string_view fieldName, T *rawPtr)
Provides access to an individual (sub)field, reading its values into rawPtr.
RNTupleReader * GetDisplayReader()
Experimental::Detail::RNTupleMetrics fMetrics
void EnableMetrics()
Enable performance measurements (decompression time, bytes read from storage, etc....
void LoadEntry(ROOT::NTupleSize_t index, ROOT::REntry &entry)
Fills a user provided entry after checking that the entry has been instantiated from the RNTuple mode...
ROOT::RNTupleView< void > GetView(ROOT::DescriptorId_t fieldId, void *rawPtr, const std::type_info &ti)
Provides access to an individual (sub)field from its on-disk ID, reading its values into objPtr as th...
ROOT::RNTupleView< T > GetView(ROOT::DescriptorId_t fieldId, std::shared_ptr< T > objPtr)
Provides access to an individual (sub)field from its on-disk ID, reading its values into objPtr.
void LoadEntry(ROOT::NTupleSize_t index)
Fills the default entry of the model.
static std::unique_ptr< ROOT::RFieldBase > CreateField(ROOT::DescriptorId_t fieldId, Internal::RPageSource &pageSource, std::string_view typeName="")
An RNTupleView for a known type.
Representation of an RNTuple data set in a ROOT file.
ROOT::RNTupleGlobalRange GetFieldRange(const ROOT::RFieldBase &field, const ROOT::Internal::RPageSource &pageSource)
Helper to get the iteration space of the given field that needs to be connected to the given page sou...
std::string GetRenormalizedDemangledTypeName(const std::type_info &ti)
Given a type info ask ROOT meta to demangle it, then renormalize the resulting type name for RNTuple.
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
std::uint64_t DescriptorId_t
Distriniguishes elements of the same type within a descriptor, e.g. different fields.
constexpr NTupleSize_t kInvalidNTupleIndex
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.
constexpr DescriptorId_t kInvalidDescriptorId
Modifiers passed to CreateModel()