As a note, I don’t suggest using TTree
directly to read ROOT data, it’s a low-level API, gives very few (type) safety guarantees, performs very few sanity checks and it’s also trickier to get good performance out of it. None of this might matter for this specific application of yours, but habits do matter
Given a branch created with file_info->Branch("RUNID", &some_float_var ,“Value/F” );
I can read it with
TFile f("f.root");
TTreeReader r("file_info", &f);
TTreeReaderValue<float> v(r, "RUNID.Value");
r.SetEntry(0);
std::cout << *v << std::endl;