Try: root [0] .x trial.cxx
and/or: root [0] .x trial.cxx++
and/or: `root-config --cxx --cflags` -O2 -W -Wall -o trial trial.cxx `root-config --glibs`
./trial
and then: root [0] TFile f("trial.root", "READ");
root [1] tree->Print();
See also: [url]Storing 2D vector [--> vector<vector<...> >] into a TTree
P.S. If the above compilation command does not work for you, try: g++ `root-config --cflags` -O2 -W -Wall -o trial trial.cxx `root-config --glibs`
./trial
trial.cxx (4.79 KB)