16#ifndef ROOT7_RNTupleProcessor
17#define ROOT7_RNTupleProcessor
33namespace Experimental {
36struct RNTupleProcessorEntryLoader;
265 return lh.fCurrentEntryNumber !=
rh.fCurrentEntryNumber;
269 return lh.fCurrentEntryNumber ==
rh.fCurrentEntryNumber;
284 static std::unique_ptr<RNTupleProcessor>
298 static std::unique_ptr<RNTupleProcessor>
309 static std::unique_ptr<RNTupleProcessor>
310 CreateChain(
const std::vector<RNTupleOpenSpec> &
ntuples, std::unique_ptr<RNTupleModel> model =
nullptr);
323 static std::unique_ptr<RNTupleProcessor>
CreateChain(
const std::vector<RNTupleOpenSpec> &
ntuples,
325 std::unique_ptr<RNTupleModel> model =
nullptr);
336 std::unique_ptr<RNTupleModel> model =
nullptr);
351 std::unique_ptr<RNTupleModel> model =
nullptr);
369 static std::unique_ptr<RNTupleProcessor>
371 const std::vector<std::string> &
joinFields, std::vector<std::unique_ptr<RNTupleModel>>
models = {});
392 static std::unique_ptr<RNTupleProcessor>
395 std::vector<std::unique_ptr<RNTupleModel>>
models = {});
442 std::unique_ptr<RNTupleModel> model);
505 std::vector<std::unique_ptr<Internal::RNTupleJoinTable>>
fJoinTables;
539 std::vector<std::unique_ptr<RNTupleModel>>
models = {});
549 void AddAuxiliary(
const RNTupleOpenSpec &
auxNTuple,
const std::vector<std::string> &
joinFields,
550 std::unique_ptr<RNTupleModel> model =
nullptr);
554 void ConnectFields();
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Abstract interface to read data from an ntuple.
The field token identifies a (sub)field in this entry.
The REntry is a collection of values in an ntuple corresponding to a complete row in the data set.
A field translates read and write calls from/to underlying columns to/from tree values.
Processor specialization for vertically combined (chained) RNTupleProcessors.
ROOT::NTupleSize_t GetNEntries() final
Get the total number of entries in this processor.
void SetEntryPointers(const REntry &) final
std::vector< ROOT::NTupleSize_t > fInnerNEntries
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 th...
std::vector< std::unique_ptr< RNTupleProcessor > > fInnerProcessors
Processor specialization for horizontally combined (joined) RNTuples.
RNTupleJoinProcessor(const RNTupleJoinProcessor &)=delete
RNTupleJoinProcessor(RNTupleJoinProcessor &&)=delete
void SetJoinFieldTokens(const std::vector< std::string > &joinFields)
Populate fJoinFieldTokens with tokens for join fields belonging to the main RNTuple in the join model...
std::vector< std::unique_ptr< Internal::RPageSource > > fAuxiliaryPageSources
~RNTupleJoinProcessor() override
RNTupleJoinProcessor operator=(const RNTupleJoinProcessor &)=delete
ROOT::NTupleSize_t GetNEntries() final
Get the total number of entries in this processor.
bool HasJoinTable() const
RNTupleJoinProcessor operator=(RNTupleJoinProcessor &&)=delete
std::vector< REntry::RFieldToken > fJoinFieldTokens
Tokens representing the join fields present in the main RNTuple.
std::vector< std::unique_ptr< Internal::RNTupleJoinTable > > fJoinTables
The RNTupleModel encapulates the schema of an ntuple.
Manager for a field as part of the RNTupleProcessor.
RFieldContext(std::unique_ptr< RFieldBase > protoField, REntry::RFieldToken token, std::size_t ntupleIdx=0)
std::unique_ptr< RFieldBase > fConcreteField
void ResetConcreteField()
Concrete pages need to be reset explicitly before the page source they belong to is destroyed.
std::unique_ptr< RFieldBase > fProtoField
REntry::RFieldToken fToken
const RFieldBase & GetProtoField() const
Iterator over the entries of an RNTuple, or vertical concatenation thereof.
RNTupleProcessor & fProcessor
std::forward_iterator_tag iterator_category
std::ptrdiff_t difference_type
friend bool operator==(const iterator &lh, const iterator &rh)
friend bool operator!=(const iterator &lh, const iterator &rh)
ROOT::NTupleSize_t fCurrentEntryNumber
RIterator(RNTupleProcessor &processor, ROOT::NTupleSize_t entryNumber)
Interface for iterating over entries of RNTuples and vertically concatenated RNTuples (chains).
const std::string & GetProcessorName() const
Get the name of the processor.
virtual ROOT::NTupleSize_t GetNEntries()=0
Get the total number of entries in this processor.
std::size_t fCurrentProcessorNumber
const RNTupleModel & GetModel() const
Get the model used by the processor.
const REntry & GetEntry() const
Get a reference to the entry used by the processor.
ROOT::NTupleSize_t fNEntries
Total number of entries.
friend struct ROOT::Experimental::Internal::RNTupleProcessorEntryLoader
friend class RNTupleJoinProcessor
static std::unique_ptr< RNTupleProcessor > Create(const RNTupleOpenSpec &ntuple, std::unique_ptr< RNTupleModel > model=nullptr)
Create an RNTupleProcessor for a single RNTuple.
virtual ~RNTupleProcessor()=default
RNTupleProcessor(RNTupleProcessor &&)=delete
virtual void SetEntryPointers(const REntry &entry)=0
Point the entry's field values of the processor to the pointers from the provided entry.
static std::unique_ptr< RNTupleProcessor > CreateChain(const std::vector< RNTupleOpenSpec > &ntuples, std::unique_ptr< RNTupleModel > model=nullptr)
Create an RNTupleProcessor for a chain (i.e., a vertical combination) of RNTuples.
virtual ROOT::NTupleSize_t LoadEntry(ROOT::NTupleSize_t entryNumber)=0
Load the entry identified by the provided entry number.
std::unordered_map< std::string, RFieldContext > fFieldContexts
Maps the (qualified) field name to its corresponding field context.
ROOT::NTupleSize_t GetCurrentEntryNumber() const
Get the entry number that is currently being processed.
ROOT::NTupleSize_t fNEntriesProcessed
RNTupleProcessor(std::string_view processorName, std::unique_ptr< RNTupleModel > model)
Create a new base RNTupleProcessor.
std::string fProcessorName
std::unique_ptr< RNTupleModel > fModel
std::size_t GetCurrentProcessorNumber() const
Get the number of the inner processor currently being read.
ROOT::NTupleSize_t fCurrentEntryNumber
std::unique_ptr< REntry > fEntry
ROOT::NTupleSize_t GetNEntriesProcessed() const
Get the total number of entries processed so far.
RNTupleProcessor(const RNTupleProcessor &)=delete
RNTupleProcessor & operator=(RNTupleProcessor &&)=delete
friend class RNTupleSingleProcessor
void ConnectField(RFieldContext &fieldContext, Internal::RPageSource &pageSource, REntry &entry)
Create and connect a concrete field to the current page source, based on its proto field.
std::unique_ptr< Internal::RPageSource > fPageSource
static std::unique_ptr< RNTupleProcessor > CreateJoin(const RNTupleOpenSpec &primaryNTuple, const std::vector< RNTupleOpenSpec > &auxNTuples, const std::vector< std::string > &joinFields, std::vector< std::unique_ptr< RNTupleModel > > models={})
Create an RNTupleProcessor for a join (i.e., a horizontal combination) of RNTuples.
std::vector< RNTupleOpenSpec > fNTuples
RNTupleProcessor & operator=(const RNTupleProcessor &)=delete
Processor specialization for processing a single RNTuple.
RNTupleOpenSpec fNTupleSpec
void Connect()
Connect the page source of the underlying RNTuple.
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 th...
ROOT::NTupleSize_t GetNEntries() final
Get the total number of entries in this processor.
void SetEntryPointers(const REntry &entry) final
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
constexpr NTupleSize_t kInvalidNTupleIndex
std::uint64_t NTupleSize_t
Integer type long enough to hold the maximum number of entries in a column.
Used to specify the underlying RNTuples in RNTupleProcessor.
RNTupleOpenSpec(std::string_view n, std::string_view s)