# Help with filling a Tree branch with a structure of vectors

**URL:** <https://root-forum.cern.ch/t/help-with-filling-a-tree-branch-with-a-structure-of-vectors/38684>\
**Category:** Newbie\
**Tags:** tree\
**Created:** [April 3, 2020, 6:05pm UTC](https://root-forum.cern.ch/t/help-with-filling-a-tree-branch-with-a-structure-of-vectors/38684 "2020-04-03T18:05:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![imaznas](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/i/ed8c4c/32.png) [@imaznas](https://root-forum.cern.ch/u/imaznas)\
**Post date:** [April 3, 2020, 6:05pm UTC](https://root-forum.cern.ch/t/help-with-filling-a-tree-branch-with-a-structure-of-vectors/38684/1 "2020-04-03T18:05:48Z")

</div>

Dear support team,

I’ve been trying without success to fill a branch of a tree with a structure of vectors.  
Essentially I would like to achieve what’s discribed in [this presentation](http://www-f9.ijs.si/~eva/rootForBeginners/ROOT_for_beginners_Day4.pdf) (p17-18) but with vectors instead of arrays. Is there a way to do that?

An example of the structure I would like to have is the following:

```auto
        struct lepton
        {
            vector <Double_t> px;
            vector <Double_t> py;
            vector <Double_t> pz;
            vector <Double_t> E;
        };

```

Thank you for your time!

Best regards,  
Yannis

ROOT Version: ROOT 6.18/04  
CentOS (lxplus)

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [April 6, 2020, 6:42am UTC](https://root-forum.cern.ch/t/help-with-filling-a-tree-branch-with-a-structure-of-vectors/38684/2 "2020-04-06T06:42:22Z")

</div>

I guess @pcanal can help you with this question.

---

<div class="post-metadata">

**Author:** ![imaznas](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/i/ed8c4c/32.png) [@imaznas](https://root-forum.cern.ch/u/imaznas)\
**Post date:** [April 6, 2020, 6:57am UTC](https://root-forum.cern.ch/t/help-with-filling-a-tree-branch-with-a-structure-of-vectors/38684/3 "2020-04-06T06:57:41Z")

</div>

WelI, I found another way to do what I needed.  
I think you can close the ticket!
