Logo ROOT  
Reference Guide
Loading...
Searching...
No Matches
ROOT::Experimental::RNTupleChainProcessor Class Reference

Processor specialization for vertically combined (chained) RNTupleProcessors.

Definition at line 647 of file RNTupleProcessor.hxx.

Public Member Functions

 RNTupleChainProcessor (const RNTupleChainProcessor &)=delete
 RNTupleChainProcessor (RNTupleChainProcessor &&)=delete
 ~RNTupleChainProcessor () override=default
RIterator begin ()
RIterator end ()
ROOT::NTupleSize_t GetCurrentEntryNumber () const
 Get the entry number that is currently being processed.
std::size_t GetCurrentProcessorNumber () const
 Get the number of the inner processor currently being read.
ROOT::NTupleSize_t GetNEntriesProcessed () const
 Get the total number of entries processed so far.
const std::string & GetProcessorName () const
 Get the name of the processor.
RNTupleChainProcessoroperator= (const RNTupleChainProcessor &)=delete
RNTupleChainProcessoroperator= (RNTupleChainProcessor &&)=delete
void PrintStructure (std::ostream &output=std::cout)
 Print a graphical representation of the processor composition.
template<typename T>
RNTupleProcessorOptionalPtr< T > RequestField (std::string_view fieldName, void *valuePtr=nullptr)
 Request access to a field for reading during processing.

Static Public Member Functions

static std::unique_ptr< RNTupleProcessorCreate (RNTupleOpenSpec ntuple, std::string_view processorName="")
 Create an RNTupleProcessor for a single RNTuple.
static std::unique_ptr< RNTupleProcessorCreateChain (std::vector< RNTupleOpenSpec > ntuples, std::string_view processorName="")
 Create an RNTupleProcessor for a chain (i.e., a vertical combination) of RNTuples.
static std::unique_ptr< RNTupleProcessorCreateChain (std::vector< std::unique_ptr< RNTupleProcessor > > innerProcessors, std::string_view processorName="")
 Create an RNTupleProcessor for a chain (i.e., a vertical combination) of other RNTupleProcessors.
static std::unique_ptr< RNTupleProcessorCreateJoin (RNTupleOpenSpec primaryNTuple, RNTupleOpenSpec auxNTuple, const std::vector< std::string > &joinFields, std::string_view processorName="")
 Create an RNTupleProcessor for a join (i.e., a horizontal combination) of RNTuples.
static std::unique_ptr< RNTupleProcessorCreateJoin (std::unique_ptr< RNTupleProcessor > primaryProcessor, std::unique_ptr< RNTupleProcessor > auxProcessor, const std::vector< std::string > &joinFields, std::string_view processorName="")
 Create an RNTupleProcessor for a join (i.e., a horizontal combination) of RNTuples.

Protected Member Functions

const ROOT::RNTupleModelGetProtoModel () const
 Get the proto model used by the processor.
bool IsInitialized () const
 Check if the processor already has been initialized.

Protected Attributes

ROOT::NTupleSize_t fCurrentEntryNumber = 0
std::size_t fCurrentProcessorNumber = 0
std::shared_ptr< Internal::RNTupleProcessorEntryfEntry = nullptr
std::unordered_set< Internal::RNTupleProcessorEntry::FieldIndex_tfFieldIdxs
ROOT::NTupleSize_t fNEntries = kInvalidNTupleIndex
 Total number of entries.
ROOT::NTupleSize_t fNEntriesProcessed = 0
std::string fProcessorName
std::unique_ptr< ROOT::RNTupleModelfProtoModel = nullptr

Private Member Functions

 RNTupleChainProcessor (std::vector< std::unique_ptr< RNTupleProcessor > > processors, std::string_view processorName)
 Construct a new RNTupleChainProcessor.
void AddEntriesToJoinTable (Internal::RNTupleJoinTable &joinTable, ROOT::NTupleSize_t entryOffset=0) final
 Add the entry mappings for this processor to the provided join table.
ROOT::RResult< Internal::RNTupleProcessorEntry::FieldIndex_tAddFieldToEntry (std::string_view fieldName, void *valuePtr=nullptr, const Internal::RNTupleProcessorProvenance &provenance=Internal::RNTupleProcessorProvenance()) final
 Add a field to the entry.
