# RDataFrame with arrays of fixed length arrays?

**URL:** <https://root-forum.cern.ch/t/rdataframe-with-arrays-of-fixed-length-arrays/64972>\
**Category:** ROOT\
**Tags:** rdataframe\
**Created:** [August 13, 2026, 9:05pm UTC](https://root-forum.cern.ch/t/rdataframe-with-arrays-of-fixed-length-arrays/64972 "2026-08-13T21:05:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mkordosky](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/mkordosky/32/38971_2.png) [@mkordosky](https://root-forum.cern.ch/u/mkordosky)\
**Post date:** [August 13, 2026, 9:05pm UTC](https://root-forum.cern.ch/t/rdataframe-with-arrays-of-fixed-length-arrays/64972/1 "2026-08-13T21:05:38Z")

</div>

I’m trying to use RDataFrame to analyze an ntuple that has branches that are variable length arrays that hold fixed length arrays (specifically, 4 momenta and vertex position+time). The ntuple is Print()'ed below. I cannot figure out how to use Histo1D to book and fill with the equivalent of

t.Draw(“prodpart.mom[][2]”,“prodpart.pdg[]==211”) //pz for pi+

I’m trying lines like this:

hp3=df.Histo1D((“hp3”,“hp3”,20,20.0,20.0), “prodpart.mom[4]” )

which tells me:

> In module ‘ROOTDataFrame’:  
> /home/kordosky/root/include/ROOT/RDF/RAction.hxx:117:96: error: cannot pass object of non-trivial type ‘ROOT::VecOps::RVec\<std::array\<double, 4\> \>’ through variadic method; call will abort at runtime [-Wnon-pod-varargs]

Is this ntuple analyzable by rdataframe or should I give up and use another tool?

_ROOT Version:_ 6.40.02  
_Platform:_ linux  
_Compiler:_ gcc 15.2.0

```auto
root [2] hAinfoTree->Print()

*Tree :hAinfoTree: g4hp info from h+A *
*Entries : 156108 : Total = 264277233 bytes File Size = 180838101 *

   : : Tree compression factor = 1.46 *

*Branch :hAinfo *
*Entries : 156108 : BranchElement (see below) *
............................................................................
*Br 0 :prodpart : Int_t prodpart_ *
*Entries : 156108 : Total Size= 1288814 bytes File Size = 434394 *
*Baskets : 61 : Basket Size= 32000 bytes Compression= 2.89 *
............................................................................
*Br 1 :prodpart.pdg : Int_t pdg[prodpart_] *
*Entries : 156108 : Total Size= 14094767 bytes File Size = 3093306 *
*Baskets : 88 : Basket Size= 1364992 bytes Compression= 4.56 *
............................................................................
*Br 2 :prodpart.vtx[3] : Double_t vtx[prodpart_] *
*Entries : 156108 : Total Size= 81435610 bytes File Size = 20019815 *
*Baskets : 439 : Basket Size= 7888384 bytes Compression= 4.07 *
............................................................................
*Br 3 :prodpart.mom[4] : Double_t mom[prodpart_] *
*Entries : 156108 : Total Size= 108371446 bytes File Size = 104006448 *
*Baskets : 576 : Basket Size= 25600000 bytes Compression= 1.04 *
............................................................................

```

---

<div class="post-metadata">

**Author:** ![dastudillo](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/dastudillo/32/17280_2.png) [@dastudillo](https://root-forum.cern.ch/u/dastudillo)\
**Post date:** [August 14, 2026, 6:01am UTC](https://root-forum.cern.ch/t/rdataframe-with-arrays-of-fixed-length-arrays/64972/2 "2026-08-14T06:01:03Z")

</div>

See “working with collections” for RDataFrame:

> **[ROOT: ROOT::RDataFrame Class Reference](https://root.cern/doc/master/classROOT_1_1RDataFrame.html#working_with_collections)**
>
> RDataFrame reads collections as the special type ROOT::RVec: for example, a column containing an array of floating point numbers can be read as a ROOT::RVecF. C-style arrays (with variable or static size), STL vectors and most other collection types...

In short, use Define to make a collection of what you need and then fill the histo with that.

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [August 28, 2026, 6:01am UTC](https://root-forum.cern.ch/t/rdataframe-with-arrays-of-fixed-length-arrays/64972/3 "2026-08-28T06:01:35Z")

</div>

Closed on August 28, 2026, 6:01am UTC

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