root
root copied to clipboard
[ntuple] Dynamically activate fields in `RNTupleProcessor`
With this change, fields are only added to the REntry
and read when they are referenced in the processor loop. This prevents unecessary reads of unused fields.
It also makes the REntry completely transparent from an interface perspective. Pointers to values can be obtained through the processor interface itself before the iteration starts, or alternatively via the iterator returned by the processor.
Important to note that during iteration, the pointer returned by RNTupleProcessor::GetPtr
will not contain the value for the current entry. The reason for this is that from the RNTupleProcessor
interface there is (with the current implementation) no way to know what the current entry index is. For now, RNTupleProcessor::GetPtr
contains a warning and a recommendation to get the pointer through the iterator instead. Alternative solutions could be:
- Remove
RNTupleProcessor::GetPtr
altogether and only allow access to the field value pointers through the iterator. - Dispatch the local entry index from
RState
back to the processor on everyAdvance
, and (re)load the entry whenRNTupleProcessor::GetPtr
is called.
Checklist:
- [x] tested changes locally
- [x] updated the docs (if necessary)