bool CanReadFieldFromDisk (std::string_view fieldName) final
 Check if a field exists on-disk and can be read by the 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 ConnectInnerProcessor (std::size_t processorNumber)
 Update the entry to reflect any missing fields in the current inner processor.
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 setting fProtoModel and creating an (initially empty) fEntry, or setting an existing one.
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 this processor).
void PrintStructureImpl (std::ostream &output) const final
 Processor-specific implementation for printing its structure, called by PrintStructure().

Private Attributes

std::vector< ROOT::NTupleSize_tfInnerNEntries
std::vector< std::unique_ptr< RNTupleProcessor > > fInnerProcessors
Internal::RNTupleProcessorProvenance fProvenance

Friends

class RNTupleProcessor

#include <ROOT/RNTupleProcessor.hxx>

Inheritance diagram for ROOT::Experimental::RNTupleChainProcessor:
ROOT::Experimental::RNTupleProcessor

Constructor & Destructor Documentation

◆ RNTupleChainProcessor() [1/3]

ROOT::Experimental::RNTupleChainProcessor::RNTupleChainProcessor ( std::vector< std::unique_ptr< RNTupleProcessor > > processors,
std::string_view processorName )
private

Construct a new RNTupleChainProcessor.

Parameters
[in]ntuplesThe source specification (name and storage location) for each RNTuple to process.
[in]processorNameName of the processor. Unless specified otherwise in RNTupleProcessor::CreateChain, this is the name of the first inner processor.

RNTuples are processed in the order in which they are specified.

Definition at line 264 of file RNTupleProcessor.cxx.

◆ RNTupleChainProcessor() [2/3]

ROOT::Experimental::RNTupleChainProcessor::RNTupleChainProcessor ( const RNTupleChainProcessor & )
delete

◆ RNTupleChainProcessor() [3/3]

ROOT::Experimental::RNTupleChainProcessor::RNTupleChainProcessor ( RNTupleChainProcessor && )
delete

◆ ~RNTupleChainProcessor()

ROOT::Experimental::RNTupleChainProcessor::~RNTupleChainProcessor ( )
overridedefault

Member Function Documentation

◆ AddEntriesToJoinTable()

void ROOT::Experimental::RNTupleChainProcessor::AddEntriesToJoinTable ( Internal::RNTupleJoinTable & joinTable,
ROOT::NTupleSize_t entryOffset = 0 )
finalprivatevirtual

Add the entry mappings for this processor to the provided join table.

See also
ROOT::Experimental::RNTupleProcessor::AddEntriesToJoinTable

Implements ROOT::Experimental::RNTupleProcessor.

Definition at line 364 of file RNTupleProcessor.cxx.

◆ AddFieldToEntry()

ROOT::RResult< ROOT::Experimental::Internal::RNTupleProcessorEntry::FieldIndex_t > ROOT::Experimental::RNTupleChainProcessor::AddFieldToEntry ( std::string_view fieldName,
void * valuePtr = nullptr,
const Internal::RNTupleProcessorProvenance & provenance = Internal::RNTupleProcessorProvenance() )
finalprivatevirtual

Add a field to the entry.

See also
RNTupleProcessor::AddFieldToEntry()

Implements ROOT::Experimental::RNTupleProcessor.

Definition at line 326 of file RNTupleProcessor.cxx.

◆ begin()

RIterator ROOT::Experimental::RNTupleProcessor::begin ( )
inlineinherited

Definition at line 482 of file RNTupleProcessor.hxx.

◆ CanReadFieldFromDisk()

bool ROOT::Experimental::RNTupleChainProcessor::CanReadFieldFromDisk ( std::string_view fieldName)
inlinefinalprivatevirtual

Check if a field exists on-disk and can be read by the processor.

See also
RNTupleProcessor::CanReadFieldFromDisk()

Implements ROOT::Experimental::RNTupleProcessor.

Definition at line 690 of file RNTupleProcessor.hxx.

◆ Connect()

void ROOT::Experimental::RNTupleChainProcessor::Connect ( const std::unordered_set< Internal::RNTupleProcessorEntry::FieldIndex_t > & fieldIdxs,
const Internal::RNTupleProcessorProvenance & provenance = Internal::RNTupleProcessorProvenance(),
bool updateFields = false )
finalprivatevirtual

Connect the provided fields indices in the entry to their on-disk fields.

See also
RNTupleProcessor::Connect()

Implements ROOT::Experimental::RNTupleProcessor.

Definition at line 308 of file RNTupleProcessor.cxx.

◆ ConnectInnerProcessor()

void ROOT::Experimental::RNTupleChainProcessor::ConnectInnerProcessor ( std::size_t processorNumber)
private

