MakeSelector TTree gives: Invalid type vector<vector<int>

Dear all!

I have a TTree with a branch of type vector<vector. If I generate a selector with MakeSelector I get the message:

Error: Invalid type 'vector<vector<int>' in declaration of '>'

This problem has been discussed in [url]Vectors in 5.28.00 - it should be solved using ROOT 5.30.00.

Unfortunately I still have the problem. If I run the following on lxplus from a fresh shell:

source /afs/cern.ch/sw/lcg/contrib/gcc/4.3/x86_64-slc5/setup.sh
cd /afs/cern.ch/sw/lcg/app/releases/ROOT/5.30.00//x86_64-slc5-gcc43-opt/root/
source bin/thisroot.sh
cd `mktemp -d`
cp -v /afs/cern.ch/user/s/schmitts/public/ROOT_vector_vector_int/evgen.root .
root -l -b evgen.root
evgen->MakeSelector()
.L evgen.C

I get:

Error: Invalid type 'vector<vector<int>' in declaration of '>' evgen.h:74:
Error: Symbol vector<vector<int> > is not defined in current scope  evgen.h:74:
Error: Symbol mcpart_mother_index is not defined in current scope  evgen.h:74:
*** Interpreter error recovered ***

Could you please have a look?

Thanks in advance,

Sebastian

Hi,

You need to add #include to the generated header file.

Cheers,
Philippe.

Hi!

Thanks. Could the include be added automatically in the future?

Thanks,

Sebastian

Hi,

Yes, it has been added by revision 40304 of the trunk,

Cheers,
Philippe.

Hi,

I am having problem with defining iterator with the vector<pair<double, double> > object.

I get the following error
root [15] vector<pair<double, double> >::iterator it;
Error: Invalid type ‘iterator’ in declaration of ‘it’ (tmpfile):1:
Error: Symbol iterator it is not defined in current scope (tmpfile):1:
*** Interpreter error recovered ***

This error vanishes if the double is replace with int/float/Float_t, etc. So, this problem seems only with double or Double_t types

regards,
Nikhil

Hi,

To work around this issue, you can explicitly generate the dictionary:gInterpreter->GenerateDictionary("vector<pair<double, double> >","vector");

Cheers,
Philippe.