Problems using vector<vector<int> >

Dear experts,

I try to run a simple TTree analysis in which I read in a variable which is of type vector<vector >. My understanding so far was that the corresponding dictionaries should be provided by default. However, I get an AttributeError:

AttributeError: type object ‘ROOT’ has no attribute ‘vector<vector >’

when I try to access the branch elements. I already tried to generate the dictionary by myself, but it doesn’t work either. Is there any solution to this?

Many thanks in advance!

Cheers,
Marcus

Hi,

that class should not be available by default (although it might be if used within an experiment’s setup). It can be generated with autodict, however.

Here’s the FAQ entry on dictionary generation: http://root.cern.ch/drupal/faq#n676. Which method did you use, and what does “not working” mean in the case here?

Cheers,
Wim

Hi Wim,

indeed

ROOT.gInterpreter.GenerateDictionary("vector<vector<int> >","vector");

solved the problem. The error occurred once I tried to access a branch of the given type from a tree, which result in an AttributeError.

Thanks a lot for your help!

Marcus