An RNTuple that is used to read data from storage.
An input ntuple provides data from storage as C++ objects. The ntuple model can be created from the data on storage or it can be imposed by the user. The latter case allows users to read into a specialized ntuple model that covers only a subset of the fields in the ntuple. The ntuple model is used when reading complete entries. Individual fields can be read as well by instantiating a tree view.
Definition at line 90 of file RNTuple.hxx.
Classes | |
class | RIterator |
Public Member Functions | |
RNTupleReader (std::unique_ptr< Detail::RPageSource > source) | |
The model is generated from the ntuple metadata on storage. | |
RNTupleReader (std::unique_ptr< RNTupleModel > model, std::unique_ptr< Detail::RPageSource > source) | |
The user imposes an ntuple model, which must be compatible with the model found in the data on storage. | |
~RNTupleReader () | |
RIterator | begin () |
std::unique_ptr< RNTupleReader > | Clone () |
void | EnableMetrics () |
RIterator | end () |
const RNTupleDescriptor & | GetDescriptor () const |
RNTupleGlobalRange | GetEntryRange () |
const Detail::RNTupleMetrics & | GetMetrics () const |
RNTupleModel * | GetModel () |
NTupleSize_t | GetNEntries () const |
template<typename T > | |
RNTupleView< T > | GetView (std::string_view fieldName) |
Provides access to an individual field that can contain either a scalar value or a collection, e.g. | |
RNTupleViewCollection | GetViewCollection (std::string_view fieldName) |
void | LoadEntry (NTupleSize_t index) |
Analogous to Fill(), fills the default entry of the model. | |
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 | PrintInfo (const ENTupleInfo what=ENTupleInfo::kSummary, std::ostream &output=std::cout) |
Prints a detailed summary of the ntuple, including a list of fields. | |
void | Show (NTupleSize_t index, const ENTupleShowFormat format=ENTupleShowFormat::kCurrentModelJSON, std::ostream &output=std::cout) |
Shows the values of the i-th entry/row, starting with 0 for the first entry. | |
Static Public Member Functions | |
static std::unique_ptr< RNTupleReader > | Open (std::string_view ntupleName, std::string_view storage, const RNTupleReadOptions &options=RNTupleReadOptions()) |
static std::unique_ptr< RNTupleReader > | Open (std::unique_ptr< RNTupleModel > model, std::string_view ntupleName, std::string_view storage, const RNTupleReadOptions &options=RNTupleReadOptions()) |
Private Member Functions | |
void | ConnectModel (const RNTupleModel &model) |
RNTupleReader * | GetDisplayReader () |
void | InitPageSource () |
Private Attributes | |
std::unique_ptr< RNTupleReader > | fDisplayReader |
We use a dedicated on-demand reader for Show() and Scan(). | |
Detail::RNTupleMetrics | fMetrics |
std::unique_ptr< RNTupleModel > | fModel |
Needs to be destructed before fSource. | |
std::unique_ptr< Detail::RPageSource > | fSource |
std::unique_ptr< Detail::RPageStorage::RTaskScheduler > | fUnzipTasks |
Set as the page source's scheduler for parallel page decompression if IMT is on Needs to be destructed after the pages source is destructed (an thus be declared before) | |
#include <ROOT/RNTuple.hxx>
ROOT::Experimental::RNTupleReader::RNTupleReader | ( | std::unique_ptr< RNTupleModel > | model, |
std::unique_ptr< Detail::RPageSource > | source | ||
) |
The user imposes an ntuple model, which must be compatible with the model found in the data on storage.
Definition at line 87 of file RNTuple.cxx.
|
explicit |
The model is generated from the ntuple metadata on storage.
Definition at line 98 of file RNTuple.cxx.
|
default |
|
inline |
Definition at line 194 of file RNTuple.hxx.
|
inline |
Definition at line 147 of file RNTuple.hxx.
|
private |
Definition at line 63 of file RNTuple.cxx.
|
inline |
Definition at line 197 of file RNTuple.hxx.
|
inline |
Definition at line 195 of file RNTuple.hxx.
|
inline |
Definition at line 152 of file RNTuple.hxx.
|
private |
Definition at line 194 of file RNTuple.cxx.
|
inline |
Definition at line 179 of file RNTuple.hxx.
|
inline |
Definition at line 198 of file RNTuple.hxx.
ROOT::Experimental::RNTupleModel * ROOT::Experimental::RNTupleReader::GetModel | ( | ) |
Definition at line 125 of file RNTuple.cxx.
|
inline |
Definition at line 151 of file RNTuple.hxx.
|
inline |
Provides access to an individual field that can contain either a scalar value or a collection, e.g.
GetView<double>("particles.pt") or GetView<std::vector<double>>("particle"). It can as well be the index field of a collection itself, like GetView<NTupleSize_t>("particle")
Definition at line 185 of file RNTuple.hxx.
|
inline |
Definition at line 189 of file RNTuple.hxx.
|
private |
Definition at line 75 of file RNTuple.cxx.
|
inline |
Analogous to Fill(), fills the default entry of the model.
Returns false at the end of the ntuple. On I/O errors, raises an exception.
Definition at line 165 of file RNTuple.hxx.
|
inline |
Fills a user provided entry after checking that the entry has been instantiated from the ntuple model.
Definition at line 167 of file RNTuple.hxx.
|
static |
Definition at line 117 of file RNTuple.cxx.
|
static |
Definition at line 108 of file RNTuple.cxx.
void ROOT::Experimental::RNTupleReader::PrintInfo | ( | const ENTupleInfo | what = ENTupleInfo::kSummary , |
std::ostream & | output = std::cout |
||
) |
Prints a detailed summary of the ntuple, including a list of fields.
Definition at line 134 of file RNTuple.cxx.
void ROOT::Experimental::RNTupleReader::Show | ( | NTupleSize_t | index, |
const ENTupleShowFormat | format = ENTupleShowFormat::kCurrentModelJSON , |
||
std::ostream & | output = std::cout |
||
) |
Shows the values of the i-th entry/row, starting with 0 for the first entry.
By default, prints the output in JSON format. Uses the visitor pattern to traverse through each field of the given entry.
Definition at line 202 of file RNTuple.cxx.
|
private |
We use a dedicated on-demand reader for Show() and Scan().
Printing data uses all the fields from the full model even if the analysis code uses only a subset of fields. The display reader is a clone of the original reader.
Definition at line 102 of file RNTuple.hxx.
|
private |
Definition at line 103 of file RNTuple.hxx.
|
private |
Needs to be destructed before fSource.
Definition at line 98 of file RNTuple.hxx.
|
private |
Definition at line 96 of file RNTuple.hxx.
|
private |
Set as the page source's scheduler for parallel page decompression if IMT is on Needs to be destructed after the pages source is destructed (an thus be declared before)
Definition at line 94 of file RNTuple.hxx.