You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 21, 2022. It is now read-only.
/// header .. define class member
TTree* m_tree;
std::string m_some_meta_string;
/// in source .. set the branch
m_tree = new TTree("tree","tree");
m_tree->Branch("meta",&m_some_meta_string);
/// later assign it
m_some_meta_string = function_which_returns_a_string();
An example file can be found here: https://phy.duke.edu/~ddavis/public/example.root
The tree with some strings is called WtLoop_meta. String branches include generator, sampleType, campaign, and initialState. If I use tree.show() I see a None interpretation for the strings.
Docs say that uproot should be able to figure out std::string, am I screwing something up (e.g. saving the string to the ROOT file in a way that's incompatible with uproot)?
Using ROOT v6-10-08 to create the file and uproot v2.8.8 to read.
The text was updated successfully, but these errors were encountered:
A correction is on its way: it will be version 2.8.9 (in master now; going through CI tests). Thanks for the sample file— having it makes the debugging quick!
I'm saving a few
std::string
s as single entry branches as meta data in a tree. To retrieve that data I'm trying to just use the structure:Where
meta
is anstd::string
branch.I'm getting the
ValueError
:They are saved in C++ as follows:
/// header .. define class member TTree* m_tree; std::string m_some_meta_string;
An example file can be found here: https://phy.duke.edu/~ddavis/public/example.root
The tree with some strings is called
WtLoop_meta
. String branches includegenerator
,sampleType
,campaign
, andinitialState
. If I usetree.show()
I see aNone
interpretation for the strings.Docs say that
uproot
should be able to figure outstd::string
, am I screwing something up (e.g. saving the string to the ROOT file in a way that's incompatible withuproot
)?Using ROOT v6-10-08 to create the file and uproot v2.8.8 to read.
The text was updated successfully, but these errors were encountered: