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();
217 throw RException(
R__FAIL(
"field \"" +
field->GetQualifiedFieldName() +
"\" not found in the current RNTuple"));
239 static constexpr int width = 32;
245 output <<
"+" << std::setfill(
'-') << std::setw(
width - 1) <<
"+\n";
248 if (
const std::string *
storage = std::get_if<std::string>(&fNTupleSpec.fStorage)) {
258 output <<
"+" << std::setfill(
'-') << std::setw(
width - 1) <<
"+\n";
264 std::vector<std::unique_ptr<RNTupleProcessor>>
processors, std::unique_ptr<ROOT::RNTupleModel> model,
280 auto token =
fEntry->GetToken(
field.GetQualifiedFieldName());
301 for (
unsigned i = 0; i < fInnerProcessors.size(); ++i) {
303 fInnerNEntries[i] = fInnerProcessors[i]->GetNEntries();
306 fNEntries += fInnerNEntries[i];
316 for (
const auto &
value : *fEntry) {
324 for (
auto &
innerProc : fInnerProcessors) {
351 fNEntriesProcessed++;
359 for (
unsigned i = 0; i < fInnerProcessors.size(); ++i) {
360 const auto &
innerProc = fInnerProcessors[i];
368 for (
const auto &
innerProc : fInnerProcessors) {
381 throw RException(
R__FAIL(
"RAuxiliaryProcessorField fields must only be used for reading"));
401 std::unique_ptr<ROOT::RNTupleModel>
auxModel,
424 "\" is already present in the model of the primary processor; rename the auxiliary "
425 "processor to avoid conflicts"));
464 std::unique_ptr<RNTupleModel>
auxModel)
472 std::vector<std::unique_ptr<ROOT::RFieldBase>>
auxFields;
479 auto auxParentField = std::make_unique<Internal::RAuxiliaryProcessorField>(fAuxiliaryProcessor->GetProcessorName(),
485 fModel->RegisterSubfield(
field->GetQualifiedFieldName());
487 if (
field->GetTypeName() ==
"RAuxiliaryProcessorField") {
489 fModel->RegisterSubfield(
auxSubField->GetQualifiedFieldName());
496 if (!fModel->IsBare() && !
auxModel->IsBare()) {
511 for (
const auto &
value : *fEntry) {
519 fPrimaryProcessor->SetEntryPointers(*fEntry);
520 fAuxiliaryProcessor->SetEntryPointers(*fEntry, fAuxiliaryProcessor->GetProcessorName());
529 fNEntriesProcessed++;
534 " in the primary processor has no corresponding entry in auxiliary processor \"" +
535 fAuxiliaryProcessor->GetProcessorName() +
"\""));
541 if (!fJoinTableIsBuilt) {
542 fAuxiliaryProcessor->AddEntriesToJoinTable(*fJoinTable);
543 fJoinTableIsBuilt =
true;
548 valPtrs.reserve(fJoinFieldTokens.size());
549 for (
const auto &token : fJoinFieldTokens) {
550 auto ptr = fEntry->GetPtr<
void>(token);
560 " in the primary processor has no corresponding entry in auxiliary processor \"" +
561 fAuxiliaryProcessor->GetProcessorName() +
"\""));
563 fAuxiliaryProcessor->LoadEntry(
entryIdx);
571 fNEntries = fPrimaryProcessor->GetNEntries();
593 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
Processor-specific implementation for printing its structure, called by PrintStructure().
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
Processor-specific implementation for printing its structure, called by PrintStructure().
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
Processor-specific implementation for printing its structure, called by PrintStructure().
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
void SetAllowFieldSubstitutions(RFieldZero &fieldZero, bool val)
ROOT::RFieldZero & GetFieldZeroOfModel(RNTupleModel &model)
void CallConnectPageSourceOnField(RFieldBase &, ROOT::Internal::RPageSource &)
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