root icon indicating copy to clipboard operation
root copied to clipboard

[ntuple] Dynamically activate fields in `RNTupleProcessor`

Open enirolf opened this issue 7 months ago • 1 comments

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:

  1. Remove RNTupleProcessor::GetPtr altogether and only allow access to the field value pointers through the iterator.
  2. Dispatch the local entry index from RState back to the processor on every Advance, and (re)load the entry when RNTupleProcessor::GetPtr is called.

Checklist:

  • [x] tested changes locally
  • [x] updated the docs (if necessary)

enirolf avatar Jun 27 '24 09:06 enirolf