# TTree::GetV1() array limits?

**URL:** <https://root-forum.cern.ch/t/ttree-getv1-array-limits/3325>\
**Category:** ROOT\
**Created:** [May 11, 2006, 1:24pm UTC](https://root-forum.cern.ch/t/ttree-getv1-array-limits/3325 "2006-05-11T13:24:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mathias](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/m/bbe5ce/32.png) [@Mathias](https://root-forum.cern.ch/u/Mathias)\
**Post date:** [May 11, 2006, 1:24pm UTC](https://root-forum.cern.ch/t/ttree-getv1-array-limits/3325/1 "2006-05-11T13:24:41Z")

</div>

Hi all,

Sorry for bugging you once again. This time I have a problem with the TTree::GetV1()-method. When I do a TTree::Draw and want to get the selected values with GetV1() everything is fine as long as not more than 1e6 entries were selected. If more than 1e6 values are selected TTree::GetSelectedRows() returns the correct number but all entries in v1 beyond the index 1e6 are either equal to zero or equal to one. Attached you will find a very simple macro to illustrate this. So is this a bug or am I doing something stupid?

Thanks, Mathias  
[testv1.c](https://root-forum.cern.ch/uploads/default/original/2X/e/e7bb4c1f6e904129253630f3e19be620acd8bf3b.c) (350 Bytes)

---

<div class="post-metadata">

**Author:** ![musinsky](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/musinsky/32/11106_2.png) [@musinsky](https://root-forum.cern.ch/u/musinsky)\
**Post date:** [May 11, 2006, 1:47pm UTC](https://root-forum.cern.ch/t/ttree-getv1-array-limits/3325/2 "2006-05-11T13:47:06Z")

</div>

add this line before tree-\>Draw(" "):

```auto
tree->SetEstimate(tree->GetEntries());
tree->Draw("v1", "", "goff");
```

and see: [root.cern.ch/root/htmldoc///TTre … TTree:Draw](http://root.cern.ch/root/htmldoc///TTree.html#TTree:Draw) “How to obtain more info from TTree::Draw”

Jan

---

<div class="post-metadata">

**Author:** ![Mathias](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/m/bbe5ce/32.png) [@Mathias](https://root-forum.cern.ch/u/Mathias)\
**Post date:** [May 11, 2006, 1:57pm UTC](https://root-forum.cern.ch/t/ttree-getv1-array-limits/3325/3 "2006-05-11T13:57:26Z")

</div>

Thanks for the quick answer, works perfectly 🙂

---

<div class="post-metadata">

**Author:** ![Confused](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/c/f08c70/32.png) [@Confused](https://root-forum.cern.ch/u/Confused)\
**Post date:** [March 6, 2018, 10:42am UTC](https://root-forum.cern.ch/t/ttree-getv1-array-limits/3325/4 "2018-03-06T10:42:13Z")

</div>

To avoid all problems, it has to be:

```auto
tree->SetEstimate(tree->GetEntries() + 1);

```

Or, that is the same:

```auto
tree->SetEstimate(-1);

```