Update the entry to reflect any missing fields in the current inner processor.

Definition at line 318 of file RNTupleProcessor.cxx.

◆ Create()

std::unique_ptr< ROOT::Experimental::RNTupleProcessor > ROOT::Experimental::RNTupleProcessor::Create ( RNTupleOpenSpec ntuple,
std::string_view processorName = "" )
staticinherited

Create an RNTupleProcessor for a single RNTuple.

Parameters
[in]ntupleThe name and storage location of the RNTuple to process.
[in]processorNameThe name to give to the processor. If empty, the name of the input RNTuple is used.
Returns
A pointer to the newly created RNTupleProcessor.

Definition at line 37 of file RNTupleProcessor.cxx.

◆ CreateChain() [1/2]

std::unique_ptr< ROOT::Experimental::RNTupleProcessor > ROOT::Experimental::RNTupleProcessor::CreateChain ( std::vector< RNTupleOpenSpec > ntuples,
std::string_view processorName = "" )
staticinherited

Create an RNTupleProcessor for a chain (i.e., a vertical combination) of RNTuples.

Parameters
[in]ntuplesA list specifying the names and locations of the RNTuples to process.
[in]processorNameThe name to give to the processor. If empty, the name of the first RNTuple is used.
Returns
A pointer to the newly created RNTupleProcessor.

Definition at line 43 of file RNTupleProcessor.cxx.

◆ CreateChain() [2/2]

std::unique_ptr< ROOT::Experimental::RNTupleProcessor > ROOT::Experimental::RNTupleProcessor::CreateChain ( std::vector< std::unique_ptr< RNTupleProcessor > > innerProcessors,
std::string_view processorName = "" )
staticinherited

Create an RNTupleProcessor for a chain (i.e., a vertical combination) of other RNTupleProcessors.

Parameters
[in]innerProcessorsA list with the processors to chain.
[in]processorNameThe name to give to the processor. If empty, the name of the first inner processor is used.
Returns
A pointer to the newly created RNTupleProcessor.

Definition at line 59 of file RNTupleProcessor.cxx.

◆ CreateJoin() [1/2]

std::unique_ptr< ROOT::Experimental::RNTupleProcessor > ROOT::Experimental::RNTupleProcessor::CreateJoin ( RNTupleOpenSpec primaryNTuple,
RNTupleOpenSpec auxNTuple,
const std::vector< std::string > & joinFields,
std::string_view processorName = "" )
staticinherited

Create an RNTupleProcessor for a join (i.e., a horizontal combination) of RNTuples.

Parameters
[in]primaryNTupleThe name and location of the primary RNTuple. Its entries are processed in sequential order.
[in]auxNTupleThe name and location of the RNTuple to join the primary RNTuple with. The order in which its entries are processed is determined by the primary RNTuple and doesn't necessarily have to be sequential.
[in]joinFieldsThe names of the fields on which to join, in case the specified RNTuples are unaligned. The join is made based on the combined join field values, and therefore each field has to be present in each specified RNTuple. If an empty list is provided, it is assumed that the specified ntuple are fully aligned.
[in]processorNameThe name to give to the processor. If empty, the name of the primary RNTuple is used.
Returns
A pointer to the newly created RNTupleProcessor.

Definition at line 69 of file RNTupleProcessor.cxx.

◆ CreateJoin() [2/2]

std::unique_ptr< ROOT::Experimental::RNTupleProcessor > ROOT::Experimental::RNTupleProcessor::CreateJoin ( std::unique_ptr< RNTupleProcessor > primaryProcessor,
std::unique_ptr< RNTupleProcessor > auxProcessor,
const std::vector< std::string > & joinFields,
std::string_view processorName = "" )
staticinherited

Create an RNTupleProcessor for a join (i.e., a horizontal combination) of RNTuples.

Parameters
[in]primaryProcessorThe primary processor. Its entries are processed in sequential order.
[in]auxProcessorThe processor to join the primary processor with. The order in which its entries are processed is determined by the primary processor and doesn't necessarily have to be sequential.
[in]joinFieldsThe names of the fields on which to join, in case the specified processors are unaligned. The join is made based on the combined join field values, and therefore each field has to be present in each specified processors. If an empty list is provided, it is assumed that the specified processors are fully aligned.
[in]processorNameThe name to give to the processor. If empty, the name of the primary processor is used.
Returns
A pointer to the newly created RNTupleProcessor.

Definition at line 89 of file RNTupleProcessor.cxx.

◆ end()

RIterator ROOT::Experimental::RNTupleProcessor::end ( )
inlineinherited

Definition at line 483 of file RNTupleProcessor.hxx.

◆ GetCurrentEntryNumber()

ROOT::NTupleSize_t ROOT::Experimental::RNTupleProcessor::GetCurrentEntryNumber ( ) const
inlineinherited

Get the entry number that is currently being processed.

Definition at line 363 of file RNTupleProcessor.hxx.

◆ GetCurrentProcessorNumber()

std::size_t ROOT::Experimental::RNTupleProcessor::GetCurrentProcessorNumber ( ) const
inlineinherited

Get the number of the inner processor currently being read.

This method is only relevant for the RNTupleChainProcessor. For the other processors, 0 is always returned.

Definition at line 369 of file RNTupleProcessor.hxx.

◆ GetNEntries()

ROOT::NTupleSize_t ROOT::Experimental::RNTupleChainProcessor::GetNEntries ( )
finalprivatevirtual

Get the total number of entries in this processor.

Note
This requires opening all underlying RNTuples being processed in the chain, and could become costly!

Implements ROOT::Experimental::RNTupleProcessor.

Definition at line 291 of file RNTupleProcessor.cxx.

◆ GetNEntriesProcessed()

ROOT::NTupleSize_t ROOT::Experimental::RNTupleProcessor::GetNEntriesProcessed ( ) const
inlineinherited

Get the total number of entries processed so far.

Definition at line 359 of file RNTupleProcessor.hxx.

◆ GetProcessorName()

const std::string & ROOT::Experimental::RNTupleProcessor::GetProcessorName ( ) const
inlineinherited

Get the name of the processor.

Unless this name was explicitly specified during creation of the processor, this is the name of the underlying RNTuple for RNTupleSingleProcessor, the name of the first processor for RNTupleChainProcessor, or the name of the primary processor for RNTupleJoinProcessor.

Definition at line 377 of file RNTupleProcessor.hxx.

◆ GetProtoModel()

const ROOT::RNTupleModel & ROOT::Experimental::RNTupleProcessor::GetProtoModel ( ) const
inlineprotectedinherited

Get the proto model used by the processor.

A processor's proto model contains all fields that can be accessed and is inferred from the descriptors of the underlying RNTuples. It is used in RequestField() to check that the requested field is actually valid.

Definition at line 296 of file RNTupleProcessor.hxx.

◆ Initialize()

void ROOT::Experimental::RNTupleChainProcessor::Initialize ( std::shared_ptr< Internal::RNTupleProcessorEntry > entry = nullptr)
finalprivatevirtual

Initialize the processor, by setting fProtoModel and creating an (initially empty) fEntry, or setting an existing one.

Implements ROOT::Experimental::RNTupleProcessor.

Definition at line 276 of file RNTupleProcessor.cxx.

◆ IsInitialized()

bool ROOT::Experimental::RNTupleProcessor::IsInitialized ( ) const
inlineprotectedinherited

Check if the processor already has been initialized.

Definition at line 271 of file RNTupleProcessor.hxx.

◆ LoadEntry()

ROOT::NTupleSize_t ROOT::Experimental::RNTupleChainProcessor::LoadEntry ( ROOT::NTupleSize_t entryNumber)
finalprivatevirtual

Load the entry identified by the provided (global) entry number (i.e., considering all RNTuples in this processor).

See also
ROOT::Experimental::RNTupleProcessor::LoadEntry

Implements ROOT::Experimental::RNTupleProcessor.

Definition at line 333 of file RNTupleProcessor.cxx.

◆ operator=() [1/2]

RNTupleChainProcessor & ROOT::Experimental::RNTupleChainProcessor::operator= ( const RNTupleChainProcessor & )
delete

◆ operator=() [2/2]

RNTupleChainProcessor & ROOT::Experimental::RNTupleChainProcessor::operator= ( RNTupleChainProcessor && )
delete

◆ PrintStructure()

void ROOT::Experimental::RNTupleProcessor::PrintStructure ( std::ostream & output = std::cout)
inlineinherited

Print a graphical representation of the processor composition.

Parameters
[in,out]outputStream to print to (default is stdout).

Example:

The structure of a processor representing a join between a single primary RNTuple and a chain of two auxiliary RNTuples will be printed as follows:

