16#ifndef ROOT7_RNTupleReader
17#define ROOT7_RNTupleReader
37namespace 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,
162 static std::unique_ptr<RNTupleReader>
Open(std::string_view ntupleName, std::string_view storage,
164 static std::unique_ptr<RNTupleReader>
167 static std::unique_ptr<RNTupleReader>
Open(std::unique_ptr<RNTupleModel> model, std::string_view ntupleName,
168 std::string_view storage,
170 static std::unique_ptr<RNTupleReader>
Open(std::unique_ptr<RNTupleModel> model,
const RNTuple &ntuple,
175 static std::unique_ptr<RNTupleReader>
177 std::unique_ptr<RNTupleReader>
Clone()
278 template <
typename T>
284 template <
typename T>
290 template <
typename T>
296 template <
typename T>
307 auto fieldId =
fSource->GetSharedDescriptorGuard()->FindFieldId(fieldName);
309 throw RException(
R__FAIL(
"no field named '" + std::string(fieldName) +
"' in RNTuple '" +
310 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.
The on-storage meta-data of an ntuple.
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()
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.
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, false > GetView(std::string_view fieldName)
Provides access to an individual field that can contain either a scalar value or a collection,...
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.
RNTupleCollectionView GetCollectionView(std::string_view fieldName)
Raises an exception if:
std::unique_ptr< Internal::RPageSource > fSource
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...
RNTupleView< T, true > GetView(DescriptorId_t fieldId, std::shared_ptr< T > objPtr)
void InitPageSource(bool enableMetrics)
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.
RNTupleView< T, true > GetView(std::string_view fieldName, std::shared_ptr< T > objPtr)
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...
RNTupleView< T, false > GetView(DescriptorId_t fieldId)
static std::unique_ptr< RNTupleReader > OpenFriends(std::span< ROpenSpec > ntuples, const RNTupleReadOptions &options=RNTupleReadOptions())
Open RNTuples as one virtual, horizontally combined ntuple.
void ConnectModel(RNTupleModel &model)
An RNTupleView provides read-only access to a single field of the ntuple.
Representation of an RNTuple data set in a ROOT file.
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...
Used to specify the underlying RNTuples in OpenFriends()
RNTupleReadOptions fOptions
ROpenSpec(std::string_view n, std::string_view s)