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.


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


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