# Pb with two dimensional arrays in TBranch

**URL:** <https://root-forum.cern.ch/t/pb-with-two-dimensional-arrays-in-tbranch/37494>\
**Category:** ROOT\
**Tags:** tree\
**Created:** [January 9, 2020, 12:15pm UTC](https://root-forum.cern.ch/t/pb-with-two-dimensional-arrays-in-tbranch/37494 "2020-01-09T12:15:58Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![CSOTTY](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/csotty/32/19870_2.png) [@CSOTTY](https://root-forum.cern.ch/u/CSOTTY)\
**Post date:** [January 10, 2020, 1:36pm UTC](https://root-forum.cern.ch/t/pb-with-two-dimensional-arrays-in-tbranch/37494/3 "2020-01-10T13:36:33Z")

</div>

**Thank a lot for the prompt reply, it worked!**

However, the problem persisted with std::vector\<std::vector\>, so I guessed it might come from the TBranch declaration.

I tried several declarations:  
**- 1st attempt with:**

```auto
fTree2 -> Branch ("vCl_Cr_KU_En",	&vCl_Cr_KU_En[0][0],	Form("vCl_Cr_KU_En[%i][4]/D",	nb_ClKU));

```

The spectra were still mixed.  
**- 2nd attempt with:**

```auto
fTree2 -> Branch ("vCl_Cr_KU_En",	&vCl_Cr_KU_En, "vCl_Cr_KU_En/D");

```

The spectra are empty in this case, most likely it does not find what to fill.  
**- 3rd attempt with:**

```auto
fTree2 -> Branch ("vCl_Cr_KU_En",	&vCl_Cr_KU_En);

```

It is working like charm (but not 4th time).

**However** , is it correct that there is no need to generate dictionaries?  
I tried with and without the following line in my EventAction.cc constructor (from post [Vector in Branch](https://root-forum.cern.ch/t/vector-in-branch/12796/2)):

```auto
gROOT->ProcessLine("#include <vector>");

```

And there was no difference.  
Is it because it is a std::vector? and not a user defined type or class?

Thank you again!!!

---

_[View the full topic](https://root-forum.cern.ch/t/pb-with-two-dimensional-arrays-in-tbranch/37494)._
