Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RNTupleProcessor Class Reference

Interface for iterating over entries of RNTuples and vertically concatenated RNTuples (chains).

Example usage (see ntpl012_processor.C for a full example):

using ROOT::Experimental::RNTupleSourceSpec;
std::vector<RNTupleSourceSpec> ntuples = {{"ntuple1", "ntuple1.root"}, {"ntuple2", "ntuple2.root"}};
RNTupleProcessor processor(ntuples);
auto ptrPt = processor.GetEntry().GetPtr<float>("pt");
for (const auto &entry : processor) {
std::cout << "pt = " << *ptrPt << std::endl;
}
Interface for iterating over entries of RNTuples and vertically concatenated RNTuples (chains).

An RNTupleProcessor is created by providing one or more RNTupleSourceSpecs, each of which contains the name and storage location of a single RNTuple. The RNTuples are processed in the order in which they were provided.

The RNTupleProcessor constructor also (optionally) accepts an RNTupleModel, which determines which fields should be read. If no model is provided, a default model based on the descriptor of the first specified RNTuple will be used. If a field that was present in the first RNTuple is not found in a subsequent one, an error will be thrown.

The object returned by the RNTupleProcessor iterator is a view on the current state of the processor, and provides access to the global entry index (i.e., the entry index taking into account all processed ntuples), local entry index (i.e. the entry index for only the currently processed ntuple), the index of the ntuple currently being processed (with respect to the order of provided RNTupleSpecs) and the actual REntry containing the values for the current entry.

#include <ROOT/RNTupleProcessor.hxx>


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