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());
130 if (IsInitialized() && fPageSource)
134 fEntry = std::make_shared<Internal::RNTupleProcessorEntry>();
136 fEntry = std::move(entry);
138 fPageSource = CreatePageSource(fNTupleSpec);
139 fPageSource->Attach();
141 fNEntries = fPageSource->GetNEntries();
147 auto desc = fPageSource->GetSharedDescriptorGuard();
148 auto fieldZeroId = desc->GetFieldZeroId();
154std::unique_ptr<ROOT::RFieldBase>
160 const std::string onDiskFieldName =
161 qualifiedFieldName.find(
"R_rntproc_join_") == 0 ? qualifiedFieldName.substr(15) : qualifiedFieldName;
163 auto descGuard = fPageSource->GetSharedDescriptorGuard();
164 const auto &desc = descGuard.GetConstRef();
166 const auto onDiskFieldId = desc.FindFieldId(onDiskFieldName);
172 std::unique_ptr<ROOT::RFieldBase> field;
173 if (typeName.empty()) {
174 const auto &fieldDesc = desc.GetFieldDescriptor(onDiskFieldId);
175 field = fieldDesc.CreateField(desc);
178 std::string subfieldName = onDiskFieldName;
179 auto posDot = onDiskFieldName.find_last_of(
'.');
180 if (posDot != std::string::npos)
181 subfieldName = onDiskFieldName.substr(posDot + 1);
186 field->SetOnDiskId(onDiskFieldId);
187 return ConnectField(std::move(field));
194 fieldZero.
Attach(std::move(field));
203 auto fieldIdx = fEntry->FindFieldIndex(canonicalFieldName, typeName);
206 std::string qualifiedFieldName = canonicalFieldName;
208 qualifiedFieldName = qualifiedFieldName.substr(provenance.
Get().size() + 1);
211 auto field = CreateAndConnectField(qualifiedFieldName, typeName);
214 throw RException(
R__FAIL(
"cannot register field with name \"" + qualifiedFieldName +
215 "\" because it is not present in the on-disk information of the RNTuple(s) this "
216 "processor is created from"));
219 fieldIdx = fEntry->AddField(qualifiedFieldName, std::move(field), valuePtr, provenance);
227 const std::string &canonicalFieldName,
void *valuePtr,
230 auto fieldIdx = fEntry->FindFieldIndex(canonicalFieldName, field->GetTypeName());
233 std::string qualifiedFieldName = canonicalFieldName;
235 qualifiedFieldName = qualifiedFieldName.substr(provenance.
Get().size() + 1);
238 field = ConnectField(std::move(field));
241 throw RException(
R__FAIL(
"cannot register field with name \"" + qualifiedFieldName +
242 "\" because it is not present in the on-disk information of the RNTuple(s) this "
243 "processor is created from"));
246 fieldIdx = fEntry->AddField(qualifiedFieldName, std::move(field), valuePtr, provenance);
253 bool includeSubfields)
256 auto descGuard = fPageSource->GetSharedDescriptorGuard();
257 const auto &desc = descGuard.GetConstRef();
259 std::string fieldName = desc.GetQualifiedFieldName(field.GetId());
260 if (
auto prefix = provenance.
Get(); !prefix.empty())
261 fieldName = prefix +
"." + fieldName;
263 AddFieldToEntry(fieldName, field.GetTypeName(),
nullptr, provenance);
264 for (
const auto &subfield : desc.GetFieldIterable(field.GetId())) {
269 for (
const auto &field : desc.GetTopLevelFields()) {
270 if (includeSubfields) {
271 fnAddSubfields(field, fnAddSubfields);
273 std::string fieldName = desc.GetQualifiedFieldName(field.GetId());
274 if (
auto prefix = provenance.
Get(); !prefix.empty())
275 fieldName = prefix +
"." + fieldName;
277 AddFieldToEntry(fieldName, field.GetTypeName(),
nullptr, provenance);
284 if (globalEntryNumber >= fNEntries || !fEntry)
294 for (
auto fieldIdx : fFieldIdxs) {
298 fNEntriesProcessed++;
305 for (
auto &subfield : field.GetMutableSubfields()) {
306 ResetColumnRepresentative(*subfield);
314 for (
auto &subfield : field.GetMutableSubfields()) {
315 onDiskId = desc.
FindFieldId(subfield->GetQualifiedFieldName());
316 SetOnDiskId(*subfield, onDiskId, desc);
322 const std::unordered_set<Internal::RNTupleProcessorEntry::FieldIndex_t> &fieldIdxs,
327 fFieldIdxs = fieldIdxs;
330 auto descGuard = fPageSource->GetSharedDescriptorGuard();
331 const auto &desc = descGuard.GetConstRef();
333 for (
const auto &fieldIdx : fFieldIdxs) {
334 const auto &currField = fEntry->GetValue(fieldIdx).GetField();
336 auto onDiskId = desc.
FindFieldId(currField.GetQualifiedFieldName());
339 if (
const auto fieldOriginIdx = fEntry->GetFieldOriginIdx(fieldIdx);
341 const auto &originField = fEntry->GetField(fieldOriginIdx);
342 onDiskId = desc.
FindFieldId(originField.GetQualifiedFieldName());
346 std::unique_ptr<ROOT::RFieldBase> newField;
349 newField = currField.Clone(currField.GetFieldName());
352 ResetColumnRepresentative(*newField);
353 SetOnDiskId(*newField, onDiskId, desc);
354 newField = ConnectField(std::move(newField));
358 newField = CreateAndConnectField(fEntry->GetQualifiedFieldName(fieldIdx), currField.GetTypeName());
361 fEntry->UpdateField(fieldIdx, std::move(newField));
369 fEntry->ResetFields(fFieldIdxs);
383 static constexpr int width = 32;
385 std::string ntupleNameTrunc = fNTupleSpec.fNTupleName.substr(0,
width - 4);
386 if (ntupleNameTrunc.size() < fNTupleSpec.fNTupleName.size())
387 ntupleNameTrunc = fNTupleSpec.fNTupleName.substr(0,
width - 6) +
"..";
389 output <<
"+" << std::setfill(
'-') << std::setw(
width - 1) <<
"+\n";
390 output << std::setfill(
' ') <<
"| " << ntupleNameTrunc << std::setw(
width - 2 - ntupleNameTrunc.size()) <<
" |\n";
392 if (
const std::string *storage = std::get_if<std::string>(&fNTupleSpec.fStorage)) {
393 std::string storageTrunc = storage->substr(0,
width - 5);
394 if (storageTrunc.size() < storage->size())
395 storageTrunc = storage->substr(0,
width - 8) +
"...";
397 output << std::setfill(
' ') <<
"| " << storageTrunc << std::setw(
width - 2 - storageTrunc.size()) <<
" |\n";
399 output <<
"| " << std::setw(
width - 2) <<
" |\n";
402 output <<
"+" << std::setfill(
'-') << std::setw(
width - 1) <<
"+\n";
425 fEntry = std::make_shared<Internal::RNTupleProcessorEntry>();
427 fEntry = std::move(entry);
429 fInnerProcessors[0]->Initialize(fEntry);
437 for (
unsigned i = 0; i < fInnerProcessors.size(); ++i) {
439 fInnerProcessors[i]->Initialize(fEntry);
440 fInnerNEntries[i] = fInnerProcessors[i]->GetNEntries();
443 fNEntries += fInnerNEntries[i];
451 const std::unordered_set<Internal::RNTupleProcessorEntry::FieldIndex_t> &fieldIdxs,
455 fFieldIdxs = fieldIdxs;
456 fProvenance = provenance;
457 ConnectInnerProcessor(fCurrentProcessorNumber);
462 for (
const auto &innerProc : fInnerProcessors) {
463 innerProc->Disconnect();
469 if (fCurrentProcessorNumber != processorNumber) {
470 fInnerProcessors[fCurrentProcessorNumber]->Disconnect();
471 fCurrentProcessorNumber = processorNumber;
474 auto &innerProc = fInnerProcessors[processorNumber];
475 innerProc->Initialize(fEntry);
476 innerProc->Connect(fFieldIdxs, fProvenance,
true);
483 return fInnerProcessors[fCurrentProcessorNumber]->AddFieldToEntry(fieldName, typeName, valuePtr, provenance);
490 return fInnerProcessors[fCurrentProcessorNumber]->AddFieldToEntry(std::move(field), fieldName, valuePtr, provenance);
494 bool includeSubfields)
497 fInnerProcessors[0]->AddAllFieldsToEntry(provenance, includeSubfields);
508 currProcessorIdx = 0;
509 ConnectInnerProcessor(currProcessorIdx);
513 for (
unsigned i = 0; i < currProcessorIdx; ++i) {
515 fInnerNEntries[i] = fInnerProcessors[i]->GetNEntries();
518 if (fInnerNEntries[i] >= globalEntryNumber) {
519 currProcessorIdx = 0;
520 ConnectInnerProcessor(currProcessorIdx);
523 entriesSeen += fInnerNEntries[i];
533 fInnerNEntries[currProcessorIdx] = fInnerProcessors[currProcessorIdx]->GetNEntries();
536 localEntryNumber -= fInnerNEntries[currProcessorIdx];
539 if (++currProcessorIdx >= fInnerProcessors.size()) {
544 ConnectInnerProcessor(currProcessorIdx);
560 fNEntriesProcessed++;
566 for (
unsigned i = 0; i < fInnerProcessors.size(); ++i) {
567 const auto &innerProc = fInnerProcessors[i];
569 innerProc->Initialize(fEntry);
570 innerProc->AddEntriesToJoinTable(joinTable, entryOffset);
571 entryOffset += innerProc->GetNEntries();
577 for (
const auto &innerProc : fInnerProcessors) {
578 innerProc->PrintStructure(output);
585 std::unique_ptr<RNTupleProcessor> auxProcessor,
586 const std::vector<std::string> &joinFields,
589 fPrimaryProcessor(std::move(primaryProcessor)),
590 fAuxiliaryProcessor(std::move(auxProcessor)),
591 fJoinFieldNames(joinFields)
604 fEntry = std::make_shared<ROOT::Internal::RNTupleProcessorEntry>();
606 fEntry = std::move(entry);
608 fPrimaryProcessor->Initialize(fEntry);
609 fAuxiliaryProcessor->Initialize(fEntry);
611 if (!fJoinFieldNames.empty()) {
612 for (
const auto &joinField : fJoinFieldNames) {
613 if (!fPrimaryProcessor->CanReadFieldFromDisk(joinField)) {
614 throw RException(
R__FAIL(
"could not find join field \"" + joinField +
"\" in primary processor \"" +
615 fPrimaryProcessor->fOptions.GetProcessorName() +
"\""));
617 if (!fAuxiliaryProcessor->CanReadFieldFromDisk(joinField)) {
618 throw RException(
R__FAIL(
"could not find join field \"" + joinField +
"\" in auxiliary processor \"" +
619 fAuxiliaryProcessor->fOptions.GetProcessorName() +
"\""));
625 AddFieldToEntry(fOptions.GetProcessorName() +
".R_rntproc_join_" + joinField,
"std::uint64_t",
nullptr,
627 fJoinFieldIdxs.insert(fieldIdx);
635 const std::unordered_set<ROOT::Internal::RNTupleProcessorEntry::FieldIndex_t> &fieldIdxs,
640 auto auxProvenance = provenance.
Evolve(fAuxiliaryProcessor->fOptions.GetProcessorName());
641 for (
const auto &fieldIdx : fieldIdxs) {
642 const auto &fieldProvenance = fEntry->GetFieldProvenance(fieldIdx);
643 if (fieldProvenance.Contains(auxProvenance))
644 fAuxiliaryFieldIdxs.insert(fieldIdx);
646 fFieldIdxs.insert(fieldIdx);
649 fPrimaryProcessor->Connect(fFieldIdxs, provenance, updateFields);
650 fAuxiliaryProcessor->Connect(fAuxiliaryFieldIdxs, auxProvenance, updateFields);
655 fPrimaryProcessor->Disconnect();
656 fAuxiliaryProcessor->Disconnect();
664 auto auxProvenance = provenance.
Evolve(fAuxiliaryProcessor->fOptions.GetProcessorName());
665 if (auxProvenance.IsPresentInFieldName(fieldName)) {
669 if (fPrimaryProcessor->CanReadFieldFromDisk(fieldName)) {
671 "\" is present in the primary RNTupleProcessor \"" +
672 fPrimaryProcessor->fOptions.GetProcessorName() +
673 "\", but may also refer to a field in the auxiliary RNTupleProcessor named \"" +
674 fAuxiliaryProcessor->fOptions.GetProcessorName() +
675 "\". To avoid this ambiguity, rename the auxiliary RNTupleProcessor."));
678 auto fieldIdx = fAuxiliaryProcessor->AddFieldToEntry(fieldName, typeName, valuePtr, auxProvenance);
680 fAuxiliaryFieldIdxs.insert(fieldIdx);
683 auto fieldIdx = fPrimaryProcessor->AddFieldToEntry(fieldName, typeName, valuePtr, provenance);
685 fFieldIdxs.insert(fieldIdx);
692 const std::string &fieldName,
void *valuePtr,
695 auto auxProvenance = provenance.
Evolve(fAuxiliaryProcessor->GetOptions().GetProcessorName());
696 if (auxProvenance.IsPresentInFieldName(fieldName)) {
700 if (fPrimaryProcessor->CanReadFieldFromDisk(fieldName)) {
702 "\" is present in the primary RNTupleProcessor \"" +
703 fPrimaryProcessor->GetOptions().GetProcessorName() +
704 "\", but may also refer to a field in the auxiliary RNTupleProcessor named \"" +
705 fAuxiliaryProcessor->GetOptions().GetProcessorName() +
706 "\". To avoid this ambiguity, rename the auxiliary RNTupleProcessor."));
709 auto fieldIdx = fAuxiliaryProcessor->AddFieldToEntry(std::move(field), fieldName, valuePtr, auxProvenance);
710 fAuxiliaryFieldIdxs.insert(fieldIdx);
713 auto fieldIdx = fPrimaryProcessor->AddFieldToEntry(std::move(field), fieldName, valuePtr, provenance);
715 fFieldIdxs.insert(fieldIdx);
724 fPrimaryProcessor->AddAllFieldsToEntry(provenance, includeSubfields);
725 auto auxProvenance = provenance.
Evolve(fAuxiliaryProcessor->GetOptions().GetProcessorName());
726 fAuxiliaryProcessor->AddAllFieldsToEntry(auxProvenance, includeSubfields);
731 for (
const auto &fieldIdx : fAuxiliaryFieldIdxs) {
732 fEntry->SetFieldValidity(fieldIdx, isValid);
742 for (
auto fieldIdx : fFieldIdxs) {
743 fEntry->SetFieldValidity(fieldIdx,
false);
745 SetAuxiliaryFieldValidity(
false);
763 fNEntriesProcessed++;
770 if (!fJoinTableIsBuilt) {
771 fAuxiliaryProcessor->AddEntriesToJoinTable(*fJoinTable);
772 fJoinTableIsBuilt =
true;
776 std::vector<ROOT::Experimental::Internal::RNTupleJoinTable::JoinValue_t> values;
777 values.reserve(fJoinFieldIdxs.size());
778 for (
const auto &fieldIdx : fJoinFieldIdxs) {
780 values.push_back(val);
785 const auto entryIdx = fJoinTable->GetEntryIndex(values);
787 fAuxiliaryProcessor->SetEntryMapping(entryIdx, auxMapping);
790 SetAuxiliaryFieldValidity(
false);
792 SetAuxiliaryFieldValidity(
true);
793 fAuxiliaryProcessor->LoadEntry(auxMapping);
800 fNEntries = fPrimaryProcessor->GetNEntries();
807 fPrimaryProcessor->AddEntriesToJoinTable(joinTable, entryOffset);
812 std::ostringstream primaryStructureStr;
813 fPrimaryProcessor->PrintStructure(primaryStructureStr);
814 const auto primaryStructure =
ROOT::Split(primaryStructureStr.str(),
"\n",
true);
815 const auto primaryStructureWidth = primaryStructure.front().size();
817 std::ostringstream auxStructureStr;
818 fAuxiliaryProcessor->PrintStructure(auxStructureStr);
819 const auto auxStructure =
ROOT::Split(auxStructureStr.str(),
"\n",
true);
821 const auto maxLength = std::max(primaryStructure.size(), auxStructure.size());
822 for (
unsigned i = 0; i < maxLength; i++) {
823 if (i < primaryStructure.size())
824 output << primaryStructure[i];
826 output << std::setw(primaryStructureWidth) <<
"";
828 if (i < auxStructure.size())
829 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.
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