33namespace Experimental {
75 std::unique_ptr<Detail::RPageSource>
fSource;
77 std::unique_ptr<RNTupleModel>
fModel;
84 class RIterator :
public std::iterator<std::forward_iterator_tag, NTupleSize_t> {
102 static std::unique_ptr<RNTupleReader>
Open(std::unique_ptr<RNTupleModel> model,
108 RNTupleReader(std::unique_ptr<RNTupleModel> model, std::unique_ptr<Detail::RPageSource> source);
110 explicit RNTupleReader(std::unique_ptr<Detail::RPageSource> source);
111 std::unique_ptr<RNTupleReader>
Clone() {
return std::make_unique<RNTupleReader>(
fSource->Clone()); }
131 for (
auto& value : *entry) {
132 value.GetField()->Read(index, &value);
141 template <
typename T>
143 auto fieldId =
fSource->GetDescriptor().FindFieldId(fieldName);
147 auto fieldId =
fSource->GetDescriptor().FindFieldId(fieldName);
172 std::unique_ptr<Detail::RPageSink>
fSink;
180 static std::unique_ptr<RNTupleWriter>
Recreate(std::unique_ptr<RNTupleModel> model,
184 RNTupleWriter(std::unique_ptr<RNTupleModel> model, std::unique_ptr<Detail::RPageSink> sink);
194 for (
auto& value : *entry) {
195 value.GetField()->Append(value);
228 for (
auto& treeValue : *entry) {
229 treeValue.GetField()->Append(treeValue);
A collection of Counter objects with a name, a unit, and a description.
A virtual ntuple for collections that can be used to some extent like a real ntuple.
ClusterSize_t * GetOffsetPtr()
RCollectionNTuple(std::unique_ptr< REntry > defaultEntry)
RCollectionNTuple(const RCollectionNTuple &)=delete
std::unique_ptr< REntry > fDefaultEntry
~RCollectionNTuple()=default
RCollectionNTuple & operator=(const RCollectionNTuple &)=delete
The REntry is a collection of values in an ntuple corresponding to a complete row in the data set.
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.
bool operator!=(const iterator &rh) const
bool operator==(const iterator &rh) const
RIterator(NTupleSize_t index)
An RNTuple that is used to read data from storage.
static std::unique_ptr< RNTupleReader > Open(std::unique_ptr< RNTupleModel > model, std::string_view ntupleName, std::string_view storage)
std::unique_ptr< RNTupleReader > Clone()
Detail::RNTupleMetrics fMetrics
void LoadEntry(NTupleSize_t index, REntry *entry)
Fills a user provided entry after checking that the entry has been instantiated from the ntuple model...
const RNTupleDescriptor & GetDescriptor() const
void Show(NTupleSize_t index, const ENTupleFormat format=ENTupleFormat::kJSON, std::ostream &output=std::cout)
Shows the values of the i-th entry/row, starting with 0 for the first entry.
RNTupleView< T > GetView(std::string_view fieldName)
Provides access to an individual field that can contain either a scalar value or a collection,...
NTupleSize_t GetNEntries() const
std::unique_ptr< Detail::RPageSource > fSource
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 storag...
RNTupleGlobalRange GetEntryRange()
RNTupleViewCollection GetViewCollection(std::string_view fieldName)
void LoadEntry(NTupleSize_t index)
Analogous to Fill(), fills the default entry of the 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.
RNTupleModel * GetModel()
std::unique_ptr< RNTupleModel > fModel
Needs to be destructed before fSource.
A view for a collection, that can itself generate new ntuple views for its nested fields.
An RNTupleView provides read-only access to a single field of the ntuple.
Common user-tunable settings for storing ntuples.
An RNTuple that gets filled with entries (data) and writes them to storage.
void Fill(REntry *entry)
Multiple entries can have been instantiated from the tnuple model.
void CommitCluster()
Ensure that the data from the so far seen Fill calls has been written to storage.
RNTupleWriter(std::unique_ptr< RNTupleModel > model, std::unique_ptr< Detail::RPageSink > sink)
NTupleSize_t fLastCommitted
std::unique_ptr< RNTupleModel > fModel
Needs to be destructed before fSink.
static constexpr NTupleSize_t kDefaultClusterSizeEntries
RNTupleWriter(const RNTupleWriter &)=delete
RNTupleWriter & operator=(const RNTupleWriter &)=delete
std::unique_ptr< Detail::RPageSink > fSink
void Fill()
The simplest user interface if the default entry that comes with the ntuple model is used.
static std::unique_ptr< RNTupleWriter > Recreate(std::unique_ptr< RNTupleModel > model, std::string_view ntupleName, std::string_view storage, const RNTupleWriteOptions &options=RNTupleWriteOptions())
NTupleSize_t fClusterSizeEntries
basic_string_view< char > string_view
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.
ENTupleFormat
Listing of the different entry output formats of RNTupleReader::Show()
constexpr NTupleSize_t kInvalidNTupleIndex
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
Wrap the 32bit integer in a struct in order to avoid template specialization clash with std::uint32_t...
static void output(int code)