Skip to content

Reading a string from a ROOT file #1159

Answered by jpivarski
chrisburr asked this question in Q&A
Discussion options

You must be logged in to vote

Something that could make quick work of this, if you can change the LHCb format, is to save a TObjString instead of a std::string. We use TObjString for a lot of debugging because it's such a simple type.

I didn't know that non-TObjects could be written directly to TDirectories. Perhaps STL collections are an exception? Or maybe just std::string?

If you get any instance of uproot.model.UnknownClass, then Uproot has already given up trying to interpret it. Uproot returns this object instead of raising an error because someone might want to indiscriminately try to read everything from a file for which almost all of the objects are readable.

I took a look at this object:

>>> import uproot
>>> 

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
3 replies
@chrisburr
Comment options

chrisburr Mar 4, 2024
Maintainer Author

@pikacic
Comment options

@jpivarski
Comment options

Answer selected by chrisburr
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants