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

Processor specialization for horizontally combined (joined) RNTupleProcessors.

Definition at line 779 of file RNTupleProcessor.hxx.

Public Member Functions

 RNTupleJoinProcessor (const RNTupleJoinProcessor &)=delete
 
 RNTupleJoinProcessor (RNTupleJoinProcessor &&)=delete
 
 ~RNTupleJoinProcessor () 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 RNTupleProcessorOptionsGetOptions () const
 Get the options used for this processor.
 
RNTupleJoinProcessor operator= (const RNTupleJoinProcessor &)=delete
 
RNTupleJoinProcessor operator= (RNTupleJoinProcessor &&)=delete
 
void PrintStructure (std::ostream &output=std::cout)
 Print a graphical representation of the processor composition.
 
RNTupleProcessorOptionalPtr< void > RequestField (const std::string &fieldName, const std::string &typeName, void *valuePtr=nullptr)
 Request access to a field for reading during processing.
 
template<typename T >
RNTupleProcessorOptionalPtr< T > RequestField (const std::string &fieldName, void *valuePtr=nullptr)
 Request access to a field for reading during processing.
 

Static Public Member Functions

static std::unique_ptr< RNTupleProcessorCreate (RNTupleOpenSpec ntuple, const RNTupleProcessorOptions &opts=RNTupleProcessorOptions())
 Create an RNTupleProcessor for a single RNTuple.
 
static std::unique_ptr< RNTupleProcessorCreateChain (std::vector< RNTupleOpenSpec > ntuples, const RNTupleProcessorOptions &opts=RNTupleProcessorOptions())
 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, const RNTupleProcessorOptions &opts=RNTupleProcessorOptions())
 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, const RNTupleProcessorOptions &opts=RNTupleProcessorOptions())
 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, const RNTupleProcessorOptions &opts=RNTupleProcessorOptions())
 Create an RNTupleProcessor for a join (i.e., a horizontal combination) of RNTuples.
 

Protected Member Functions

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
 
RNTupleProcessorOptions fOptions
 

Private Member Functions

 RNTupleJoinProcessor (std::unique_ptr< RNTupleProcessor > primaryProcessor, std::unique_ptr< RNTupleProcessor > auxProcessor, const std::vector< std::string > &joinFields, const RNTupleProcessorOptions &opts)
 Construct a new RNTupleJoinProcessor.
 
void AddEntriesToJoinTable (Internal::RNTupleJoinTable &joinTable, ROOT::NTupleSize_t entryOffset=0) final
 Add the entry mappings for this processor to the provided join table.
 
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.
 
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.
 
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.
 
ROOT::NTupleSize_t LoadEntry (ROOT::NTupleSize_t entryNumber) final
 Load the entry identified by the provided entry number of the primary processor.
 
void PrintStructureImpl (std::ostream &output) const final
 Processor-specific implementation for printing its structure, called by PrintStructure().
 
void SetAuxiliaryFieldValidity (bool validity)
 Set the validity for all fields in the auxiliary processor at once.
 

Private Attributes

std::unordered_set< Internal::RNTupleProcessorEntry::FieldIndex_tfAuxiliaryFieldIdxs
 
std::unique_ptr< RNTupleProcessorfAuxiliaryProcessor
 
std::set< Internal::RNTupleProcessorEntry::FieldIndex_tfJoinFieldIdxs
 
std::vector< std::string > fJoinFieldNames
 
std::unique_ptr< Internal::RNTupleJoinTablefJoinTable
 
bool fJoinTableIsBuilt = false
 
std::unique_ptr< RNTupleProcessorfPrimaryProcessor
 

Friends

class RNTupleProcessor
 

#include <ROOT/RNTupleProcessor.hxx>

Inheritance diagram for ROOT::Experimental::RNTupleJoinProcessor:
[legend]

Constructor & Destructor Documentation

◆ RNTupleJoinProcessor() [1/3]

ROOT::Experimental::RNTupleJoinProcessor::RNTupleJoinProcessor ( std::unique_ptr< RNTupleProcessor > primaryProcessor,
std::unique_ptr< RNTupleProcessor > auxProcessor,
const std::vector< std::string > & joinFields,
const RNTupleProcessorOptions & opts )
private

