Hi Pieter,
if I understand correctly RDF correctly reads Electron
as a TClonesArray
branch.
The problem is really that TClonesArray
, being type-erased like all ROOT collections, has a clunky API: it requires that you downcast its elements from TObject
to their actual types.
That’s fairly different from Opening TClonesArray from Delphes Branches with RDataFrame where RDF was not able to read TClonesArray
branches at all (that was an I/O problem, this is an API problem).
Now naturally, you’d like RDF to perform an on-the-fly conversion from TClonesArray
to a friendlier type such as RVec<Electron>
. I think that would be a nice improvement – although I am not sure at this point if we could make that happen a) in a backward-compatible way and b) without a copy of the array elements.
As an aside you should be able to use a static_cast
instead of a dynamic_cast
for your workaround.
Can you please open a request for improvement at github.com/root-project/root/issues ? I will see what we can do about this.
Cheers,
Enrico