RDF: read trees from multiple TDirectories in the same file

Hello,

the output of the grid jobs in ALICE consists often of several TDirectories containing the output trees obtained on different chunks of data (being a new user I cannot put links to an example file). In order to easily process all these trees with RDataFrame, I usually merge all of them into a single TTree, but I am wondering if there is an easy interface that I could use, something like:

ROOT::RDataFrame d("O2zdcsptable", "AO2D.root:DF*/");

or

ROOT::RDataFrame d("DF*/O2zdcsptable", "AO2D.root");

(I tried these two, and they don’t work). Sorry if I am missing something trivial, but I could not find it easily in the documentation.

Thanks a lot!
Maximiliano

Hi Maximiliano,

Thanks for the interesting post and welcome to the ROOT community!
I think we do not support this kind of wildcards.
A proposal to unblock you: why not building a TChain made of all these TTrees and then a RDF instance initialised with the aforementioned chain?

I hope this helps.

Best,
D

1 Like

Hi Danilo,

thanks a lot for the reply! I am trying with the TChain, do you know if there a wildcard expansion for the TDirectories in TChain::Add? It works for files, but I tried c.Add("AO2D.root?#*/O2nucleitablemc") and it did not work.

Thanks again!
Cheers,
Max

Hi Max,

I think we do not provide this functionality for TChains.

Cheers,
Danilo

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