# How to write multiple ragged columns with same count variable into RNTuple?

**URL:** <https://root-forum.cern.ch/t/how-to-write-multiple-ragged-columns-with-same-count-variable-into-rntuple/64857>\
**Category:** ROOT\
**Tags:** root\
**Created:** [May 19, 2026, 7:31pm UTC](https://root-forum.cern.ch/t/how-to-write-multiple-ragged-columns-with-same-count-variable-into-rntuple/64857 "2026-05-19T19:31:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mrli](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/m/6a8cbe/32.png) [@mrli](https://root-forum.cern.ch/u/mrli)\
**Post date:** [May 19, 2026, 7:31pm UTC](https://root-forum.cern.ch/t/how-to-write-multiple-ragged-columns-with-same-count-variable-into-rntuple/64857/1 "2026-05-19T19:31:10Z")

</div>

Hi all,

When using TTree, I can define the tree to write multiple ragged columns like:

```cpp
TTree t( "t", "t" );
int counter;
int col1[100], col2[100];
t.Branch( "counter", &counter );
t.Branch( "col1", col1, "col1[counter]/I" );
t.Branch( "col2", col2, "col2[counter]/I" );

```

The `col1` and `col2` share the count variable `counter`. Is there any way to achieve this using RNTuple (without defining a vector of a struct and gnerating dictionary)?

Thanks!

* * *

_ROOT Version:_ 6.36  
_Platform:_ AlmaLinux9  
_Compiler:_ gcc13

* * *

---

<div class="post-metadata">

**Author:** ![siliataider](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/siliataider/32/35694_2.png) [@siliataider](https://root-forum.cern.ch/u/siliataider)\
**Post date:** [May 21, 2026, 9:03am UTC](https://root-forum.cern.ch/t/how-to-write-multiple-ragged-columns-with-same-count-variable-into-rntuple/64857/2 "2026-05-21T09:03:42Z")

</div>

Hi @mrli and thanks for your question!

As far as I understand, RNTuple doesn’t have a direct equivalent of TTree’s shared count branch without some workaround like you mentioned, each variable-length field manages its own offset/length column internally,

Maybe [@jblomer](https://root-forum.cern.ch/u/jblomer) can give a better answer!

---

<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:** [June 4, 2026, 9:04am UTC](https://root-forum.cern.ch/t/how-to-write-multiple-ragged-columns-with-same-count-variable-into-rntuple/64857/3 "2026-06-04T09:04:00Z")

</div>

Closed on June 4, 2026, 9:04am UTC

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