# TTree::Draw GetW, GetV1, GetV2, GetV3, GetV4, GetVal

**URL:** <https://root-forum.cern.ch/t/ttree-draw-getw-getv1-getv2-getv3-getv4-getval/19013>\
**Category:** ROOT\
**Created:** [March 24, 2015, 4:38pm UTC](https://root-forum.cern.ch/t/ttree-draw-getw-getv1-getv2-getv3-getv4-getval/19013 "2015-03-24T16:38:15Z")\
**Posts on this page:** 3\
**Page:** 1

<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:** [March 24, 2015, 4:38pm UTC](https://root-forum.cern.ch/t/ttree-draw-getw-getv1-getv2-getv3-getv4-getval/19013/1 "2015-03-24T16:38:15Z")

</div>

In the [TTree::Draw](https://root.cern.ch/root/html534/TTree.html#TTree:Draw@2) method description, I find: “The content will be the last `GetSelectedRows() % GetEstimate()` values calculated.”  
Shouldn’t it be something like: “The content will be the last `min(GetSelectedRows(), GetEstimate())` values calculated.”?

---

<div class="post-metadata">

**Author:** ![pcanal](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/pcanal/32/12439_2.png) [@pcanal](https://root-forum.cern.ch/u/pcanal)\
**Post date:** [March 24, 2015, 7:38pm UTC](https://root-forum.cern.ch/t/ttree-draw-getw-getv1-getv2-getv3-getv4-getval/19013/2 "2015-03-24T19:38:45Z")

</div>

HI Wile,

It is officially the modulo even-though you are right in most circumstances as when we go back to the start of the array we do not wipe the all values. I suppose we could probably extent the semantic by explicitly describing that it is (used as) a circular buffer and where the old points is. Could you propose a patch to the documentation?

Thanks,  
Philippe.

---

<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:** [March 26, 2015, 1:35pm UTC](https://root-forum.cern.ch/t/ttree-draw-getw-getv1-getv2-getv3-getv4-getval/19013/3 "2015-03-26T13:35:24Z")

</div>

So, what you say is that if the “number of values accepted by the selection expression” is accidentally equal to “fEstimate” then the user is not expected to retrieve any results (because in this case “`GetSelectedRows() % GetEstimate()`” is simply 0).

Note also that the “Example” line:

`Root > TGraph *gr = new TGraph(ntuple->GetSelectedRows()`,  
is (in any case) only valid if “`GetSelectedRows() <= GetEstimate()`” (which is nowhere mentioned).

In the end, as these are some “circular buffers”, I propose that you simply explicitly say:

`Root > TGraph *gr = new TGraph(TMath::Min(ntuple->GetSelectedRows(), ntuple->GetEstimate())`,  
(well, let’s forget cases when “`GetSelectedRows() < 1`”) and then also:  
“The content will be the last `min(GetSelectedRows(), GetEstimate())` values calculated.”

Another modification could be that you just stop filling there “buffers” as soon as “fEstimate” entries are accepted. In this case the user would get (at most) the first “fEstimate” entries that matched (this could possibly be a better idea than having a “circular buffer” of events).
