# Problem in getting the vector \< vector \<string\> \> branch

**URL:** <https://root-forum.cern.ch/t/problem-in-getting-the-vector-vector-string-branch/14608>\
**Category:** ROOT\
**Created:** [July 19, 2012, 8:43am UTC](https://root-forum.cern.ch/t/problem-in-getting-the-vector-vector-string-branch/14608 "2012-07-19T08:43:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sandhya](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/sandhya/32/13972_2.png) [@sandhya](https://root-forum.cern.ch/u/sandhya)\
**Post date:** [July 19, 2012, 8:43am UTC](https://root-forum.cern.ch/t/problem-in-getting-the-vector-vector-string-branch/14608/1 "2012-07-19T08:43:09Z")

</div>

Dear Rooters,

I am trying to make a branch in a tree with vector\<vectorstd::sting \>.  
I have a similar code working for vector\<vector \> and vector\<vector \>.  
I just added a line to create the dictionary for this.

#ifdef **MAKECINT**  
#pragma link C++ class std::vector\<std::vector \>+;  
#pragma link C++ class std::vector\<std::vectorstd::string \>+;  
#pragma link C++ class std::vector\<std::vector \>+;  
#pragma link C++ class std::vector\<std::vector \>+;  
#pragma extra\_include “std::vector”;  
#endif

It compiles fine but when I try to run the code but it tells me the pointer to the “branch\_name” is not known by root. This happens when I am trying to filling the branch itself.  
I also tried to generate the dictionary using  
gInterpreter-\>GenerateDictionary(“vector\<vectorstd::string \>”,“string;vector”);

I still see the problem. This problem did not come when I filled the vector of vector of floats/ints. And there,  
I generated dictionary using MAKECINT while compiling like I pasted above. And when I had to read the info after filling the branches, I created one using gInterpreter. Here, situation seems to be different. Could someone please help me about what I should do?

Thanks & Regards  
Sandhya

---

<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, 2012, 7:10pm UTC](https://root-forum.cern.ch/t/problem-in-getting-the-vector-vector-string-branch/14608/2 "2012-07-19T19:10:58Z")

</div>

Hi,

Try using the spelling:`vector<vector<string> >`

Cheers,  
Philippe.

---

<div class="post-metadata">

**Author:** ![sandhya](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/sandhya/32/13972_2.png) [@sandhya](https://root-forum.cern.ch/u/sandhya)\
**Post date:** [July 20, 2012, 8:46am UTC](https://root-forum.cern.ch/t/problem-in-getting-the-vector-vector-string-branch/14608/3 "2012-07-20T08:46:23Z")

</div>

Hi Philippe,  
It shows the same problem.  
I also tried doing it with TString but it shows same problem.

Thanks & Regards  
Sandhya

---

<div class="post-metadata">

**Author:** ![Pepe\_Le\_Pew](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/pepe_le_pew/32/12365_2.png) [@Pepe\_Le\_Pew](https://root-forum.cern.ch/u/Pepe_Le_Pew)\
**Post date:** [July 20, 2012, 10:25am UTC](https://root-forum.cern.ch/t/problem-in-getting-the-vector-vector-string-branch/14608/4 "2012-07-20T10:25:30Z")

</div>

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](https://root-forum.cern.ch/t/storing-2d-vector-vector-vector-into-a-ttree/14331/2)

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](https://root-forum.cern.ch/uploads/default/original/2X/2/223ccec9bd562b71868b3fbfee854d68419498ce.cxx) (4.79 KB)

---

<div class="post-metadata">

**Author:** ![sandhya](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/sandhya/32/13972_2.png) [@sandhya](https://root-forum.cern.ch/u/sandhya)\
**Post date:** [July 20, 2012, 3:28pm UTC](https://root-forum.cern.ch/t/problem-in-getting-the-vector-vector-string-branch/14608/5 "2012-07-20T15:28:00Z")

</div>

Hi Pepe,  
Thanks for the instructions. Though my problem is that I am using all of this  
in CMS devoted software.

I think I did what is being done here in the code I am trying to run. But anyway  
now am suggested not to use nested vectors  
from the experts within the  
collaboration. So changing the code anyway.  
Many thanks for the attention.

Thanks & Regards  
Sandhya
