Hi Arjun,
I see two ways out:
- You add the lines
gInterpreter->GenerateDictionary("vector<vector<float> >", "vector")
gInterpreter->GenerateDictionary("vector<vector<int> >", "vector")
to your code, before looping on the TTree.
- You build once for all the dictionaries and compile them as a shared library which will be autoloaded upon need by ROOT, namely:
- Take this selection file, LinkDef.h
#include <vector>
#ifdef __ROOTCLING__
#pragma link C++ class vector<vector <float> >+;
#pragma link C++ class vector<vector <int> >+;
#endif
- Generate the dictionary:
rootcling -v4 -f mydict.cxx -rmf libmydict.rootmap -rml libmydict.so LinkDef.h
- Compile the dictionary as a shared library
g++ -shared -o libmydict.so mydict.cxx `root-config --cflags --libs`
I would go for 2) if your code is stable and not in an explorative phase.
If you are interested, you could also move to ROOT 6.12.06 and have a look to TDataFrame, a tool which is very helpful when it comes to analyse data in trees.
Cheers,
Danilo