RDataFrame and multidimensional arrays

I’m looking for some examples which show how to analyze 2- and 3-dimensional arrays in RDataFrame (C++ and the corresponding python macros would be welcome), for standard ordinary TTree branches like:

Double_t a2d[10][20];
Double_t a3d[10][20][30];

I could only find some examples for 1-dimensional arrays, like:

Double_t a1d[10];

I guess @eguiraud can help you.

Hi,

the situation is still the one described e.g. at Read 2-dimensional c-array branch with RDataFrame and Does RDataFrame support tree branches with 2d arrays? .

TL;DR: RDataFrame does not properly support multi-dimensional C-style arrays because TTreeReader (which RDF uses internally) does not. The relevant JIRA ticket is [ROOT-9509] [DF] Add proper support for multidimensional arrays - SFTJIRA . For arrays with static size, you should be able to read them as uni-dimensional arrays (i.e. flattened), while multi-dimensional arrays with one dynamic dimension as far as I know there is no workaround at the moment (as per RDF issue with CMS MiniAOD branch ).

cc: @Axel

Cheers,
Enrico

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.

So, that’s even worse than I thought.
It’s not only about ordinary C/C++ arrays but also about some ROOT built-in classes.
The “ROOT::RDataFrame” (at least up to and including ROOT 6.30.06) does not support multidimensional arrays. Suppose the “TTree::MakeClass” generated analysis skeleton contains a branch with a 2 or more dimensional array. In that case, this branch will not be available in the “ROOT::RDataFrame”.