16#ifndef ROOT7_RNTupleReader
17#define ROOT7_RNTupleReader
40namespace Experimental {
76 std::unique_ptr<Internal::RPageStorage::RTaskScheduler>
fUnzipTasks;
78 std::unique_ptr<Internal::RPageSource>
fSource;
80 std::unique_ptr<ROOT::RNTupleModel>
fModel;
95 RNTupleReader(std::unique_ptr<ROOT::RNTupleModel> model, std::unique_ptr<Internal::RPageSource>
source,
157 static std::unique_ptr<RNTupleReader>
161 static std::unique_ptr<RNTupleReader>
Open(std::unique_ptr<ROOT::RNTupleModel> model, std::string_view
ntupleName,
164 static std::unique_ptr<RNTupleReader>
Open(std::unique_ptr<ROOT::RNTupleModel> model,
const RNTuple &
ntuple,
174 std::unique_ptr<RNTupleReader>
Clone()
284 template <
typename T>
290 template <
typename T>
296 template <
typename T>
302 template <
typename T>
310 template <
typename T>
318 template <
typename T>
326 template <
typename T>
332 template <
typename T>
348 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.
A view for a collection, that can itself generate new ntuple views for its nested fields.
static RNTupleCollectionView Create(ROOT::DescriptorId_t fieldId, Internal::RPageSource *source)
static ROOT::RField< T > CreateField(ROOT::DescriptorId_t fieldId, Internal::RPageSource &pageSource)
RIterator(ROOT::NTupleSize_t index)
ROOT::NTupleSize_t & reference
bool operator!=(const iterator &rh) const
ROOT::NTupleSize_t * pointer
bool operator==(const iterator &rh) const
ROOT::NTupleSize_t difference_type
ROOT::NTupleSize_t value_type
ROOT::NTupleSize_t fIndex
std::forward_iterator_tag iterator_category
Reads RNTuple data from storage.
ROOT::NTupleSize_t GetNEntries() const
RNTupleReader(std::unique_ptr< ROOT::RNTupleModel > model, std::unique_ptr< Internal::RPageSource > source, const ROOT::RNTupleReadOptions &options)
ROOT::DescriptorId_t RetrieveFieldId(std::string_view fieldName) const
RNTupleReader * GetDisplayReader()
std::optional< ROOT::RNTupleDescriptor::RCreateModelOptions > fCreateModelOptions
If not nullopt, these will be used when creating the model.
RNTupleView< T > GetView(std::string_view fieldName, T *rawPtr)
RNTupleView< T > GetView(ROOT::DescriptorId_t fieldId, std::shared_ptr< T > objPtr)
std::unique_ptr< RNTupleReader > Clone()
Detail::RNTupleMetrics fMetrics
std::unique_ptr< RNTupleReader > fDisplayReader
We use a dedicated on-demand reader for Show().
void EnableMetrics()
Enable performance measurements (decompression time, bytes read from storage, etc....
const Detail::RNTupleMetrics & GetMetrics() const
RNTupleDirectAccessView< T > GetDirectAccessView(ROOT::DescriptorId_t fieldId)
RNTupleCollectionView GetCollectionView(ROOT::DescriptorId_t fieldId)
std::optional< ROOT::RNTupleDescriptor > fCachedDescriptor
The RNTuple descriptor in the page source is protected by a read-write lock.
const ROOT::RNTupleModel & GetModel()
RNTupleView< T > GetView(std::string_view fieldName)
Provides access to an individual (sub)field, e.g.
RNTupleView< T > GetView(std::string_view fieldName, std::shared_ptr< T > objPtr)
RNTupleView< T > GetView(ROOT::DescriptorId_t fieldId)
const ROOT::RNTupleDescriptor & GetDescriptor()
Returns a cached copy of the page source descriptor.
RNTupleCollectionView GetCollectionView(std::string_view fieldName)
Raises an exception if:
std::unique_ptr< Internal::RPageSource > fSource
RNTupleDirectAccessView< T > GetDirectAccessView(std::string_view fieldName)
RNTupleView< T > GetView(ROOT::DescriptorId_t fieldId, T *rawPtr)
std::unique_ptr< Internal::RPageStorage::RTaskScheduler > fUnzipTasks
Set as the page source's scheduler for parallel page decompression if implicit multi-threading (IMT) ...
std::unique_ptr< ROOT::RNTupleModel > fModel
Needs to be destructed before fSource.
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)
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< ROOT::REntry > CreateEntry()
void LoadEntry(ROOT::NTupleSize_t index)
Fills the default entry of the model.
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::RNTupleGlobalRange GetEntryRange()
Returns an iterator over the entry indices of the RNTuple.
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...
void ConnectModel(ROOT::RNTupleModel &model)
static std::unique_ptr< ROOT::RFieldBase > CreateField(ROOT::DescriptorId_t fieldId, Internal::RPageSource &pageSource)
The REntry is a collection of values in an ntuple corresponding to a complete row in the data set.
Base class for all ROOT issued exceptions.
The on-storage metadata of an RNTuple.
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 RNTuples.
void SetEnableMetrics(bool val)
Representation of an RNTuple data set in a ROOT file.
ROOT::RNTupleGlobalRange GetFieldRange(const ROOT::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()
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
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()