Dictionaries needed for RDataFrame(TTree).AsNumpy

Hi,

I have trees with 1D, 2D and 3D vectors of bools, shorts, etc. I have no problem assigning branches and reading them out in PyROOT directly through TTree. However, when I want to utilise the RDataFrame AsNumpy() function, I get errors like:

“RuntimeError: The column named “trace_ch” is of type “ROOT::VecOps::RVec<vector<vector >>”, which is not known to the ROOT interpreter. Please load the corresponding header files or dictionaries.”

I can declare and load the dictionaries in PyROOT, but I wonder if this is really necessary, since reading these values directly from the TTree works without any problem?


ROOT Version: heads/master@v6-37-01-6541-g9a9e7697e4
Platform: Fedora 41


Hi,

Yes. At the moment the type safety mechanism of RDF require that.

Cheers,
Danilo

I understand. Still, I have problems with the dictionaries being accepted. For example, I can generate a dictionary for vector<bool>:

ROOT.gInterpreter.GenerateDictionary("vector<vector<bool> >", "vector")

And I will get a complaint:

RuntimeError: The column named "adc_enabled_channels_ch" is of type "ROOT::VecOps::RVec<vector<bool>>", which is not known to the ROOT interpreter. Please load the corresponding header files or dictionaries.

when I call RDataFrame::AsNumpy().

I also tried to load the dictionaries that my C++ counterpart code generates. The load, but the error is the same.