I would like to setup a “nested/deep” tree structure for parallel processing on GPU…
Actually up to now, I had a quite basic usage of trees (int, double, vectors, and some custom structure leaves).
I would like to setup a tree structure with “nested” branches as following:
“id” branch
“prefix” branch (should be string)
“array1d” holding a 1D vector (non-fixed size, expecting about 1 to 100 entries)
“h2d” holding 2D histograms (possibly 1 to 10 histograms)
“subtree” nested tree structure (one entry per histogram that I would like to access using TTree::GetEntry somehow)
My issue is rather about this complex subtree structure.
Anybody has some suggestion how I could perform this ?
Or perhaps how I should better organize my tree ?
TTree branches can contain arbitrary C++ types, so one solution is to use branches that contain complex types which will in turn correspond to sub-branches in the TTree (up to some maximum nesting depth after which nested data members won’t be accessible directly as branches). For this you can check Trees - ROOT and I/O of custom classes - ROOT .
The other option is to manually create your branch hierarchy, I’m not sure what the best way to do that is, @pcanal might be able to point to an example.
In the end, my main goal is to be able to see the sub-structure using TBrowser.
I am trying to learn about this splitlevel at the moment looking at your links.
I think this and custom structure might be what I am looking for
I have also read about Tree “folder”, in some old root documentation.
Additionally, I declared the structure in the LinkDef.h file.
It did the job because I can now see substructure. I adapted the subtree branch in a different way.
This is the recommended setting as it avoid confusion if you had more than one type of objects (i.e. more than one top level branch) in your TTree (where the distinct class may have similar or identical data member names).
However I would like to go with:
If you mean just the names, you can remove the trailing dot and use: