28 : fModel(std::move(model))
40 std::unique_ptr<ROOT::Experimental::RNTupleModel> model,
41 std::unique_ptr<ROOT::Experimental::Detail::RPageSource> source)
42 :
ROOT::Experimental::Detail::
RNTuple(std::move(model))
43 , fSource(std::move(source))
46 for (
auto& field : *
fModel->GetRootField()) {
47 field.ConnectColumns(
fSource.get());
54 , fSource(std::move(source))
58 for (
auto& field : *
fModel->GetRootField()) {
59 field.ConnectColumns(
fSource.get());
69 std::unique_ptr<RNTupleModel> model,
74 return std::make_unique<RNTupleReader>(
75 std::move(model), std::make_unique<Detail::RPageSourceRoot>(ntupleName, storage));
82 return std::make_unique<RNTupleReader>(std::make_unique<Detail::RPageSourceRoot>(ntupleName, storage));
86 std::ostringstream os;
87 auto name = fSource->GetDescriptor().GetName();
91 os <<
"****************************** NTUPLE *******************************" << std::endl
92 <<
"* Name: " <<
name << std::setw(57 -
name.length()) <<
"*" << std::endl
93 <<
"* Entries: " << std::setw(10) << fNEntries << std::setw(47) <<
"*" << std::endl
94 <<
"********************************************************************" << std::endl;
107 std::unique_ptr<ROOT::Experimental::RNTupleModel> model,
108 std::unique_ptr<ROOT::Experimental::Detail::RPageSink> sink)
109 :
ROOT::Experimental::Detail::
RNTuple(std::move(model))
110 , fSink(std::move(sink))
111 , fClusterSizeEntries(kDefaultClusterSizeEntries)
120 fSink->CommitDataset();
125 std::unique_ptr<RNTupleModel> model,
134 return std::make_unique<RNTupleWriter>(
135 std::move(model), std::make_unique<Detail::RPageSinkRoot>(ntupleName, settings));
141 if (fNEntries == fLastCommitted)
return;
142 for (
auto& field : *fModel->GetRootField()) {
144 field.CommitCluster();
146 fSink->CommitCluster(fNEntries);
147 fLastCommitted = fNEntries;
155 : fOffset(0), fDefaultEntry(std::move(defaultEntry))
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
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)
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...
std::string GetInfo(const ENTupleInfo what=ENTupleInfo::kSummary)
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)
static std::unique_ptr< RNTupleWriter > Recreate(std::unique_ptr< RNTupleModel > model, std::string_view ntupleName, std::string_view storage)
std::unique_ptr< Detail::RPageSink > fSink
The RNTuple represents a live dataset, whose structure is defined by an RNTupleModel.
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format.
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=ROOT::RCompressionSetting::EDefaults::kUseGeneralPurpose, Int_t netopt=0)
Create / open a file.
basic_string_view< char > string_view
ENTupleInfo
Listing of the different options that can be returned by RNTupleReader::GetInfo()
Namespace for new ROOT classes and functions.