Writing TTrees with pyroot efficiently

Dear @Tim_Buktu ,

There is a very neat way to do this nowadays, thanks to How to convert to/from ROOT RDataFrame — Awkward Array 2.6.3 documentation

I am giving you a simplified example that should represent your situation

import awkward
import numpy

n_events = 10
values_per_event = 1000
data = {
    key: numpy.random.rand(n_events, values_per_event)
    for key in ["chan_{i}" for i in range(30)]
}
ak_arrays = {
   key: awkward.from_numpy(arr)
   for key, arr in data.items()
}
df = awkward.to_rdataframe(ak_arrays)
df.Snapshot("mytree", "myfile.root")

Cheers,
Vincenzo