importing Friend Tree using root_numpy

43 views
Skip to first unread message

Morten Medici

unread,
Mar 31, 2015, 9:36:17 AM3/31/15
to rootpy...@googlegroups.com
Hi all

So I am trying to import a friend tree using root_numpy.
The file have multiple trees for various variables/reconstructions etc.
Instead the file has an additional tree with no branches, but have all the other trees as friends.

However, that does not seem to play well with the tree2rec (and similar) function.

One work around seem to loop over friends using the root_numpy.list_trees(file) function.

Is that the only way to go at it?

Thanks for the help,
Morten

Noel Dawe

unread,
Mar 31, 2015, 7:33:28 PM3/31/15
to rootpy...@googlegroups.com
Hi Morten,

At the moment, root_numpy doesn't include friend trees when converting a tree. I'm wondering if this is worth implementing or if it will just bring in too much complexity. The best thing to do now is loop on the friends of your tree and use the tree2array function, then merge those arrays using something like numpy.recfunctions.rec_append_fields or numpy.lib.recfunctions.merge_arrays.

Noel

--
You received this message because you are subscribed to the Google Groups "rootpy users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rootpy-users...@googlegroups.com.
To post to this group, send email to rootpy...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rootpy-users/46a197a2-d4f1-4398-aa72-cce4594339b7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages