29 auto dir = std::get<TDirectory *>(
fStorage);
34std::unique_ptr<ROOT::Experimental::RNTupleProcessor>
41std::unique_ptr<ROOT::Experimental::RNTupleProcessor>
43 std::unique_ptr<ROOT::RNTupleModel> model)
45 return std::unique_ptr<RNTupleSingleProcessor>(
49std::unique_ptr<ROOT::Experimental::RNTupleProcessor>
51 std::unique_ptr<ROOT::RNTupleModel> model)
60std::unique_ptr<ROOT::Experimental::RNTupleProcessor>
62 std::unique_ptr<ROOT::RNTupleModel> model)
84std::unique_ptr<ROOT::Experimental::RNTupleProcessor>
86 std::unique_ptr<ROOT::RNTupleModel> model)
95std::unique_ptr<ROOT::Experimental::RNTupleProcessor>
98 std::unique_ptr<ROOT::RNTupleModel> model)
108 return std::unique_ptr<RNTupleChainProcessor>(
112std::unique_ptr<ROOT::Experimental::RNTupleProcessor>
114 const std::vector<RNTupleOpenSpec> &
auxNTuples,
117 std::vector<std::unique_ptr<ROOT::RNTupleModel>>
auxModels)
126 std::unique_ptr<ROOT::RNTupleModel>
primaryModel, std::vector<std::unique_ptr<ROOT::RNTupleModel>>
auxModels)
129 throw RException(
R__FAIL(
"number of auxiliary models and auxiliary RNTuples does not match"));
163 auto desc =
pageSource.GetSharedDescriptorGuard();
168 R__FAIL(
"field \"" +
fieldContext.GetProtoField().GetFieldName() +
"\" not found in current RNTuple"));
184 std::unique_ptr<ROOT::RNTupleModel> model)
222 fNEntriesProcessed++;
229 for (
const auto &
value : *fEntry) {
244 fPageSource = fNTupleSpec.CreatePageSource();
245 fPageSource->Attach();
246 fNEntries = fPageSource->GetNEntries();
257 std::unique_ptr<ROOT::RNTupleModel> model)
288 for (
unsigned i = 0; i < fInnerProcessors.size(); ++i) {
290 fInnerNEntries[i] = fInnerProcessors[i]->GetNEntries();
293 fNEntries += fInnerNEntries[i];
302 for (
const auto &
value : *fEntry) {
309 for (
auto &
innerProc : fInnerProcessors) {
336 fNEntriesProcessed++;
346 std::unique_ptr<ROOT::RNTupleModel>
primaryModel, std::vector<std::unique_ptr<ROOT::RNTupleModel>>
auxModels)
397 return fieldName.substr(0, n.fNTupleName.size()) == n.fNTupleName;
419 std::vector<std::unique_ptr<ROOT::RNTupleModel>>
auxModels)
427 for (
unsigned i = 0; i <
auxModels.size(); ++i) {
428 std::vector<std::unique_ptr<ROOT::RFieldBase>>
auxFields;
440 fModel->RegisterSubfield(
field->GetQualifiedFieldName());
494 fNEntriesProcessed++;
501 if (!fJoinTablesAreBuilt) {
502 for (
unsigned i = 0; i < fJoinTables.size(); ++i) {
503 fJoinTables[i]->Add(*fAuxiliaryPageSources[i]);
506 fJoinTablesAreBuilt =
true;
511 valPtrs.reserve(fJoinFieldTokens.size());
512 for (
const auto &
token : fJoinFieldTokens) {
513 auto ptr = fEntry->GetPtr<
void>(
token);
520 for (
const auto &
joinTable : fJoinTables) {
#define R__FAIL(msg)
Short-hand to return an RResult<T> in an error state; the RError is implicitly converted into RResult...
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
static std::unique_ptr< RNTupleJoinTable > Create(const std::vector< std::string > &joinFieldNames)
Create an RNTupleJoinTable from an existing RNTuple.
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.
Abstract interface to read data from an ntuple.
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)
Processor specialization for vertically combined (chained) RNTupleProcessors.
void SetEntryPointers(const ROOT::REntry &) final
ROOT::NTupleSize_t GetNEntries() final
Get the total number of entries in this processor.
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.
void SetEntryPointers(const ROOT::REntry &) final
std::vector< std::unique_ptr< Internal::RPageSource > > fAuxiliaryPageSources
ROOT::NTupleSize_t LoadEntry(ROOT::NTupleSize_t entryNumber) final
Load the entry identified by the provided entry number of the primary RNTuple.
void SetModel(std::unique_ptr< ROOT::RNTupleModel > primaryModel, std::vector< std::unique_ptr< ROOT::RNTupleModel > > auxModels)
Set fModel by combining the primary and auxiliary models.
void ConnectFields()
Connect all fields, once the primary and all auxiliary RNTuples have been added.
std::vector< std::unique_ptr< Internal::RNTupleJoinTable > > fJoinTables
Specification of the name and location of an RNTuple, used for creating a new RNTupleProcessor.
std::variant< std::string, TDirectory * > fStorage
std::unique_ptr< Internal::RPageSource > CreatePageSource() const
Manager for a field as part of the RNTupleProcessor.
Interface for iterating over entries of RNTuples and vertically concatenated RNTuples (chains).
std::unique_ptr< ROOT::REntry > fEntry
std::unique_ptr< ROOT::RNTupleModel > fModel
static std::unique_ptr< RNTupleProcessor > Create(RNTupleOpenSpec ntuple, std::unique_ptr< ROOT::RNTupleModel > model=nullptr)
Create an RNTupleProcessor for a single RNTuple.
ROOT::NTupleSize_t fNEntries
Total number of entries.
static std::unique_ptr< RNTupleProcessor > CreateJoin(const RNTupleOpenSpec &primaryNTuple, const std::vector< RNTupleOpenSpec > &auxNTuples, const std::vector< std::string > &joinFields, std::unique_ptr< ROOT::RNTupleModel > primaryModel=nullptr, std::vector< std::unique_ptr< ROOT::RNTupleModel > > auxModels={})
Create an RNTupleProcessor for a join (i.e., a horizontal combination) of RNTuples.
friend class RNTupleJoinProcessor
std::unordered_map< std::string, RFieldContext > fFieldContexts
Maps the (qualified) field name to its corresponding field context.
friend class RNTupleChainProcessor
friend class RNTupleSingleProcessor
void ConnectField(RFieldContext &fieldContext, Internal::RPageSource &pageSource, ROOT::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 > CreateChain(std::vector< RNTupleOpenSpec > ntuples, std::unique_ptr< ROOT::RNTupleModel > model=nullptr)
Create an RNTupleProcessor for a chain (i.e., a vertical combination) of RNTuples.
std::vector< RNTupleOpenSpec > fNTuples
Processor specialization for processing a single RNTuple.
void SetEntryPointers(const ROOT::REntry &entry) final
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...
The REntry is a collection of values in an ntuple corresponding to a complete row in the data set.
Base class for all ROOT issued exceptions.
Representation of an RNTuple data set in a ROOT file.
const_iterator begin() const
const_iterator end() const
void CallConnectPageSourceOnField(RFieldBase &, ROOT::Experimental::Internal::RPageSource &)
constexpr NTupleSize_t kInvalidNTupleIndex
std::uint64_t NTupleSize_t
Integer type long enough to hold the maximum number of entries in a column.
constexpr DescriptorId_t kInvalidDescriptorId