View vector content in the interactive mode

Dear ROOT experts,

I’m trying to inspect the contents of a TTree in the interactive mode. However, when I use the command tree->Show(0) I get something like

hit_L           = (vector<float>*)0x1ec24a0

instead of the vector contents even for simple types as float, int or bool.
Is there an easy way to get the vector content in the interactive mode without the dedicated scripts?

Thanks in advance,
Aleksandr


ROOT Version: ROOT 6.16/00
Platform: Ubuntu 18.04


Use RDataFrame!

auto rdf = ROOT::RDataFrame("tree", "out.root");
rdf.Display()->Print();

gives

+-----+-----------+
| Row | v         |
+-----+-----------+
| 0   | 12.000000 |
|     | 17.000000 |
|     | 24.000000 |
|     | 7.0000000 |
+-----+-----------+

for a std::vector<double> {12, 17, 24, 7}

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.