30 return processor.
fEntry.get();
37 if (
const std::string *storagePath = std::get_if<std::string>(&
fStorage))
40 auto dir = std::get<TDirectory *>(
fStorage);
45std::unique_ptr<ROOT::Experimental::RNTupleProcessor>
51std::unique_ptr<ROOT::Experimental::RNTupleProcessor>
58 std::vector<std::unique_ptr<RNTupleProcessor>> innerProcessors;
59 innerProcessors.reserve(ntuples.size());
61 for (
auto &ntuple : ntuples) {
62 innerProcessors.emplace_back(Create(std::move(ntuple)));
65 return CreateChain(std::move(innerProcessors), options);
68std::unique_ptr<ROOT::Experimental::RNTupleProcessor>
72 if (innerProcessors.empty())
75 return std::unique_ptr<RNTupleChainProcessor>(
new RNTupleChainProcessor(std::move(innerProcessors), options));
78std::unique_ptr<ROOT::Experimental::RNTupleProcessor>
80 const std::vector<std::string> &joinFields,
83 if (joinFields.size() > 4) {
87 if (std::unordered_set(joinFields.begin(), joinFields.end()).size() < joinFields.size()) {
98std::unique_ptr<ROOT::Experimental::RNTupleProcessor>
100 std::unique_ptr<RNTupleProcessor> auxProcessor,
101 const std::vector<std::string> &joinFields,
104 if (joinFields.size() > 4) {
108 if (std::unordered_set(joinFields.begin(), joinFields.end()).size() < joinFields.size()) {
112 return std::unique_ptr<RNTupleJoinProcessor>(
113 new RNTupleJoinProcessor(std::move(primaryProcessor), std::move(auxProcessor), joinFields, options));
128 std::shared_ptr<ROOT::Experimental::Internal::RNTupleProcessorEntry> entry)
131 if (IsInitialized() && fPageSource)
135 fEntry = std::make_shared<Internal::RNTupleProcessorEntry>();
137 fEntry = std::move(entry);
139 fPageSource = fNTupleSpec.CreatePageSource();
140 fPageSource->Attach();
142 fNEntries = fPageSource->GetNEntries();
148 auto desc = fPageSource->GetSharedDescriptorGuard();
149 auto fieldZeroId = desc->GetFieldZeroId();
155std::unique_ptr<ROOT::RFieldBase>
157 const std::string &typeName)
162 const std::string onDiskFieldName =
163 qualifiedFieldName.find(
"R_rntproc_join_") == 0 ? qualifiedFieldName.substr(15) : qualifiedFieldName;
165 auto descGuard = fPageSource->GetSharedDescriptorGuard();
166 const auto &desc = descGuard.GetConstRef();
168 const auto onDiskFieldId = desc.FindFieldId(onDiskFieldName);
174 std::unique_ptr<ROOT::RFieldBase> field;
175 if (typeName.empty()) {
176 const auto &fieldDesc = desc.GetFieldDescriptor(onDiskFieldId);
177 field = fieldDesc.CreateField(desc);
180 std::string subfieldName = onDiskFieldName;
181 auto posDot = onDiskFieldName.find_last_of(
'.');
182 if (posDot != std::string::npos)
183 subfieldName = onDiskFieldName.substr(posDot + 1);
188 field->SetOnDiskId(onDiskFieldId);
189 return ConnectField(std::move(field));
192std::unique_ptr<ROOT::RFieldBase>
197 fieldZero.
Attach(std::move(field));
204 const std::string &typeName,
void *valuePtr,
207 auto fieldIdx = fEntry->FindFieldIndex(canonicalFieldName, typeName);
210 std::string qualifiedFieldName = canonicalFieldName;
212 qualifiedFieldName = qualifiedFieldName.substr(provenance.
Get().size() + 1);
215 auto field = CreateAndConnectField(qualifiedFieldName, typeName);
218 throw RException(
R__FAIL(
"cannot register field with name \"" + qualifiedFieldName +
219 "\" because it is not present in the on-disk information of the RNTuple(s) this "
220 "processor is created from"));
223 fieldIdx = fEntry->AddField(qualifiedFieldName, std::move(field), valuePtr, provenance);
231 const std::string &canonicalFieldName,
void *valuePtr,
234 auto fieldIdx = fEntry->FindFieldIndex(canonicalFieldName, field->GetTypeName());
237 std::string qualifiedFieldName = canonicalFieldName;
239 qualifiedFieldName = qualifiedFieldName.substr(provenance.
Get().size() + 1);
242 field = ConnectField(std::move(field));
245 throw RException(
R__FAIL(
"cannot register field with name \"" + qualifiedFieldName +
246 "\" because it is not present in the on-disk information of the RNTuple(s) this "
247 "processor is created from"));
250 fieldIdx = fEntry->AddField(qualifiedFieldName, std::move(field), valuePtr, provenance);
260 auto descGuard = fPageSource->GetSharedDescriptorGuard();
261 const auto &desc = descGuard.GetConstRef();
263 std::string fieldName = desc.GetQualifiedFieldName(field.GetId());
264 if (
auto prefix = provenance.
Get(); !prefix.empty())
265 fieldName = prefix +
"." + fieldName;
267 AddFieldToEntry(fieldName, field.GetTypeName(),
nullptr, provenance);
268 for (
const auto &subfield : desc.GetFieldIterable(field.GetId())) {
273 for (
const auto &field : desc.GetTopLevelFields()) {
274 if (includeSubfields) {
275 fnAddSubfields(field, fnAddSubfields);
277 std::string fieldName = desc.GetQualifiedFieldName(field.GetId());
278 if (
auto prefix = provenance.
Get(); !prefix.empty())
279 fieldName = prefix +
"." + fieldName;
281 AddFieldToEntry(fieldName, field.GetTypeName(),
nullptr, provenance);
289 if (globalEntryNumber >= fNEntries || !fEntry)
299 for (
auto fieldIdx : fFieldIdxs) {
303 fNEntriesProcessed++;
307 const std::unordered_set<ROOT::Experimental::Internal::RNTupleProcessorEntry::FieldIndex_t> &fieldIdxs,
312 fFieldIdxs = fieldIdxs;
315 for (
const auto &fieldIdx : fFieldIdxs) {
316 const auto &currField = fEntry->GetValue(fieldIdx).GetField();
317 auto newField = CreateAndConnectField(fEntry->GetQualifiedFieldName(fieldIdx), currField.GetTypeName());
319 fEntry->UpdateField(fieldIdx, std::move(newField));
327 fEntry->ResetFields(fFieldIdxs);
341 static constexpr int width = 32;
343 std::string ntupleNameTrunc = fNTupleSpec.fNTupleName.substr(0,
width - 4);
344 if (ntupleNameTrunc.size() < fNTupleSpec.fNTupleName.size())
345 ntupleNameTrunc = fNTupleSpec.fNTupleName.substr(0,
width - 6) +
"..";
347 output <<
"+" << std::setfill(
'-') << std::setw(
width - 1) <<
"+\n";
348 output << std::setfill(
' ') <<
"| " << ntupleNameTrunc << std::setw(
width - 2 - ntupleNameTrunc.size()) <<
" |\n";
350 if (
const std::string *storage = std::get_if<std::string>(&fNTupleSpec.fStorage)) {
351 std::string storageTrunc = storage->substr(0,
width - 5);
352 if (storageTrunc.size() < storage->size())
353 storageTrunc = storage->substr(0,
width - 8) +
"...";
355 output << std::setfill(
' ') <<
"| " << storageTrunc << std::setw(
width - 2 - storageTrunc.size()) <<
" |\n";
357 output <<
"| " << std::setw(
width - 2) <<
" |\n";
360 output <<
"+" << std::setfill(
'-') << std::setw(
width - 1) <<
"+\n";
378 std::shared_ptr<ROOT::Experimental::Internal::RNTupleProcessorEntry> entry)
384 fEntry = std::make_shared<Internal::RNTupleProcessorEntry>();
386 fEntry = std::move(entry);
388 fInnerProcessors[0]->Initialize(fEntry);
396 for (
unsigned i = 0; i < fInnerProcessors.size(); ++i) {
398 fInnerProcessors[i]->Initialize(fEntry);
399 fInnerNEntries[i] = fInnerProcessors[i]->GetNEntries();
402 fNEntries += fInnerNEntries[i];
410 const std::unordered_set<ROOT::Experimental::Internal::RNTupleProcessorEntry::FieldIndex_t> &fieldIdxs,
414 fFieldIdxs = fieldIdxs;
415 fProvenance = provenance;
416 ConnectInnerProcessor(fCurrentProcessorNumber);
421 for (
const auto &innerProc : fInnerProcessors) {
422 innerProc->Disconnect();
428 if (fCurrentProcessorNumber != processorNumber) {
429 fInnerProcessors[fCurrentProcessorNumber]->Disconnect();
430 fCurrentProcessorNumber = processorNumber;
433 auto &innerProc = fInnerProcessors[processorNumber];
434 innerProc->Initialize(fEntry);
435 innerProc->Connect(fFieldIdxs, fProvenance,
true);
443 return fInnerProcessors[fCurrentProcessorNumber]->AddFieldToEntry(fieldName, typeName, valuePtr, provenance);
448 const std::string &fieldName,
void *valuePtr,
451 return fInnerProcessors[fCurrentProcessorNumber]->AddFieldToEntry(std::move(field), fieldName, valuePtr, provenance);
458 fInnerProcessors[0]->AddAllFieldsToEntry(provenance, includeSubfields);
470 currProcessorIdx = 0;
471 ConnectInnerProcessor(currProcessorIdx);
475 for (
unsigned i = 0; i < currProcessorIdx; ++i) {
477 fInnerNEntries[i] = fInnerProcessors[i]->GetNEntries();
480 if (fInnerNEntries[i] >= globalEntryNumber) {
481 currProcessorIdx = 0;
482 ConnectInnerProcessor(currProcessorIdx);
485 entriesSeen += fInnerNEntries[i];
495 fInnerNEntries[currProcessorIdx] = fInnerProcessors[currProcessorIdx]->GetNEntries();
498 localEntryNumber -= fInnerNEntries[currProcessorIdx];
501 if (++currProcessorIdx >= fInnerProcessors.size()) {
506 ConnectInnerProcessor(currProcessorIdx);
522 fNEntriesProcessed++;
528 for (
unsigned i = 0; i < fInnerProcessors.size(); ++i) {
529 const auto &innerProc = fInnerProcessors[i];
531 innerProc->Initialize(fEntry);
532 innerProc->AddEntriesToJoinTable(joinTable, entryOffset);
533 entryOffset += innerProc->GetNEntries();
539 for (
const auto &innerProc : fInnerProcessors) {
540 innerProc->PrintStructure(output);
547 std::unique_ptr<RNTupleProcessor> auxProcessor,
548 const std::vector<std::string> &joinFields,
551 fPrimaryProcessor(std::move(primaryProcessor)),
552 fAuxiliaryProcessor(std::move(auxProcessor)),
553 fJoinFieldNames(joinFields)
561 std::shared_ptr<ROOT::Experimental::Internal::RNTupleProcessorEntry> entry)
567 fEntry = std::make_shared<Internal::RNTupleProcessorEntry>();
569 fEntry = std::move(entry);
571 fPrimaryProcessor->Initialize(fEntry);
572 fAuxiliaryProcessor->Initialize(fEntry);
574 if (!fJoinFieldNames.empty()) {
575 for (
const auto &joinField : fJoinFieldNames) {
576 if (!fPrimaryProcessor->CanReadFieldFromDisk(joinField)) {
577 throw RException(
R__FAIL(
"could not find join field \"" + joinField +
"\" in primary processor \"" +
578 fPrimaryProcessor->fOptions.GetProcessorName() +
"\""));
580 if (!fAuxiliaryProcessor->CanReadFieldFromDisk(joinField)) {
581 throw RException(
R__FAIL(
"could not find join field \"" + joinField +
"\" in auxiliary processor \"" +
582 fAuxiliaryProcessor->fOptions.GetProcessorName() +
"\""));
587 auto fieldIdx = AddFieldToEntry(fOptions.GetProcessorName() +
".R_rntproc_join_" + joinField,
"std::uint64_t",
589 fJoinFieldIdxs.insert(fieldIdx);
597 const std::unordered_set<ROOT::Experimental::Internal::RNTupleProcessorEntry::FieldIndex_t> &fieldIdxs,
602 auto auxProvenance = provenance.
Evolve(fAuxiliaryProcessor->fOptions.GetProcessorName());
603 for (
const auto &fieldIdx : fieldIdxs) {
604 const auto &fieldProvenance = fEntry->GetFieldProvenance(fieldIdx);
605 if (fieldProvenance.Contains(auxProvenance))
606 fAuxiliaryFieldIdxs.insert(fieldIdx);
608 fFieldIdxs.insert(fieldIdx);
611 fPrimaryProcessor->Connect(fFieldIdxs, provenance, updateFields);
612 fAuxiliaryProcessor->Connect(fAuxiliaryFieldIdxs, auxProvenance, updateFields);
617 fPrimaryProcessor->Disconnect();
618 fAuxiliaryProcessor->Disconnect();
626 auto auxProvenance = provenance.
Evolve(fAuxiliaryProcessor->fOptions.GetProcessorName());
627 if (auxProvenance.IsPresentInFieldName(fieldName)) {
631 if (fPrimaryProcessor->CanReadFieldFromDisk(fieldName)) {
633 "\" is present in the primary RNTupleProcessor \"" +
634 fPrimaryProcessor->fOptions.GetProcessorName() +
635 "\", but may also refer to a field in the auxiliary RNTupleProcessor named \"" +
636 fAuxiliaryProcessor->fOptions.GetProcessorName() +
637 "\". To avoid this ambiguity, rename the auxiliary RNTupleProcessor."));
640 auto fieldIdx = fAuxiliaryProcessor->AddFieldToEntry(fieldName, typeName, valuePtr, auxProvenance);
642 fAuxiliaryFieldIdxs.insert(fieldIdx);
645 auto fieldIdx = fPrimaryProcessor->AddFieldToEntry(fieldName, typeName, valuePtr, provenance);
647 fFieldIdxs.insert(fieldIdx);
654 const std::string &fieldName,
void *valuePtr,
657 auto auxProvenance = provenance.
Evolve(fAuxiliaryProcessor->GetOptions().GetProcessorName());
658 if (auxProvenance.IsPresentInFieldName(fieldName)) {
662 if (fPrimaryProcessor->CanReadFieldFromDisk(fieldName)) {
664 "\" is present in the primary RNTupleProcessor \"" +
665 fPrimaryProcessor->GetOptions().GetProcessorName() +
666 "\", but may also refer to a field in the auxiliary RNTupleProcessor named \"" +
667 fAuxiliaryProcessor->GetOptions().GetProcessorName() +
668 "\". To avoid this ambiguity, rename the auxiliary RNTupleProcessor."));
671 auto fieldIdx = fAuxiliaryProcessor->AddFieldToEntry(std::move(field), fieldName, valuePtr, auxProvenance);
672 fAuxiliaryFieldIdxs.insert(fieldIdx);
675 auto fieldIdx = fPrimaryProcessor->AddFieldToEntry(std::move(field), fieldName, valuePtr, provenance);
677 fFieldIdxs.insert(fieldIdx);
686 fPrimaryProcessor->AddAllFieldsToEntry(provenance, includeSubfields);
687 auto auxProvenance = provenance.
Evolve(fAuxiliaryProcessor->GetOptions().GetProcessorName());
688 fAuxiliaryProcessor->AddAllFieldsToEntry(auxProvenance, includeSubfields);
693 for (
const auto &fieldIdx : fAuxiliaryFieldIdxs) {
694 fEntry->SetFieldValidity(fieldIdx, isValid);
704 for (
auto fieldIdx : fFieldIdxs) {
705 fEntry->SetFieldValidity(fieldIdx,
false);
707 SetAuxiliaryFieldValidity(
false);
725 fNEntriesProcessed++;
732 if (!fJoinTableIsBuilt) {
733 fAuxiliaryProcessor->AddEntriesToJoinTable(*fJoinTable);
734 fJoinTableIsBuilt =
true;
738 std::vector<ROOT::Experimental::Internal::RNTupleJoinTable::JoinValue_t> values;
739 values.reserve(fJoinFieldIdxs.size());
740 for (
const auto &fieldIdx : fJoinFieldIdxs) {
742 values.push_back(val);
747 const auto entryIdx = fJoinTable->GetEntryIndex(values);
749 fAuxiliaryProcessor->SetEntryMapping(entryIdx, auxMapping);
752 SetAuxiliaryFieldValidity(
false);
754 SetAuxiliaryFieldValidity(
true);
755 fAuxiliaryProcessor->LoadEntry(auxMapping);
762 fNEntries = fPrimaryProcessor->GetNEntries();
769 fPrimaryProcessor->AddEntriesToJoinTable(joinTable, entryOffset);
774 std::ostringstream primaryStructureStr;
775 fPrimaryProcessor->PrintStructure(primaryStructureStr);
776 const auto primaryStructure =
ROOT::Split(primaryStructureStr.str(),
"\n",
true);
777 const auto primaryStructureWidth = primaryStructure.front().size();
779 std::ostringstream auxStructureStr;
780 fAuxiliaryProcessor->PrintStructure(auxStructureStr);
781 const auto auxStructure =
ROOT::Split(auxStructureStr.str(),
"\n",
true);
783 const auto maxLength = std::max(primaryStructure.size(), auxStructure.size());
784 for (
unsigned i = 0; i < maxLength; i++) {
785 if (i < primaryStructure.size())
786 output << primaryStructure[i];
788 output << std::setw(primaryStructureWidth) <<
"";
790 if (i < auxStructure.size())
791 output <<
" " << auxStructure[i];
#define R__FAIL(msg)
Short-hand to return an RResult<T> in an error state; the RError is implicitly converted into RResult...
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.
std::uint64_t JoinValue_t
RNTupleJoinTable & Add(ROOT::Internal::RPageSource &pageSource, PartitionKey_t partitionKey=kDefaultPartitionKey, ROOT::NTupleSize_t entryOffset=0)
Add an entry mapping to the join table.
static constexpr PartitionKey_t kDefaultPartitionKey
Collection of values in an RNTupleProcessor, analogous to REntry, with checks and support for missing...
std::uint64_t FieldIndex_t
std::string Get() const
Get the full processor provenance, in the form of "x.y.z".
bool IsPresentInFieldName(std::string_view fieldName) const
Check whether the provided field name contains this provenance.
RNTupleProcessorProvenance Evolve(const std::string &processorName) const
Add a new processor to the provenance.
Processor specialization for vertically combined (chained) RNTupleProcessors.
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.
void ConnectInnerProcessor(std::size_t processorNumber)
Update the entry to reflect any missing fields in the current inner processor.
Internal::RNTupleProcessorEntry::FieldIndex_t AddFieldToEntry(const std::string &fieldName, const std::string &typeName, void *valuePtr=nullptr, const Internal::RNTupleProcessorProvenance &provenance=Internal::RNTupleProcessorProvenance()) final
Add a field to the entry.
void AddAllFieldsToEntry(const Internal::RNTupleProcessorProvenance &provenance, bool includeSubfields) final
Add all known fields (from on-disk information) to the entry.
ROOT::NTupleSize_t GetNEntries() final
Get the total number of entries in this processor.
void Initialize(std::shared_ptr< Internal::RNTupleProcessorEntry > entry=nullptr) final
Initialize the processor by creating an (initially empty) fEntry, or setting an existing one.
std::vector< ROOT::NTupleSize_t > fInnerNEntries
void LoadEntryImpl(const REntryMapping &mapping) final
Load the entry identified by the entry mapping.
void SetEntryMapping(ROOT::NTupleSize_t globalEntryNumber, REntryMapping &mapping) final
Set the local entry mapping (for nested processors), according to a global entry number.
void Connect(const std::unordered_set< Internal::RNTupleProcessorEntry::FieldIndex_t > &fieldIdxs, const Internal::RNTupleProcessorProvenance &provenance=Internal::RNTupleProcessorProvenance(), bool updateFields=false) final
Connect the provided fields indices in the entry to their on-disk fields.
void Disconnect() final
Disconnect the processor from associated physical storage.
std::vector< std::unique_ptr< RNTupleProcessor > > fInnerProcessors
Processor specialization for horizontally combined (joined) RNTupleProcessors.
void PrintStructureImpl(std::ostream &output) const final
Processor-specific implementation for printing its structure, called by PrintStructure().
void SetEntryMapping(ROOT::NTupleSize_t globalEntryNumber, REntryMapping &mapping) final
Set the local entry mapping (for nested processors), according to a global entry number.
void AddEntriesToJoinTable(Internal::RNTupleJoinTable &joinTable, ROOT::NTupleSize_t entryOffset=0) final
Add the entry mappings for this processor to the provided join table.
void Disconnect() final
Disconnect the processor from associated physical storage.
ROOT::NTupleSize_t GetNEntries() final
Get the total number of entries in this processor.
void SetAuxiliaryFieldValidity(bool validity)
Set the validity for all fields in the auxiliary processor at once.
void Connect(const std::unordered_set< Internal::RNTupleProcessorEntry::FieldIndex_t > &fieldIdxs, const Internal::RNTupleProcessorProvenance &provenance=Internal::RNTupleProcessorProvenance(), bool updateFields=false) final
Connect the provided fields indices in the entry to their on-disk fields.
void AddAllFieldsToEntry(const Internal::RNTupleProcessorProvenance &provenance, bool includeSubfields) final
Add all known fields (from on-disk information) to the entry.
std::unique_ptr< RNTupleProcessor > fPrimaryProcessor
void LoadEntryImpl(const REntryMapping &mapping) final
Load the entry identified by the entry mapping.
void Initialize(std::shared_ptr< Internal::RNTupleProcessorEntry > entry=nullptr) final
Initialize the processor by creating an (initially empty) fEntry, or setting an existing one.
Internal::RNTupleProcessorEntry::FieldIndex_t AddFieldToEntry(const std::string &fieldName, const std::string &typeName, void *valuePtr=nullptr, const Internal::RNTupleProcessorProvenance &provenance=Internal::RNTupleProcessorProvenance()) final
Add a field to the entry.
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
const std::string & GetProcessorName() const
void SetProcessorName(std::string_view name)
Maps a processor's global (outer) entry index to its inner ones.
std::size_t GetInnerProcessorIdx() const
void SetInnerProcessorIdx(std::size_t idx)
REntryMapping & GetAuxiliaryProcessorMapping()
ROOT::NTupleSize_t GetEntryNumber() const
void SetEntryNumber(ROOT::NTupleSize_t entryNumber)
REntryMapping & GetInnerProcessorMapping()
REntryMapping & GetPrimaryProcessorMapping()
Interface for iterating over entries of vertically ("chained") and/or horizontally ("joined") combine...
static std::unique_ptr< RNTupleProcessor > CreateChain(std::vector< RNTupleOpenSpec > ntuples, const RNTupleProcessorOptions &opts=RNTupleProcessorOptions())
Create an RNTupleProcessor for a chain (i.e., a vertical combination) of RNTuples.
RNTupleProcessorOptions fOptions
friend class RNTupleJoinProcessor
virtual void AddAllFieldsToEntry(const Internal::RNTupleProcessorProvenance &provenance, bool includeSubfields)=0
Add all known fields (from on-disk information) to the entry.
std::shared_ptr< Internal::RNTupleProcessorEntry > fEntry
friend class RNTupleChainProcessor
friend class RNTupleSingleProcessor
static std::unique_ptr< RNTupleProcessor > Create(RNTupleOpenSpec ntuple, const RNTupleProcessorOptions &opts=RNTupleProcessorOptions())
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.
std::unique_ptr< ROOT::RFieldBase > ConnectField(std::unique_ptr< ROOT::RFieldBase > field)
Connect an existing field to the processor's page source.
void Connect(const std::unordered_set< Internal::RNTupleProcessorEntry::FieldIndex_t > &fieldIdxs, const Internal::RNTupleProcessorProvenance &provenance=Internal::RNTupleProcessorProvenance(), bool updateFields=false) final
Connect the provided fields indices in the entry to their on-disk fields.
void Initialize(std::shared_ptr< Internal::RNTupleProcessorEntry > entry=nullptr) final
Initialize the processor by creating an (initially empty) fEntry, or setting an existing one.
void PrintStructureImpl(std::ostream &output) const final
Processor-specific implementation for printing its structure, called by PrintStructure().
void Disconnect() final
Disconnect the processor from associated physical storage.
RNTupleOpenSpec fNTupleSpec
void LoadEntryImpl(const REntryMapping &mapping) final
Load the entry identified by the entry mapping.
bool CanReadFieldFromDisk(std::string_view fieldName) final
Check if a field exists on-disk and can be read by the processor.
void SetEntryMapping(ROOT::NTupleSize_t globalEntryNumber, REntryMapping &mapping) final
Set the local entry mapping (for nested processors), according to a global entry number.
Internal::RNTupleProcessorEntry::FieldIndex_t AddFieldToEntry(const std::string &fieldName, const std::string &typeName, void *valuePtr=nullptr, const Internal::RNTupleProcessorProvenance &provenance=Internal::RNTupleProcessorProvenance()) final
Add a field to the entry.
void AddAllFieldsToEntry(const Internal::RNTupleProcessorProvenance &provenance, bool includeSubfields) final
Add all known fields (from on-disk information) to the entry.
std::unique_ptr< ROOT::RFieldBase > CreateAndConnectField(const std::string &qualifiedFieldName, const std::string &typeName)
Create a new field and connect it to the processor's page source.
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)
Base class for all ROOT issued exceptions.
static RResult< std::unique_ptr< RFieldBase > > Create(const std::string &fieldName, const std::string &typeName, const ROOT::RCreateFieldOptions &options, const ROOT::RNTupleDescriptor *desc, ROOT::DescriptorId_t fieldId)
Factory method to resurrect a field from the stored on-disk type information.
Metadata stored for every field of an RNTuple.
The container field for an ntuple model, which itself has no physical representation.
std::vector< std::unique_ptr< RFieldBase > > ReleaseSubfields()
Moves all subfields into the returned vector.
void Attach(std::unique_ptr< RFieldBase > child)
A public version of the Attach method that allows piece-wise construction of the zero field.
Representation of an RNTuple data set in a ROOT file.
const RNTupleProcessorEntry * LoadFullRNTupleProcessorEntry(ROOT::Experimental::RNTupleProcessor &processor, bool includeSubfields)
std::unique_ptr< RNTupleProcessor > CreateRNTupleJoinProcessor(RNTupleOpenSpec primaryNTuple, RNTupleOpenSpec auxNTuple, const std::vector< std::string > &joinFields, const RNTupleProcessorOptions &opts=RNTupleProcessorOptions())
Create an RNTupleProcessor for a join (i.e., a horizontal combination) of RNTuples.
void SetAllowFieldSubstitutions(RFieldZero &fieldZero, bool val)
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