# How to read a 2D vector in root file

**URL:** <https://root-forum.cern.ch/t/how-to-read-a-2d-vector-in-root-file/15572>\
**Category:** ROOT\
**Created:** [January 31, 2013, 4:42pm UTC](https://root-forum.cern.ch/t/how-to-read-a-2d-vector-in-root-file/15572 "2013-01-31T16:42:42Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [January 31, 2013, 4:53pm UTC](https://root-forum.cern.ch/t/how-to-read-a-2d-vector-in-root-file/15572/2 "2013-01-31T16:53:14Z")

</div>

In the beginning of your macro, try to add: ` if (!(gInterpreter->IsLoaded("vector")))
    gInterpreter->ProcessLine("#include <vector>");
  gSystem->Exec("rm -f AutoDict*vector*vector*float*");
  gInterpreter->GenerateDictionary("vector<vector<float> >", "vector");`  
For “std::vector\<std::vector \>” see [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)  
For “std::vector\<std::vectorstd::string \>” see [url][Problem in getting the vector \< vector \<string\> \> branch](https://root-forum.cern.ch/t/problem-in-getting-the-vector-vector-string-branch/14608/4)

---

_[View the full topic](https://root-forum.cern.ch/t/how-to-read-a-2d-vector-in-root-file/15572)._
