30 return processor.
fEntry.get();
35std::unique_ptr<ROOT::RNTupleProcessor>
41std::unique_ptr<ROOT::RNTupleProcessor>
47 std::vector<std::unique_ptr<RNTupleProcessor>> innerProcessors;
48 innerProcessors.reserve(ntuples.size());
50 for (
auto &ntuple : ntuples) {
51 innerProcessors.emplace_back(Create(std::move(ntuple)));
54 return CreateChain(std::move(innerProcessors), options);
57std::unique_ptr<ROOT::RNTupleProcessor>
61 if (innerProcessors.empty())
64 return std::unique_ptr<RNTupleChainProcessor>(
new RNTupleChainProcessor(std::move(innerProcessors), options));
67std::unique_ptr<ROOT::RNTupleProcessor>
69 const std::vector<std::string> &joinFields,
72 if (joinFields.size() > 4) {
76 if (std::unordered_set(joinFields.begin(), joinFields.end()).size() < joinFields.size()) {
87std::unique_ptr<ROOT::RNTupleProcessor>
89 std::unique_ptr<RNTupleProcessor> auxProcessor,
90 const std::vector<std::string> &joinFields,
93 if (joinFields.size() > 4) {
97 if (std::unordered_set(joinFields.begin(), joinFields.end()).size() < joinFields.size()) {
101 return std::unique_ptr<RNTupleJoinProcessor>(
102 new RNTupleJoinProcessor(std::move(primaryProcessor), std::move(auxProcessor), joinFields, options));
118 if (
const std::string *storagePath = std::get_if<std::string>(&inputSpec.
GetStorage()))
121 auto dir = std::get<TDirectory *>(inputSpec.
GetStorage());
133 auto source = CreatePageSource(fNTupleSpec);
135 fNEntries = source->GetNEntries();
143 if (IsInitialized() && fPageSource)
147 fEntry = std::make_shared<Internal::RNTupleProcessorEntry>();
149 fEntry = std::move(entry);
151 fPageSource = CreatePageSource(fNTupleSpec);
152 fPageSource->Attach();
154 fNEntries = fPageSource->GetNEntries();
160 auto desc = fPageSource->GetSharedDescriptorGuard();
161 auto fieldZeroId = desc->GetFieldZeroId();
167std::unique_ptr<ROOT::RFieldBase>
173 const std::string onDiskFieldName =
174 qualifiedFieldName.find(
"R_rntproc_join_") == 0 ? qualifiedFieldName.substr(15) : qualifiedFieldName;
176 auto descGuard = fPageSource->GetSharedDescriptorGuard();
177 const auto &desc = descGuard.GetConstRef();
179 const auto onDiskFieldId = desc.FindFieldId(onDiskFieldName);
185 std::unique_ptr<ROOT::RFieldBase> field;
186 if (typeName.empty()) {
187 const auto &fieldDesc = desc.GetFieldDescriptor(onDiskFieldId);
188 field = fieldDesc.CreateField(desc);
191 std::string subfieldName = onDiskFieldName;
192 auto posDot = onDiskFieldName.find_last_of(
'.');
193 if (posDot != std::string::npos)
194 subfieldName = onDiskFieldName.substr(posDot + 1);
199 field->SetOnDiskId(onDiskFieldId);
200 return ConnectField(std::move(field));
207 fieldZero.
Attach(std::move(field));
216 auto fieldIdx = fEntry->FindFieldIndex(canonicalFieldName, typeName);
219 std::string qualifiedFieldName = canonicalFieldName;
221 qualifiedFieldName = qualifiedFieldName.substr(provenance.
Get().size() + 1);
224 auto field = CreateAndConnectField(qualifiedFieldName, typeName);
227 throw RException(
R__FAIL(
"cannot register field with name \"" + qualifiedFieldName +
228 "\" because it is not present in the on-disk information of the RNTuple(s) this "
229 "processor is created from"));
232 fieldIdx = fEntry->AddField(qualifiedFieldName, std::move(field), valuePtr, provenance);
240 const std::string &canonicalFieldName,
void *valuePtr,
243 auto fieldIdx = fEntry->FindFieldIndex(canonicalFieldName, field->GetTypeName());
246 std::string qualifiedFieldName = canonicalFieldName;
248 qualifiedFieldName = qualifiedFieldName.substr(provenance.
Get().size() + 1);
251 field = ConnectField(std::move(field));
254 throw RException(
R__FAIL(
"cannot register field with name \"" + qualifiedFieldName +
255 "\" because it is not present in the on-disk information of the RNTuple(s) this "
256 "processor is created from"));
259 fieldIdx = fEntry->AddField(qualifiedFieldName, std::move(field), valuePtr, provenance);
266 bool includeSubfields)
269 auto descGuard = fPageSource->GetSharedDescriptorGuard();
270 const auto &desc = descGuard.GetConstRef();
272 std::string fieldName = desc.GetQualifiedFieldName(field.GetId());
273 if (
auto prefix = provenance.
Get(); !prefix.empty())
274 fieldName = prefix +
"." + fieldName;
276 AddFieldToEntry(fieldName, field.GetTypeName(),
nullptr, provenance);
277 for (
const auto &subfield : desc.GetFieldIterable(field.GetId())) {
282 for (
const auto &field : desc.GetTopLevelFields()) {
283 if (includeSubfields) {
284 fnAddSubfields(field, fnAddSubfields);
286 std::string fieldName = desc.GetQualifiedFieldName(field.GetId());
287 if (
auto prefix = provenance.
Get(); !prefix.empty())
288 fieldName = prefix +
"." + fieldName;
290 AddFieldToEntry(fieldName, field.GetTypeName(),
nullptr, provenance);
297 if (globalEntryNumber >= fNEntries || !fEntry)
307 for (
auto fieldIdx : fFieldIdxs) {
311 fNEntriesProcessed++;
318 for (
auto &subfield : field.GetMutableSubfields()) {
319 ResetColumnRepresentative(*subfield);
327 for (
auto &subfield : field.GetMutableSubfields()) {
328 onDiskId = desc.
FindFieldId(subfield->GetQualifiedFieldName());
329 SetOnDiskId(*subfield, onDiskId, desc);
335 const std::unordered_set<Internal::RNTupleProcessorEntry::FieldIndex_t> &fieldIdxs,
340 fFieldIdxs = fieldIdxs;
343 auto descGuard = fPageSource->GetSharedDescriptorGuard();
344 const auto &desc = descGuard.GetConstRef();
346 for (
const auto &fieldIdx : fFieldIdxs) {
347 const auto &currField = fEntry->GetValue(fieldIdx).GetField();
349 auto onDiskId = desc.
FindFieldId(currField.GetQualifiedFieldName());
352 if (
const auto fieldOriginIdx = fEntry->GetFieldOriginIdx(fieldIdx);
354 const auto &originField = fEntry->GetField(fieldOriginIdx);
355 onDiskId = desc.
FindFieldId(originField.GetQualifiedFieldName());
359 std::unique_ptr<ROOT::RFieldBase> newField;
362 newField = currField.Clone(currField.GetFieldName());
365 ResetColumnRepresentative(*newField);
366 SetOnDiskId(*newField, onDiskId, desc);
367 newField = ConnectField(std::move(newField));
371 newField = CreateAndConnectField(fEntry->GetQualifiedFieldName(fieldIdx), currField.GetTypeName());
374 fEntry->UpdateField(fieldIdx, std::move(newField));
382 fEntry->ResetFields(fFieldIdxs);
396 static constexpr int width = 32;
398 std::string ntupleNameTrunc = fNTupleSpec.fNTupleName.substr(0,
width - 4);
399 if (ntupleNameTrunc.size() < fNTupleSpec.fNTupleName.size())
400 ntupleNameTrunc = fNTupleSpec.fNTupleName.substr(0,
width - 6) +
"..";
402 output <<
"+" << std::setfill(
'-') << std::setw(
width - 1) <<
"+\n";
403 output << std::setfill(
' ') <<
"| " << ntupleNameTrunc << std::setw(
width - 2 - ntupleNameTrunc.size()) <<
" |\n";
405 if (
const std::string *storage = std::get_if<std::string>(&fNTupleSpec.fStorage)) {
406 std::string storageTrunc = storage->substr(0,
width - 5);
407 if (storageTrunc.size() < storage->size())
408 storageTrunc = storage->substr(0,
width - 8) +
"...";
410 output << std::setfill(
' ') <<
"| " << storageTrunc << std::setw(
width - 2 - storageTrunc.size()) <<
" |\n";
412 output <<
"| " << std::setw(
width - 2) <<
" |\n";
415 output <<
"+" << std::setfill(
'-') << std::setw(
width - 1) <<
"+\n";
438 fEntry = std::make_shared<Internal::RNTupleProcessorEntry>();
440 fEntry = std::move(entry);
442 fInnerProcessors[0]->Initialize(fEntry);
450 for (
unsigned i = 0; i < fInnerProcessors.size(); ++i) {
452 fInnerNEntries[i] = fInnerProcessors[i]->GetNEntries();
455 fNEntries += fInnerNEntries[i];
463 const std::unordered_set<Internal::RNTupleProcessorEntry::FieldIndex_t> &fieldIdxs,
467 fFieldIdxs = fieldIdxs;
468 fProvenance = provenance;
469 ConnectInnerProcessor(fCurrentProcessorNumber);
474 for (
const auto &innerProc : fInnerProcessors) {
475 innerProc->Disconnect();
481 if (fCurrentProcessorNumber != processorNumber) {
482 fInnerProcessors[fCurrentProcessorNumber]->Disconnect();
483 fCurrentProcessorNumber = processorNumber;
486 auto &innerProc = fInnerProcessors[processorNumber];
487 innerProc->Initialize(fEntry);
488 innerProc->Connect(fFieldIdxs, fProvenance,
true);
495 return fInnerProcessors[fCurrentProcessorNumber]->AddFieldToEntry(fieldName, typeName, valuePtr, provenance);
502 return fInnerProcessors[fCurrentProcessorNumber]->AddFieldToEntry(std::move(field), fieldName, valuePtr, provenance);
506 bool includeSubfields)
509 fInnerProcessors[0]->AddAllFieldsToEntry(provenance, includeSubfields);
520 currProcessorIdx = 0;
521 ConnectInnerProcessor(currProcessorIdx);
525 for (
unsigned i = 0; i < currProcessorIdx; ++i) {
527 fInnerNEntries[i] = fInnerProcessors[i]->GetNEntries();
530 if (fInnerNEntries[i] >= globalEntryNumber) {
531 currProcessorIdx = 0;
532 ConnectInnerProcessor(currProcessorIdx);
535 entriesSeen += fInnerNEntries[i];
545 fInnerNEntries[currProcessorIdx] = fInnerProcessors[currProcessorIdx]->GetNEntries();
548 localEntryNumber -= fInnerNEntries[currProcessorIdx];
551 if (++currProcessorIdx >= fInnerProcessors.size()) {
556 ConnectInnerProcessor(currProcessorIdx);
572 fNEntriesProcessed++;
578 for (
unsigned i = 0; i < fInnerProcessors.size(); ++i) {
579 const auto &innerProc = fInnerProcessors[i];
581 innerProc->Initialize(fEntry);
582 innerProc->AddEntriesToJoinTable(joinTable, entryOffset);
583 entryOffset += innerProc->GetNEntries();
589 for (
const auto &innerProc : fInnerProcessors) {
590 innerProc->PrintStructure(output);
597 std::unique_ptr<RNTupleProcessor> auxProcessor,
598 const std::vector<std::string> &joinFields,
601 fPrimaryProcessor(std::move(primaryProcessor)),
602 fAuxiliaryProcessor(std::move(auxProcessor)),
603 fJoinFieldNames(joinFields)
616 fEntry = std::make_shared<ROOT::Internal::RNTupleProcessorEntry>();
618 fEntry = std::move(entry);
620 fPrimaryProcessor->Initialize(fEntry);
621 fAuxiliaryProcessor->Initialize(fEntry);
623 if (!fJoinFieldNames.empty()) {
624 for (
const auto &joinField : fJoinFieldNames) {
625 if (!fPrimaryProcessor->CanReadFieldFromDisk(joinField)) {
626 throw RException(
R__FAIL(
"could not find join field \"" + joinField +
"\" in primary processor \"" +
627 fPrimaryProcessor->fOptions.GetProcessorName() +
"\""));
629 if (!fAuxiliaryProcessor->CanReadFieldFromDisk(joinField)) {
630 throw RException(
R__FAIL(
"could not find join field \"" + joinField +
"\" in auxiliary processor \"" +
631 fAuxiliaryProcessor->fOptions.GetProcessorName() +
"\""));
637 AddFieldToEntry(fOptions.GetProcessorName() +
".R_rntproc_join_" + joinField,
"std::uint64_t",
nullptr,
639 fJoinFieldIdxs.insert(fieldIdx);
647 const std::unordered_set<ROOT::Internal::RNTupleProcessorEntry::FieldIndex_t> &fieldIdxs,
652 auto auxProvenance = provenance.
Evolve(fAuxiliaryProcessor->fOptions.GetProcessorName());
653 for (
const auto &fieldIdx : fieldIdxs) {
654 const auto &fieldProvenance = fEntry->GetFieldProvenance(fieldIdx);
655 if (fieldProvenance.Contains(auxProvenance))
656 fAuxiliaryFieldIdxs.insert(fieldIdx);
658 fFieldIdxs.insert(fieldIdx);
661 fPrimaryProcessor->Connect(fFieldIdxs, provenance, updateFields);
662 fAuxiliaryProcessor->Connect(fAuxiliaryFieldIdxs, auxProvenance, updateFields);
667 fPrimaryProcessor->Disconnect();
668 fAuxiliaryProcessor->Disconnect();
676 auto auxProvenance = provenance.
Evolve(fAuxiliaryProcessor->fOptions.GetProcessorName());
677 if (auxProvenance.IsPresentInFieldName(fieldName)) {
681 if (fPrimaryProcessor->CanReadFieldFromDisk(fieldName)) {
683 "\" is present in the primary RNTupleProcessor \"" +
684 fPrimaryProcessor->fOptions.GetProcessorName() +
685 "\", but may also refer to a field in the auxiliary RNTupleProcessor named \"" +
686 fAuxiliaryProcessor->fOptions.GetProcessorName() +
687 "\". To avoid this ambiguity, rename the auxiliary RNTupleProcessor."));
690 auto fieldIdx = fAuxiliaryProcessor->AddFieldToEntry(fieldName, typeName, valuePtr, auxProvenance);
692 fAuxiliaryFieldIdxs.insert(fieldIdx);
695 auto fieldIdx = fPrimaryProcessor->AddFieldToEntry(fieldName, typeName, valuePtr, provenance);
697 fFieldIdxs.insert(fieldIdx);
704 const std::string &fieldName,
void *valuePtr,
707 auto auxProvenance = provenance.
Evolve(fAuxiliaryProcessor->GetOptions().GetProcessorName());
708 if (auxProvenance.IsPresentInFieldName(fieldName)) {
712 if (fPrimaryProcessor->CanReadFieldFromDisk(fieldName)) {
714 "\" is present in the primary RNTupleProcessor \"" +
715 fPrimaryProcessor->GetOptions().GetProcessorName() +
716 "\", but may also refer to a field in the auxiliary RNTupleProcessor named \"" +
717 fAuxiliaryProcessor->GetOptions().GetProcessorName() +
718 "\". To avoid this ambiguity, rename the auxiliary RNTupleProcessor."));
721 auto fieldIdx = fAuxiliaryProcessor->AddFieldToEntry(std::move(field), fieldName, valuePtr, auxProvenance);
722 fAuxiliaryFieldIdxs.insert(fieldIdx);
725 auto fieldIdx = fPrimaryProcessor->AddFieldToEntry(std::move(field), fieldName, valuePtr, provenance);
727 fFieldIdxs.insert(fieldIdx);
736 fPrimaryProcessor->AddAllFieldsToEntry(provenance, includeSubfields);
737 auto auxProvenance = provenance.
Evolve(fAuxiliaryProcessor->GetOptions().GetProcessorName());
738 fAuxiliaryProcessor->AddAllFieldsToEntry(auxProvenance, includeSubfields);
743 for (
const auto &fieldIdx : fAuxiliaryFieldIdxs) {
744 fEntry->SetFieldValidity(fieldIdx, isValid);
754 for (
auto fieldIdx : fFieldIdxs) {
755 fEntry->SetFieldValidity(fieldIdx,
false);
757 SetAuxiliaryFieldValidity(
false);
775 fNEntriesProcessed++;
782 if (!fJoinTableIsBuilt) {
783 fAuxiliaryProcessor->AddEntriesToJoinTable(*fJoinTable);
784 fJoinTableIsBuilt =
true;
788 std::vector<ROOT::Experimental::Internal::RNTupleJoinTable::JoinValue_t> values;
789 values.reserve(fJoinFieldIdxs.size());
790 for (
const auto &fieldIdx : fJoinFieldIdxs) {
792 values.push_back(val);
797 const auto entryIdx = fJoinTable->GetEntryIndex(values);
799 fAuxiliaryProcessor->SetEntryMapping(entryIdx, auxMapping);
802 SetAuxiliaryFieldValidity(
false);
804 SetAuxiliaryFieldValidity(
true);
805 fAuxiliaryProcessor->LoadEntry(auxMapping);
812 fNEntries = fPrimaryProcessor->GetNEntries();
819 fPrimaryProcessor->AddEntriesToJoinTable(joinTable, entryOffset);
824 std::ostringstream primaryStructureStr;
825 fPrimaryProcessor->PrintStructure(primaryStructureStr);
826 const auto primaryStructure =
ROOT::Split(primaryStructureStr.str(),
"\n",
true);
827 const auto primaryStructureWidth = primaryStructure.front().size();
829 std::ostringstream auxStructureStr;
830 fAuxiliaryProcessor->PrintStructure(auxStructureStr);
831 const auto auxStructure =
ROOT::Split(auxStructureStr.str(),
"\n",
true);
833 const auto maxLength = std::max(primaryStructure.size(), auxStructure.size());
834 for (
unsigned i = 0; i < maxLength; i++) {
835 if (i < primaryStructure.size())
836 output << primaryStructure[i];
838 output << std::setw(primaryStructureWidth) <<
"";
840 if (i < auxStructure.size())
841 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
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 AddAllFieldsToEntry(const ROOT::Internal::RNTupleProcessorProvenance &provenance, bool includeSubfields) final
Add all known fields (from on-disk information) to the entry.
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 Initialize(std::shared_ptr< ROOT::Internal::RNTupleProcessorEntry > entry=nullptr) final
Initialize the processor by creating an (initially empty) fEntry, or setting an existing one.
void Connect(const std::unordered_set< ROOT::Internal::RNTupleProcessorEntry::FieldIndex_t > &fieldIdxs, const ROOT::Internal::RNTupleProcessorProvenance &provenance=ROOT::Internal::RNTupleProcessorProvenance(), bool updateFields=false) final
Connect the provided fields indices in the entry to their on-disk fields.
std::unique_ptr< RNTupleProcessor > fPrimaryProcessor
void LoadEntryImpl(const REntryMapping &mapping) final
Load the entry identified by the entry mapping.
ROOT::Internal::RNTupleProcessorEntry::FieldIndex_t AddFieldToEntry(const std::string &fieldName, const std::string &typeName, void *valuePtr=nullptr, const ROOT::Internal::RNTupleProcessorProvenance &provenance=ROOT::Internal::RNTupleProcessorProvenance()) final
Add a field to the entry.
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".
RNTupleProcessorProvenance Evolve(const std::string &processorName) const
Add a new processor to the provenance.
bool IsPresentInFieldName(std::string_view fieldName) const
Check whether the provided field name contains this provenance.
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.
std::vector< ColumnRepresentation_t > Selection_t
A list of column representations.
A field translates read and write calls from/to underlying columns to/from tree values.
void SetColumnRepresentatives(const RColumnRepresentations::Selection_t &representatives)
Fixes a column representative.
void SetOnDiskId(ROOT::DescriptorId_t id)
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.
const std::string & GetTypeName() const
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.
Processor specialization for vertically combined (chained) RNTupleProcessors.
std::vector< std::unique_ptr< RNTupleProcessor > > fInnerProcessors
void AddAllFieldsToEntry(const Internal::RNTupleProcessorProvenance &provenance, bool includeSubfields) final
Add all known fields (from on-disk information) to the entry.
void ConnectInnerProcessor(std::size_t processorNumber)
Update the entry to reflect any missing fields in the current inner processor.
void Initialize(std::shared_ptr< ROOT::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 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.
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 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 AddEntriesToJoinTable(Experimental::Internal::RNTupleJoinTable &joinTable, ROOT::NTupleSize_t entryOffset=0) final
Add the entry mappings for this processor to the provided join table.
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.
ROOT::NTupleSize_t GetNEntries() final
Get the total number of entries in this processor.
The on-storage metadata of an RNTuple.
const RFieldDescriptor & GetFieldDescriptor(ROOT::DescriptorId_t fieldId) const
ROOT::DescriptorId_t FindFieldId(std::string_view fieldName, ROOT::DescriptorId_t parentId) const
const std::string & GetProcessorName() const
Get the processor's name.
void SetProcessorName(std::string_view name)
Set the processor's name.
Maps a processor's global (outer) entry index to its inner ones.
REntryMapping & GetPrimaryProcessorMapping()
REntryMapping & GetInnerProcessorMapping()
std::size_t GetInnerProcessorIdx() const
void SetInnerProcessorIdx(std::size_t idx)
void SetEntryNumber(ROOT::NTupleSize_t entryNumber)
ROOT::NTupleSize_t GetEntryNumber() const
REntryMapping & GetAuxiliaryProcessorMapping()
Interface for iterating over entries of vertically ("chained") and/or horizontally ("joined") combine...
virtual void AddAllFieldsToEntry(const Internal::RNTupleProcessorProvenance &provenance, bool includeSubfields)=0
Add all known fields (from on-disk information) to the entry.
static std::unique_ptr< RNTupleProcessor > CreateChain(std::vector< RNTupleInputSpec > ntuples, const RNTupleProcessorOptions &opts=RNTupleProcessorOptions())
Create an RNTupleProcessor for a chain (i.e., a vertical combination) of RNTuples.
friend class RNTupleChainProcessor
static std::unique_ptr< RNTupleProcessor > Create(RNTupleInputSpec ntuple, const RNTupleProcessorOptions &opts=RNTupleProcessorOptions())
Create an RNTupleProcessor for a single RNTuple.
friend class RNTupleSingleProcessor
RNTupleProcessorOptions fOptions
friend class Experimental::RNTupleJoinProcessor
std::shared_ptr< ROOT::Internal::RNTupleProcessorEntry > fEntry
void SetEntryMapping(ROOT::NTupleSize_t globalEntryNumber, REntryMapping &mapping) final
Set the local entry mapping (for nested processors), according to a global entry number.
void PrintStructureImpl(std::ostream &output) const final
Processor-specific implementation for printing its structure, called by PrintStructure().
void LoadEntryImpl(const REntryMapping &mapping) final
Load the entry identified by the entry mapping.
RNTupleInputSpec fNTupleSpec
std::unique_ptr< ROOT::RFieldBase > ConnectField(std::unique_ptr< ROOT::RFieldBase > field)
Connect an existing field to the processor's page source.
bool CanReadFieldFromDisk(std::string_view fieldName) final
Check if a field exists on-disk and can be read by the processor.
void Initialize(std::shared_ptr< ROOT::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.
void AddAllFieldsToEntry(const Internal::RNTupleProcessorProvenance &provenance, bool includeSubfields) final
Add all known fields (from on-disk information) to the entry.
void AddEntriesToJoinTable(Experimental::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 > CreateAndConnectField(const std::string &qualifiedFieldName, const std::string &typeName)
Create a new field and connect it to the processor's page source.
ROOT::NTupleSize_t GetNEntries() final
Get the total number of entries in this processor.
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.
Representation of an RNTuple data set in a ROOT file.
std::unique_ptr< RNTupleProcessor > CreateRNTupleJoinProcessor(RNTupleInputSpec primaryNTuple, RNTupleInputSpec 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 &)
const RNTupleProcessorEntry * LoadFullRNTupleProcessorEntry(ROOT::RNTupleProcessor &processor, bool includeSubfields)
std::uint64_t DescriptorId_t
Distriniguishes elements of the same type within a descriptor, e.g. different fields.
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