32 auto dir = std::get<TDirectory *>(
fStorage);
37std::unique_ptr<ROOT::Experimental::RNTupleProcessor>
41 return std::unique_ptr<RNTupleSingleProcessor>(
45std::unique_ptr<ROOT::Experimental::RNTupleProcessor>
47 std::unique_ptr<ROOT::RNTupleModel> model,
70std::unique_ptr<ROOT::Experimental::RNTupleProcessor>
72 std::unique_ptr<ROOT::RNTupleModel> model,
83 return std::unique_ptr<RNTupleChainProcessor>(
87std::unique_ptr<ROOT::Experimental::RNTupleProcessor>
91 std::unique_ptr<ROOT::RNTupleModel>
auxModel,
131 return std::unique_ptr<RNTupleJoinProcessor>(
139 std::unique_ptr<ROOT::RNTupleModel> model,
158 auto token =
fEntry->GetToken(
field.GetFieldName());
179 fNEntriesProcessed++;
187 for (
const auto &
value : *fEntry) {
203 fPageSource = fNTupleSpec.CreatePageSource();
204 fPageSource->Attach();
205 fNEntries = fPageSource->GetNEntries();
207 auto desc = fPageSource->GetSharedDescriptorGuard();
216 throw RException(
R__FAIL(
"field \"" +
field->GetQualifiedFieldName() +
"\" not found in the current RNTuple"));
237 static constexpr int width = 32;
243 output <<
"+" << std::setfill(
'-') << std::setw(
width - 1) <<
"+\n";
246 if (
const std::string *
storage = std::get_if<std::string>(&fNTupleSpec.fStorage)) {
256 output <<
"+" << std::setfill(
'-') << std::setw(
width - 1) <<
"+\n";
262 std::vector<std::unique_ptr<RNTupleProcessor>>
processors, std::unique_ptr<ROOT::RNTupleModel> model,
278 auto token =
fEntry->GetToken(
field.GetQualifiedFieldName());
299 for (
unsigned i = 0; i < fInnerProcessors.size(); ++i) {
301 fInnerNEntries[i] = fInnerProcessors[i]->GetNEntries();
304 fNEntries += fInnerNEntries[i];
314 for (
const auto &
value : *fEntry) {
322 for (
auto &
innerProc : fInnerProcessors) {
349 fNEntriesProcessed++;
357 for (
unsigned i = 0; i < fInnerProcessors.size(); ++i) {
358 const auto &
innerProc = fInnerProcessors[i];
366 for (
const auto &
innerProc : fInnerProcessors) {
379 throw RException(
R__FAIL(
"RAuxiliaryProcessorField fields must only be used for reading"));
399 std::unique_ptr<ROOT::RNTupleModel>
auxModel,
422 "\" is already present in the model of the primary processor; rename the auxiliary "
423 "processor to avoid conflicts"));
462 std::unique_ptr<RNTupleModel>
auxModel)
470 std::vector<std::unique_ptr<ROOT::RFieldBase>>
auxFields;
477 auto auxParentField = std::make_unique<Internal::RAuxiliaryProcessorField>(fAuxiliaryProcessor->GetProcessorName(),
483 fModel->RegisterSubfield(
field->GetQualifiedFieldName());
485 if (
field->GetTypeName() ==
"RAuxiliaryProcessorField") {
487 fModel->RegisterSubfield(
auxSubField->GetQualifiedFieldName());
494 if (!fModel->IsBare() && !
auxModel->IsBare()) {
509 for (
const auto &
value : *fEntry) {
517 fPrimaryProcessor->SetEntryPointers(*fEntry);
518 fAuxiliaryProcessor->SetEntryPointers(*fEntry, fAuxiliaryProcessor->GetProcessorName());
527 fNEntriesProcessed++;
532 " in the primary processor has no corresponding entry in auxiliary processor \"" +
533 fAuxiliaryProcessor->GetProcessorName() +
"\""));
539 if (!fJoinTableIsBuilt) {
540 fAuxiliaryProcessor->AddEntriesToJoinTable(*fJoinTable);
541 fJoinTableIsBuilt =
true;
546 valPtrs.reserve(fJoinFieldTokens.size());
547 for (
const auto &token : fJoinFieldTokens) {
548 auto ptr = fEntry->GetPtr<
void>(token);
558 " in the primary processor has no corresponding entry in auxiliary processor \"" +
559 fAuxiliaryProcessor->GetProcessorName() +
"\""));
561 fAuxiliaryProcessor->LoadEntry(
entryIdx);
569 fNEntries = fPrimaryProcessor->GetNEntries();
591 for (
unsigned i = 0; i <
maxLength; 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
RAuxiliaryProcessorField(std::string_view fieldName, std::vector< std::unique_ptr< RFieldBase > > itemFields)
void GenerateColumns() final
Implementations in derived classes should create the backing columns corresponding to the field type ...
Builds a join table on one or several fields of an RNTuple so it can be joined onto other RNTuples.
static std::unique_ptr< RNTupleJoinTable > Create(const std::vector< std::string > &joinFieldNames)
Create an RNTupleJoinTable from an existing RNTuple.
static constexpr PartitionKey_t kDefaultPartitionKey
Processor specialization for vertically combined (chained) RNTupleProcessors.
void SetEntryPointers(const ROOT::REntry &, std::string_view fieldNamePrefix) final
void PrintStructureImpl(std::ostream &output) const final
void AddEntriesToJoinTable(Internal::RNTupleJoinTable &joinTable, ROOT::NTupleSize_t entryOffset=0) final
Add the entry mappings for this processor to the provided join table.
ROOT::NTupleSize_t GetNEntries() final
Get the total number of entries in this processor.
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) RNTupleProcessors.
void SetModel(std::unique_ptr< ROOT::RNTupleModel > primaryModel, std::unique_ptr< ROOT::RNTupleModel > auxModel)
Set fModel by combining the primary and auxiliary models.
void SetEntryPointers(const ROOT::REntry &, std::string_view fieldNamePrefix) final
void PrintStructureImpl(std::ostream &output) const final
ROOT::NTupleSize_t LoadEntry(ROOT::NTupleSize_t entryNumber) final
Load the entry identified by the provided entry number of the primary processor.
void AddEntriesToJoinTable(Internal::RNTupleJoinTable &joinTable, ROOT::NTupleSize_t entryOffset=0) final
Add the entry mappings for this processor to the provided join table.
ROOT::NTupleSize_t GetNEntries() final
Get the total number of entries in this processor.
std::unique_ptr< RNTupleProcessor > fPrimaryProcessor
std::unique_ptr< Internal::RNTupleJoinTable > fJoinTable
std::unique_ptr< RNTupleProcessor > fAuxiliaryProcessor
std::vector< ROOT::RFieldToken > fJoinFieldTokens
Tokens representing the join fields present in the primary processor.
Specification of the name and location of an RNTuple, used for creating a new RNTupleProcessor.
std::variant< std::string, TDirectory * > fStorage
std::unique_ptr< ROOT::Internal::RPageSource > CreatePageSource() const
Interface for iterating over entries of RNTuples and vertically concatenated RNTuples (chains).
static std::unique_ptr< RNTupleProcessor > CreateJoin(RNTupleOpenSpec primaryNTuple, RNTupleOpenSpec auxNTuple, const std::vector< std::string > &joinFields, std::unique_ptr< ROOT::RNTupleModel > primaryModel=nullptr, std::unique_ptr< ROOT::RNTupleModel > auxModel=nullptr, std::string_view processorName="")
Create an RNTupleProcessor for a join (i.e., a horizontal combination) of RNTuples.
std::unique_ptr< ROOT::REntry > fEntry
std::unique_ptr< ROOT::RNTupleModel > fModel
friend class RNTupleJoinProcessor
std::string fProcessorName
static std::unique_ptr< RNTupleProcessor > CreateChain(std::vector< RNTupleOpenSpec > ntuples, std::unique_ptr< ROOT::RNTupleModel > model=nullptr, std::string_view processorName="")
Create an RNTupleProcessor for a chain (i.e., a vertical combination) of RNTuples.
friend class RNTupleChainProcessor
friend class RNTupleSingleProcessor
static std::unique_ptr< RNTupleProcessor > Create(RNTupleOpenSpec ntuple, std::unique_ptr< ROOT::RNTupleModel > model=nullptr, std::string_view processorName="")
Create an RNTupleProcessor for a single RNTuple.
Processor specialization for processing a single RNTuple.
void AddEntriesToJoinTable(Internal::RNTupleJoinTable &joinTable, ROOT::NTupleSize_t entryOffset=0) final
Add the entry mappings for this processor to the provided join table.
void SetEntryPointers(const ROOT::REntry &entry, std::string_view fieldNamePrefix) final
void PrintStructureImpl(std::ostream &output) const final
RNTupleOpenSpec fNTupleSpec
std::unique_ptr< ROOT::Internal::RPageSource > fPageSource
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...
static std::unique_ptr< RPageSourceFile > CreateFromAnchor(const RNTuple &anchor, const ROOT::RNTupleReadOptions &options=ROOT::RNTupleReadOptions())
Used from the RNTuple class to build a datasource if the anchor is already available.
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 RNTuple corresponding to a complete row in the data set.
Base class for all ROOT issued exceptions.
virtual void GenerateColumns()
Implementations in derived classes should create the backing columns corresponding to the field type ...
Representation of an RNTuple data set in a ROOT file.
const_iterator begin() const
const_iterator end() const
The field for an untyped record.
void AttachItemFields(std::vector< std::unique_ptr< RFieldBase > > itemFields)
std::size_t GetItemPadding(std::size_t baseOffset, std::size_t itemAlignment) const
std::vector< std::size_t > fOffsets
ROOT::RFieldZero & GetFieldZeroOfModel(RNTupleModel &model)
void CallConnectPageSourceOnField(RFieldBase &, ROOT::Internal::RPageSource &)
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
constexpr NTupleSize_t kInvalidNTupleIndex
std::vector< std::string > Split(std::string_view str, std::string_view delims, bool skipEmpty=false)
Splits a string at each character in delims.
std::uint64_t NTupleSize_t
Integer type long enough to hold the maximum number of entries in a column.
constexpr DescriptorId_t kInvalidDescriptorId