Construct a new RNTupleJoinProcessor.

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 processor. If an empty list is provided, it is assumed that the processors are fully aligned.
[in]optsOptions for the processor.

Definition at line 412 of file RNTupleProcessor.cxx.

◆ RNTupleJoinProcessor() [2/3]

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

◆ RNTupleJoinProcessor() [3/3]

ROOT::Experimental::RNTupleJoinProcessor::RNTupleJoinProcessor ( RNTupleJoinProcessor && )
delete

◆ ~RNTupleJoinProcessor()

ROOT::Experimental::RNTupleJoinProcessor::~RNTupleJoinProcessor ( )
overridedefault

Member Function Documentation

◆ AddEntriesToJoinTable()

void ROOT::Experimental::RNTupleJoinProcessor::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 572 of file RNTupleProcessor.cxx.

◆ AddFieldToEntry()

ROOT::Experimental::Internal::RNTupleProcessorEntry::FieldIndex_t ROOT::Experimental::RNTupleJoinProcessor::AddFieldToEntry ( const std::string & fieldName,
const std::string & typeName,
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 482 of file RNTupleProcessor.cxx.

◆ begin()

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

Definition at line 511 of file RNTupleProcessor.hxx.

◆ CanReadFieldFromDisk()

bool ROOT::Experimental::RNTupleJoinProcessor::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 823 of file RNTupleProcessor.hxx.

◆ Connect()

void ROOT::Experimental::RNTupleJoinProcessor::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 462 of file RNTupleProcessor.cxx.

◆ Create()

std::unique_ptr< ROOT::Experimental::RNTupleProcessor > ROOT::Experimental::RNTupleProcessor::Create ( RNTupleOpenSpec ntuple,
const RNTupleProcessorOptions & opts = RNTupleProcessorOptions() )
staticinherited

Create an RNTupleProcessor for a single RNTuple.

Parameters
[in]ntupleThe name and storage location of the RNTuple to process.
[in]optsOptions for the processor.
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,
const RNTupleProcessorOptions & opts = RNTupleProcessorOptions() )
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]optsOptions for the processor.
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,
const RNTupleProcessorOptions & opts = RNTupleProcessorOptions() )
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]optsOptions for the processor.
Returns
A pointer to the newly created RNTupleProcessor.

Definition at line 60 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,
const RNTupleProcessorOptions & opts = RNTupleProcessorOptions() )
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]optsOptions for the processor.
Returns
A pointer to the newly created RNTupleProcessor.

Definition at line 70 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,
const RNTupleProcessorOptions & opts = RNTupleProcessorOptions() )
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]optsOptions for the processor.
Returns
A pointer to the newly created RNTupleProcessor.

Definition at line 90 of file RNTupleProcessor.cxx.

◆ end()

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

Definition at line 512 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 372 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 378 of file RNTupleProcessor.hxx.

◆ GetNEntries()

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

Get the total number of entries in this processor.

Implements ROOT::Experimental::RNTupleProcessor.

Definition at line 565 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 368 of file RNTupleProcessor.hxx.

◆ GetOptions()

const RNTupleProcessorOptions & ROOT::Experimental::RNTupleProcessor::GetOptions ( ) const
inlineinherited

Get the options used for this processor.

Definition at line 364 of file RNTupleProcessor.hxx.

◆ Initialize()

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

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

Implements ROOT::Experimental::RNTupleProcessor.

Definition at line 426 of file RNTupleProcessor.cxx.

◆ IsInitialized()

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

Check if the processor already has been initialized.

Definition at line 286 of file RNTupleProcessor.hxx.

◆ LoadEntry()

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

Load the entry identified by the provided entry number of the primary processor.

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

Implements ROOT::Experimental::RNTupleProcessor.

Definition at line 519 of file RNTupleProcessor.cxx.

◆ operator=() [1/2]

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

◆ operator=() [2/2]

RNTupleJoinProcessor ROOT::Experimental::RNTupleJoinProcessor::operator= ( RNTupleJoinProcessor && )
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.root | | ntuple_aux1.root |
+-----------------------------+ +-----------------------------+
+-----------------------------+
| ntuple_aux2.root |
+-----------------------------+

