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;
94 RNTupleReader(std::unique_ptr<RNTupleModel> model, std::unique_ptr<Internal::RPageSource> source,
154 static std::unique_ptr<RNTupleReader>
Open(std::string_view ntupleName, std::string_view storage,
156 static std::unique_ptr<RNTupleReader>
160 static std::unique_ptr<RNTupleReader>
Open(std::unique_ptr<RNTupleModel> model, std::string_view ntupleName,
161 std::string_view storage,
163 static std::unique_ptr<RNTupleReader>
Open(std::unique_ptr<RNTupleModel> model,
const RNTuple &ntuple,
168 std::string_view ntupleName, std::string_view storage,
173 std::unique_ptr<RNTupleReader>
Clone()
275 template <
typename T>
281 template <
typename T>
287 template <
typename T>
293 template <
typename T>
301 template <
typename T>
309 template <
typename T>
317 template <
typename T>
323 template <
typename T>
336 auto fieldId =
fSource->GetSharedDescriptorGuard()->FindFieldId(fieldName);
338 throw RException(
R__FAIL(
"no field named '" + std::string(fieldName) +
"' in RNTuple '" +
339 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)
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::optional< RNTupleDescriptor::RCreateModelOptions > fCreateModelOptions
If not nullopt, these will used when creating the model.
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
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.
Base class for all ROOT issued exceptions.
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...
Modifiers passed to CreateModel