20std::unique_ptr<ROOT::Experimental::RNTupleProcessor>
22 std::unique_ptr<RNTupleModel> model)
30 std::unique_ptr<RNTupleModel> model)
44 model =
fPageSource->GetSharedDescriptorGuard()->CreateModel();
47 fEntry = model->CreateEntry();
50 auto &field =
value.GetField();
51 auto token =
fEntry->GetToken(field.GetFieldName());
56 if (!model->IsBare()) {
57 auto valuePtr = model->GetDefaultEntry().GetPtr<
void>(token);
58 fEntry->BindValue(token, valuePtr);
61 fFieldContexts.emplace_back(field.Clone(field.GetFieldName()), token);
69 for (
auto &fieldContext : fFieldContexts) {
70 fieldContext.ResetConcreteField();
73 fPageSource->Attach();
75 return fPageSource->GetNEntries();
80 auto desc = fPageSource->GetSharedDescriptorGuard();
82 for (
auto &fieldContext : fFieldContexts) {
83 auto fieldId = desc->FindFieldId(fieldContext.GetProtoField().GetFieldName());
86 R__FAIL(
"field \"" + fieldContext.GetProtoField().GetFieldName() +
"\" not found in current RNTuple"));
89 fieldContext.SetConcreteField();
90 fieldContext.fConcreteField->SetOnDiskId(desc->FindFieldId(fieldContext.GetProtoField().GetFieldName()));
93 auto valuePtr = fEntry->GetPtr<
void>(fieldContext.fToken);
94 auto value = fieldContext.fConcreteField->CreateValue();
96 fEntry->UpdateValue(fieldContext.fToken,
value);
102 ++fNEntriesProcessed;
104 if (++fLocalEntryNumber >= fPageSource->GetNEntries()) {
106 if (++fCurrentNTupleNumber >= fNTuples.size()) {
110 }
while (ConnectNTuple(fNTuples.at(fCurrentNTupleNumber)) == 0);
112 fLocalEntryNumber = 0;
115 fEntry->Read(fLocalEntryNumber);
117 return fNEntriesProcessed;
#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 value
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)
Base class for all ROOT issued exceptions.
Processor specializiation for vertically concatenated RNTuples (chains).
void ConnectFields() final
Creates and connects concrete fields to the current page source, based on the proto-fields.
NTupleSize_t Advance() final
Advance the processor to the next available entry.
RNTupleChainProcessor(const std::vector< RNTupleOpenSpec > &ntuples, std::unique_ptr< RNTupleModel > model=nullptr)
Constructs a new RNTupleChainProcessor.
NTupleSize_t ConnectNTuple(const RNTupleOpenSpec &ntuple) final
Connect an RNTuple for processing.
Interface for iterating over entries of RNTuples and vertically concatenated RNTuples (chains).
std::vector< RFieldContext > fFieldContexts
static std::unique_ptr< RNTupleProcessor > CreateChain(const std::vector< RNTupleOpenSpec > &ntuples, std::unique_ptr< RNTupleModel > model=nullptr)
Create a new RNTuple processor chain for vertical concatenation of RNTuples.
std::unique_ptr< REntry > fEntry
std::unique_ptr< Internal::RPageSource > fPageSource
std::vector< RNTupleOpenSpec > fNTuples
void CallConnectPageSourceOnField(RFieldBase &, RPageSource &)
std::uint64_t NTupleSize_t
Integer type long enough to hold the maximum number of entries in a column.
constexpr NTupleSize_t kInvalidNTupleIndex
constexpr DescriptorId_t kInvalidDescriptorId
Used to specify the underlying RNTuples in RNTupleProcessor and RNTupleReader::OpenFriends()