Skip to content
This repository has been archived by the owner on Jun 21, 2022. It is now read-only.

Issue with vector branches generated using RDataFrame #544

Open
ChristofSauer opened this issue Feb 3, 2022 · 1 comment
Open

Issue with vector branches generated using RDataFrame #544

ChristofSauer opened this issue Feb 3, 2022 · 1 comment

Comments

@ChristofSauer
Copy link

Dear All,

I got access to a ROOT file that was generated making use of ROOT's RDataFrame feature. This file basically contains the constituents for each jet in an even, i.e., for each jet, there is an associated vector. It appears that RDataFrame converts the std::vector<std::vector<float> > type (which I'd expect for this kind of data) to some custom type vector<float,ROOT::Detail::VecOps::RAdoptAllocator<float> >, which apparently is not understood by uproot. If I'm trying to read one of those branches, I receive the following error message

ValueError: cannot interpret branch 'tjetSortClusNormByPt_pt' as a Python type

The corresponding infomration in the tree is

*............................................................................*
*Br   40 :tjetSortClusNormByPt_pt : vector<float,ROOT::Detail::VecOps:       *
*         | :RAdoptAllocator<float> >                                        *
*Entries :  1082892 : Total  Size=  216012422 bytes  File Size  =  195765107 *
*Baskets :      211 : Basket Size=    1632256 bytes  Compression=   1.10     *
*............................................................................*

Is there some way to read this data using uproot?

@ChristofSauer ChristofSauer changed the title Issue with vector branches generated using ROOT's RDataFrame Issue with vector branches generated using RDataFrame Feb 3, 2022
@jpivarski
Copy link
Member

The first thing is to try reading it in Uproot 4 (check your uproot.__version__; I'm guessing you're using Uproot 3 because you posted the issue here). The deserialization code was made a lot more general, and—fingers crossed—it might just work. If not, it will require some investigation...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants