RDataFrame - Define a new strcuture type branch with leaflist


I’m trying to use rdataframe to write a tree with my own structure data.
For my own structure type data (“ITrack” for example) which I want to write in the tree,
I used the conventional method something like
tree->Branch(“ITrack”, &ITrack, Leaflist of branch)
Then, it gives the result like the 2nd attached figure. Leaflist is written properly just at the “ITrack” line.

However, when I try to use RDataFrame by using

class ITrack
Float_t TP_X;

ClassDef(ITrack, 1);

rdataframe.Define(“ITrack”, a function with ITrack type output, {“Other”,“branches”,“for”,“function”});

It gives the result like another attached figure, so I think something is wrong.

How can I fix it?

Please read tips for efficient and successful posting and posting code

ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided

Hi @Youngju_Cho ,
thank you for your report, can you please also add a self-contained reproducer that we can use to debug the issue?


Dear Enrico,

Thank you for the fast reply!
Those are the code I used.
The root version is 6.24.06.

Best regards,

CT_RDF.C (1.5 KB)
IonTrack.h (1.6 KB)
RDF_output.root (469.4 KB)
RDF_input.root (435.9 KB)

As a side note, the ‘new’ structure is usually ‘better’ for some criteria than the leaflist structure (it leads to smaller (better compressed) files and allows partial read of some of the data).

Thank you for your advice.
I checked the two output files one made by RDF (as 1st figure) and one made by conventional method (as 2nd figure) from the same input file.
Actually, the latter one shows a slightly smaller size than the first one. It is quite impressive because I just used such structures for a clear look.
Is there any description of that point?

Best regards,

Thanks for the reproducer, I will take a look as soon as possible, if nothing else too understand where exactly the change in layout comes from.


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