# Filling mixed typed TTree with Python

**URL:** <https://root-forum.cern.ch/t/filling-mixed-typed-ttree-with-python/34415>\
**Category:** ROOT\
**Created:** [June 4, 2019, 2:46pm UTC](https://root-forum.cern.ch/t/filling-mixed-typed-ttree-with-python/34415 "2019-06-04T14:46:59Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![dastudillo](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/dastudillo/32/17280_2.png) [@dastudillo](https://root-forum.cern.ch/u/dastudillo)\
**Post date:** [June 5, 2019, 10:47am UTC](https://root-forum.cern.ch/t/filling-mixed-typed-ttree-with-python/34415/3 "2019-06-05T10:47:13Z")

</div>

I think it has to do with ROOT expecting contiguous memory for the consecutive members of a struct or object. An odd number of integers leaves a “gap” before the double, which breaks ROOT. So either ensure you have an even number of ints before a double, or put the integers after the doubles, e.g.:

```auto
struct MyStruct {
   Double_t b;
   Int_t a;
};

```

---

_[View the full topic](https://root-forum.cern.ch/t/filling-mixed-typed-ttree-with-python/34415)._