Definition at line 449 of file RNTupleProcessor.hxx.

◆ PrintStructureImpl()

void ROOT::Experimental::RNTupleJoinProcessor::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 578 of file RNTupleProcessor.cxx.

◆ RequestField() [1/2]

RNTupleProcessorOptionalPtr< void > ROOT::Experimental::RNTupleProcessor::RequestField ( const std::string & fieldName,
const std::string & typeName,
void * valuePtr = nullptr )
inlineinherited

Request access to a field for reading during processing.

Parameters
[in]fieldNameName of the requested field.
[in]typeNameType of the requested field.
[in]valuePtrPointer to bind to the field's value in the entry. If this is a nullptr, a pointer will be created.
Returns
An void-type 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 424 of file RNTupleProcessor.hxx.

◆ RequestField() [2/2]

template<typename T >
RNTupleProcessorOptionalPtr< T > ROOT::Experimental::RNTupleProcessor::RequestField ( const std::string & 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.
[in]valuePtrPointer to bind to the field's value in the entry. If this is a nullptr, a pointer will be created.
Returns
An RNTupleProcessorOptionalPtr of type T, 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 397 of file RNTupleProcessor.hxx.

◆ SetAuxiliaryFieldValidity()

void ROOT::Experimental::RNTupleJoinProcessor::SetAuxiliaryFieldValidity ( bool validity)
private

Set the validity for all fields in the auxiliary processor at once.

Definition at line 512 of file RNTupleProcessor.cxx.

Friends And Related Symbol Documentation

◆ RNTupleProcessor

friend class RNTupleProcessor
friend

Definition at line 780 of file RNTupleProcessor.hxx.

Member Data Documentation

◆ fAuxiliaryFieldIdxs

std::unordered_set<Internal::RNTupleProcessorEntry::FieldIndex_t> ROOT::Experimental::RNTupleJoinProcessor::fAuxiliaryFieldIdxs
private

Definition at line 792 of file RNTupleProcessor.hxx.

◆ fAuxiliaryProcessor

std::unique_ptr<RNTupleProcessor> ROOT::Experimental::RNTupleJoinProcessor::fAuxiliaryProcessor
private

Definition at line 784 of file RNTupleProcessor.hxx.

◆ fCurrentEntryNumber

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

Definition at line 277 of file RNTupleProcessor.hxx.

◆ fCurrentProcessorNumber

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

Definition at line 278 of file RNTupleProcessor.hxx.

◆ fEntry

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

Definition at line 269 of file RNTupleProcessor.hxx.

◆ fFieldIdxs

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

Definition at line 270 of file RNTupleProcessor.hxx.

◆ fJoinFieldIdxs

std::set<Internal::RNTupleProcessorEntry::FieldIndex_t> ROOT::Experimental::RNTupleJoinProcessor::fJoinFieldIdxs
private

Definition at line 787 of file RNTupleProcessor.hxx.

◆ fJoinFieldNames

std::vector<std::string> ROOT::Experimental::RNTupleJoinProcessor::fJoinFieldNames
private

Definition at line 786 of file RNTupleProcessor.hxx.

◆ fJoinTable

std::unique_ptr<Internal::RNTupleJoinTable> ROOT::Experimental::RNTupleJoinProcessor::fJoinTable
private

Definition at line 789 of file RNTupleProcessor.hxx.

◆ fJoinTableIsBuilt

bool ROOT::Experimental::RNTupleJoinProcessor::fJoinTableIsBuilt = false
private

Definition at line 790 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 274 of file RNTupleProcessor.hxx.

◆ fNEntriesProcessed

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

Definition at line 276 of file RNTupleProcessor.hxx.

◆ fOptions

RNTupleProcessorOptions ROOT::Experimental::RNTupleProcessor::fOptions
protectedinherited

Definition at line 267 of file RNTupleProcessor.hxx.

◆ fPrimaryProcessor

std::unique_ptr<RNTupleProcessor> ROOT::Experimental::RNTupleJoinProcessor::fPrimaryProcessor
private

Definition at line 783 of file RNTupleProcessor.hxx.

Libraries for ROOT::Experimental::RNTupleJoinProcessor:

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