+-----------------------------+ +-----------------------------+
| ntuple | | ntuple_aux |
| ntuple.root | | ntuple_aux1.root |
+-----------------------------+ +-----------------------------+
+-----------------------------+
| ntuple_aux |
| ntuple_aux2.root |
+-----------------------------+

Definition at line 420 of file RNTupleProcessor.hxx.

◆ PrintStructureImpl()

void ROOT::Experimental::RNTupleChainProcessor::PrintStructureImpl ( std::ostream & output) const
finalprivatevirtual

Processor-specific implementation for printing its structure, called by PrintStructure().

See also
ROOT::Experimental::RNTupleProcessor::PrintStructureImpl

Implements ROOT::Experimental::RNTupleProcessor.

Definition at line 377 of file RNTupleProcessor.cxx.

◆ RequestField()

template<typename T>
RNTupleProcessorOptionalPtr< T > ROOT::Experimental::RNTupleProcessor::RequestField ( std::string_view fieldName,
void * valuePtr = nullptr )
inlineinherited

Request access to a field for reading during processing.

Template Parameters
TType of the requested field.
Parameters
[in]fieldNameName of the requested field.
Returns
An RNTupleProcessorOptionalPtr, which provides access to the field's value.
Warning
Provide a valuePtr with care! Values may not always be valid for every entry during processing, for example when a field is not present in one of the chained processors or when during a join operation, no matching entry in the auxiliary processor can be found. Reading valuePtr as-is therefore comes with the risk of reading invalid data. After passing a pointer to RequestField, we strongly recommend only accessing its data through the interface of the returned RNTupleProcessorOptionalPtr, to ensure that only valid data can be read.

Definition at line 394 of file RNTupleProcessor.hxx.

◆ RNTupleProcessor

friend class RNTupleProcessor
friend

Definition at line 648 of file RNTupleProcessor.hxx.

Member Data Documentation

◆ fCurrentEntryNumber

ROOT::NTupleSize_t ROOT::Experimental::RNTupleProcessor::fCurrentEntryNumber = 0
protectedinherited

Definition at line 261 of file RNTupleProcessor.hxx.

◆ fCurrentProcessorNumber

std::size_t ROOT::Experimental::RNTupleProcessor::fCurrentProcessorNumber = 0
protectedinherited

Definition at line 262 of file RNTupleProcessor.hxx.

◆ fEntry

std::shared_ptr<Internal::RNTupleProcessorEntry> ROOT::Experimental::RNTupleProcessor::fEntry = nullptr
protectedinherited

Definition at line 253 of file RNTupleProcessor.hxx.

◆ fFieldIdxs

std::unordered_set<Internal::RNTupleProcessorEntry::FieldIndex_t> ROOT::Experimental::RNTupleProcessor::fFieldIdxs
protectedinherited

Definition at line 254 of file RNTupleProcessor.hxx.

◆ fInnerNEntries

std::vector<ROOT::NTupleSize_t> ROOT::Experimental::RNTupleChainProcessor::fInnerNEntries
private

Definition at line 652 of file RNTupleProcessor.hxx.

◆ fInnerProcessors

std::vector<std::unique_ptr<RNTupleProcessor> > ROOT::Experimental::RNTupleChainProcessor::fInnerProcessors
private

Definition at line 651 of file RNTupleProcessor.hxx.

◆ fNEntries

ROOT::NTupleSize_t ROOT::Experimental::RNTupleProcessor::fNEntries = kInvalidNTupleIndex
protectedinherited

Total number of entries.

Only to be used internally by the processor, not meant to be exposed in the public interface.

Definition at line 258 of file RNTupleProcessor.hxx.

◆ fNEntriesProcessed

ROOT::NTupleSize_t ROOT::Experimental::RNTupleProcessor::fNEntriesProcessed = 0
protectedinherited

Definition at line 260 of file RNTupleProcessor.hxx.

◆ fProcessorName

std::string ROOT::Experimental::RNTupleProcessor::fProcessorName
protectedinherited

Definition at line 251 of file RNTupleProcessor.hxx.

◆ fProtoModel

std::unique_ptr<ROOT::RNTupleModel> ROOT::Experimental::RNTupleProcessor::fProtoModel = nullptr
protectedinherited

Definition at line 252 of file RNTupleProcessor.hxx.

◆ fProvenance

Internal::RNTupleProcessorProvenance ROOT::Experimental::RNTupleChainProcessor::fProvenance
private

Definition at line 654 of file RNTupleProcessor.hxx.


The documentation for this class was generated from the following files: