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

**URL:** <https://root-forum.cern.ch/t/makeselector-ttree-gives-invalid-type-vector-vector-int/12780>\
**Category:** ROOT\
**Created:** [July 18, 2011, 7:27am UTC](https://root-forum.cern.ch/t/makeselector-ttree-gives-invalid-type-vector-vector-int/12780 "2011-07-18T07:27:12Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![SebastianSchmitt](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/s/58f4c7/32.png) [@SebastianSchmitt](https://root-forum.cern.ch/u/SebastianSchmitt)\
**Post date:** [July 18, 2011, 7:27am UTC](https://root-forum.cern.ch/t/makeselector-ttree-gives-invalid-type-vector-vector-int/12780/1 "2011-07-18T07:27:12Z")

</div>

Dear all!

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

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

This problem has been discussed in [url][Vectors in 5.28.00](https://root-forum.cern.ch/t/vectors-in-5-28-00/11846/1) - 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:

```auto
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:

```auto
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

---

<div class="post-metadata">

**Author:** ![pcanal](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/pcanal/32/12439_2.png) [@pcanal](https://root-forum.cern.ch/u/pcanal)\
**Post date:** [July 18, 2011, 8:58pm UTC](https://root-forum.cern.ch/t/makeselector-ttree-gives-invalid-type-vector-vector-int/12780/2 "2011-07-18T20:58:44Z")

</div>

Hi,

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

Cheers,  
Philippe.

---

<div class="post-metadata">

**Author:** ![SebastianSchmitt](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/s/58f4c7/32.png) [@SebastianSchmitt](https://root-forum.cern.ch/u/SebastianSchmitt)\
**Post date:** [July 19, 2011, 11:37am UTC](https://root-forum.cern.ch/t/makeselector-ttree-gives-invalid-type-vector-vector-int/12780/3 "2011-07-19T11:37:37Z")

</div>

Hi!

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

Thanks,

Sebastian

---

<div class="post-metadata">

**Author:** ![pcanal](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/pcanal/32/12439_2.png) [@pcanal](https://root-forum.cern.ch/u/pcanal)\
**Post date:** [July 19, 2011, 7:36pm UTC](https://root-forum.cern.ch/t/makeselector-ttree-gives-invalid-type-vector-vector-int/12780/4 "2011-07-19T19:36:28Z")

</div>

Hi,

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

Cheers,  
Philippe.

---

<div class="post-metadata">

**Author:** ![njoshi3](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/n/71c47a/32.png) [@njoshi3](https://root-forum.cern.ch/u/njoshi3)\
**Post date:** [September 1, 2011, 10:40pm UTC](https://root-forum.cern.ch/t/makeselector-ttree-gives-invalid-type-vector-vector-int/12780/5 "2011-09-01T22:40:25Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![pcanal](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/pcanal/32/12439_2.png) [@pcanal](https://root-forum.cern.ch/u/pcanal)\
**Post date:** [September 2, 2011, 2:29am UTC](https://root-forum.cern.ch/t/makeselector-ttree-gives-invalid-type-vector-vector-int/12780/6 "2011-09-02T02:29:00Z")

</div>

Hi,

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

Cheers,  
Philippe.
