27#include <unordered_map>
35 : fModel(std::move(model))
47 std::unordered_map<const Detail::RFieldBase *, DescriptorId_t> fieldPtr2Id;
48 fieldPtr2Id[fModel->GetRootField()] = fSource->GetDescriptor().FindFieldId(
"",
kInvalidDescriptorId);
49 for (
auto &field : *fModel->GetRootField()) {
50 auto parentId = fieldPtr2Id[field.GetParent()];
51 auto fieldId = fSource->GetDescriptor().FindFieldId(field.GetName(), parentId);
53 fieldPtr2Id[&field] = fieldId;
59 std::unique_ptr<ROOT::Experimental::RNTupleModel> model,
60 std::unique_ptr<ROOT::Experimental::Detail::RPageSource> source)
61 :
ROOT::Experimental::Detail::
RNTuple(std::move(model))
62 , fSource(std::move(source))
63 , fMetrics(
"RNTupleReader")
73 , fSource(std::move(source))
74 , fMetrics(
"RNTupleReader")
90 std::unique_ptr<RNTupleModel> model,
107 char frameSymbol =
'*';
115 std::string
name = fSource->GetDescriptor().GetName();
122 for (
int i = 0; i < (
width/2 +
width%2 - 4); ++i)
125 for (
int i = 0; i < (
width/2 - 4); ++i)
131 GetModel()->GetRootField()->TraverseVisitor(prepVisitor);
137 GetModel()->GetRootField()->TraverseVisitor(printVisitor);
139 for (
int i = 0; i <
width; ++i)
144 fSource->GetDescriptor().PrintInfo(
output);
157 std::unique_ptr<ROOT::Experimental::RNTupleModel> model,
158 std::unique_ptr<ROOT::Experimental::Detail::RPageSink> sink)
159 :
ROOT::Experimental::Detail::
RNTuple(std::move(model))
160 , fSink(std::move(sink))
161 , fClusterSizeEntries(kDefaultClusterSizeEntries)
170 fSink->CommitDataset();
176 std::unique_ptr<RNTupleModel> model,
187 if (fNEntries == fLastCommitted)
return;
188 for (
auto& field : *fModel->GetRootField()) {
190 field.CommitCluster();
192 fSink->CommitCluster(fNEntries);
193 fLastCommitted = fNEntries;
201 : fOffset(0), fDefaultEntry(std::move(defaultEntry))
include TDocParser_001 C image html pict1_TDocParser_001 png width
static void Connect(DescriptorId_t fieldId, RPageStorage &pageStorage, RFieldBase &field)
void ObserveMetrics(RNTupleMetrics &observee)
NTupleSize_t fNEntries
The number of entries is constant for reading and reflects the sum of Fill() operations when writing.
RNTuple(std::unique_ptr< RNTupleModel > model)
Only the derived RNTupleReader and RNTupleWriter can be instantiated.
std::unique_ptr< RNTupleModel > fModel
static std::unique_ptr< RPageSink > Create(std::string_view ntupleName, std::string_view location, const RNTupleWriteOptions &options=RNTupleWriteOptions())
Guess the concrete derived page source from the file name (location)
static std::unique_ptr< RPageSource > Create(std::string_view ntupleName, std::string_view location, const RNTupleReadOptions &options=RNTupleReadOptions())
Guess the concrete derived page source from the file name (location)
RCollectionNTuple(std::unique_ptr< REntry > defaultEntry)
static std::unique_ptr< RNTupleReader > Open(std::unique_ptr< RNTupleModel > model, std::string_view ntupleName, std::string_view storage)
Detail::RNTupleMetrics fMetrics
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...
void PrintInfo(const ENTupleInfo what=ENTupleInfo::kSummary, std::ostream &output=std::cout)
Prints a detailed summary of the ntuple, including a list of fields.
Common user-tunable settings for storing ntuples.
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)
std::unique_ptr< Detail::RPageSink > fSink
static std::unique_ptr< RNTupleWriter > Recreate(std::unique_ptr< RNTupleModel > model, std::string_view ntupleName, std::string_view storage, const RNTupleWriteOptions &options=RNTupleWriteOptions())
The RNTuple represents a live dataset, whose structure is defined by an RNTupleModel.
Visitor used for a prepare run to collect information needed by another visitor class.
int GetDeepestLevel() const
Contains settings for printing and prints a summary of an RField instance.
void SetDeepestLevel(int d)
void SetFrameSymbol(char s)
basic_string_view< char > string_view
ENTupleInfo
Listing of the different options that can be returned by RNTupleReader::GetInfo()
constexpr DescriptorId_t kInvalidDescriptorId
static void output(int code)