34std::unique_ptr<ROOT::Experimental::RNTupleProcessor>
40std::unique_ptr<ROOT::Experimental::RNTupleProcessor>
42 std::unique_ptr<RNTupleModel> model)
47std::unique_ptr<ROOT::Experimental::RNTupleProcessor>
49 std::unique_ptr<RNTupleModel> model)
54 return CreateChain(
ntuples,
ntuples[0].fNTupleName, std::move(model));
57std::unique_ptr<ROOT::Experimental::RNTupleProcessor>
59 std::string_view
processorName, std::unique_ptr<RNTupleModel> model)
81std::unique_ptr<ROOT::Experimental::RNTupleProcessor>
83 std::unique_ptr<RNTupleModel> model)
92std::unique_ptr<ROOT::Experimental::RNTupleProcessor>
94 std::string_view
processorName, std::unique_ptr<RNTupleModel> model)
104 return std::unique_ptr<RNTupleChainProcessor>(
108std::unique_ptr<ROOT::Experimental::RNTupleProcessor>
111 std::vector<std::unique_ptr<RNTupleModel>>
models)
118std::unique_ptr<ROOT::Experimental::RNTupleProcessor>
122 std::vector<std::unique_ptr<RNTupleModel>>
models)
128 throw RException(
R__FAIL(
"number of provided models must match number of specified ntuples"));
143 std::unique_ptr<RNTupleJoinProcessor>
processor;
145 processor = std::unique_ptr<RNTupleJoinProcessor>(
151 for (
unsigned i = 1; i <
ntuples.size(); ++i) {
167 auto desc =
pageSource.GetSharedDescriptorGuard();
172 R__FAIL(
"field \"" +
fieldContext.GetProtoField().GetFieldName() +
"\" not found in current RNTuple"));
188 std::unique_ptr<RNTupleModel> model)
226 fNEntriesProcessed++;
233 for (
const auto &
value : *fEntry) {
249 fPageSource->Attach();
250 fNEntries = fPageSource->GetNEntries();
261 std::unique_ptr<RNTupleModel> model)
292 for (
unsigned i = 0; i < fInnerProcessors.size(); ++i) {
294 fInnerNEntries[i] = fInnerProcessors[i]->GetNEntries();
297 fNEntries += fInnerNEntries[i];
306 for (
const auto &
value : *fEntry) {
313 for (
auto &
innerProc : fInnerProcessors) {
340 fNEntriesProcessed++;
349 std::unique_ptr<RNTupleModel> model)
363 model =
fPageSource->GetSharedDescriptorGuard()->CreateModel();
389 std::unique_ptr<RNTupleModel> model)
391 assert(fNEntriesProcessed == 0 &&
"cannot add auxiliary ntuples after processing has started");
403 model =
pageSource->GetSharedDescriptorGuard()->CreateModel();
406 auto entry = model->CreateBareEntry();
415 std::vector<std::unique_ptr<RFieldBase>>
auxFields;
417 for (
const auto &val : *
entry) {
418 auto &
field = val.GetField();
432 fModel->RegisterSubfield(
field->GetQualifiedFieldName());
439 auto newEntry = fModel->CreateEntry();
446 if (std::find_if(fNTuples.cbegin(), fNTuples.cend(),
fnIsNTuple) != fNTuples.end()) {
457 if (!model->IsBare()) {
458 auto valuePtr = model->GetDefaultEntry().GetPtr<
void>(
field.GetFieldName());
463 fFieldContexts.try_emplace(
field.GetQualifiedFieldName(),
field.Clone(
field.GetFieldName()),
token,
464 fNTuples.size() - 1);
479 fAuxiliaryPageSources.emplace_back(std::move(
pageSource));
518 fNEntriesProcessed++;
526 valPtrs.reserve(fJoinFieldTokens.size());
527 for (
const auto &
token : fJoinFieldTokens) {
528 auto ptr = fEntry->GetPtr<
void>(
token);
535 for (
unsigned i = 0; i < fJoinTables.size(); ++i) {
538 joinTable->Build(*fAuxiliaryPageSources[i]);
#define R__FAIL(msg)
Short-hand to return an RResult<T> in an error state; the RError is implicitly converted into RResult...
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
static std::unique_ptr< RNTupleJoinTable > Create(const std::vector< std::string > &fieldNames)
Create an RNTupleJoinTable from an existing RNTuple.
Abstract interface to read data from an ntuple.
static std::unique_ptr< RPageSource > Create(std::string_view ntupleName, std::string_view location, const ROOT::RNTupleReadOptions &options=ROOT::RNTupleReadOptions())
Guess the concrete derived page source from the file name (location)
The REntry is a collection of values in an ntuple corresponding to a complete row in the data set.
Processor specialization for vertically combined (chained) RNTupleProcessors.
ROOT::NTupleSize_t GetNEntries() final
Get the total number of entries in this processor.
void SetEntryPointers(const REntry &) final
std::vector< ROOT::NTupleSize_t > fInnerNEntries
ROOT::NTupleSize_t LoadEntry(ROOT::NTupleSize_t entryNumber) final
Load the entry identified by the provided (global) entry number (i.e., considering all RNTuples in th...
std::vector< std::unique_ptr< RNTupleProcessor > > fInnerProcessors
Processor specialization for horizontally combined (joined) RNTuples.
void AddAuxiliary(const RNTupleOpenSpec &auxNTuple, const std::vector< std::string > &joinFields, std::unique_ptr< RNTupleModel > model=nullptr)
Add an auxiliary RNTuple to the processor.
ROOT::NTupleSize_t LoadEntry(ROOT::NTupleSize_t entryNumber) final
Load the entry identified by the provided entry number of the primary RNTuple.
void SetEntryPointers(const REntry &) final
void ConnectFields()
Connect all fields, once the primary and all auxiliary RNTuples have been added.
Manager for a field as part of the RNTupleProcessor.
Interface for iterating over entries of RNTuples and vertically concatenated RNTuples (chains).
ROOT::NTupleSize_t fNEntries
Total number of entries.
friend class RNTupleJoinProcessor
static std::unique_ptr< RNTupleProcessor > Create(const RNTupleOpenSpec &ntuple, std::unique_ptr< RNTupleModel > model=nullptr)
Create an RNTupleProcessor for a single RNTuple.
static std::unique_ptr< RNTupleProcessor > CreateChain(const std::vector< RNTupleOpenSpec > &ntuples, std::unique_ptr< RNTupleModel > model=nullptr)
Create an RNTupleProcessor for a chain (i.e., a vertical combination) of RNTuples.
std::unordered_map< std::string, RFieldContext > fFieldContexts
Maps the (qualified) field name to its corresponding field context.
static std::unique_ptr< RNTupleProcessor > CreateJoin(const std::vector< RNTupleOpenSpec > &ntuples, const std::vector< std::string > &joinFields, std::vector< std::unique_ptr< RNTupleModel > > models={})
Create an RNTupleProcessor for a join (i.e., a horizontal combination) of RNTuples.
std::unique_ptr< RNTupleModel > fModel
std::unique_ptr< REntry > fEntry
friend class RNTupleChainProcessor
friend class RNTupleSingleProcessor
void ConnectField(RFieldContext &fieldContext, Internal::RPageSource &pageSource, REntry &entry)
Create and connect a concrete field to the current page source, based on its proto field.
std::unique_ptr< Internal::RPageSource > fPageSource
std::vector< RNTupleOpenSpec > fNTuples
Processor specialization for processing a single RNTuple.
RNTupleOpenSpec fNTupleSpec
void Connect()
Connect the page source of the underlying RNTuple.
ROOT::NTupleSize_t LoadEntry(ROOT::NTupleSize_t entryNumber) final
Load the entry identified by the provided (global) entry number (i.e., considering all RNTuples in th...
void SetEntryPointers(const REntry &entry) final
Base class for all ROOT issued exceptions.
const_iterator begin() const
const_iterator end() const
void CallConnectPageSourceOnField(RFieldBase &, RPageSource &)
constexpr NTupleSize_t kInvalidNTupleIndex
std::uint64_t NTupleSize_t
Integer type long enough to hold the maximum number of entries in a column.
constexpr DescriptorId_t kInvalidDescriptorId
Used to specify the underlying RNTuples in RNTupleProcessor.