# Bad values from GetV1()

**URL:** <https://root-forum.cern.ch/t/bad-values-from-getv1/40326>\
**Category:** ROOT\
**Created:** [July 9, 2020, 7:02am UTC](https://root-forum.cern.ch/t/bad-values-from-getv1/40326 "2020-07-09T07:02:34Z")\
**Posts on this page:** 1\
**Showing post:** 4

<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:** [July 9, 2020, 10:46am UTC](https://root-forum.cern.ch/t/bad-values-from-getv1/40326/4 "2020-07-09T10:46:23Z")

</div>

Problem description (more than 5 years old):

> [@TTree::Draw GetW, GetV1, GetV2, GetV3, GetV4, GetVal](https://root-forum.cern.ch/t/ttree-draw-getw-getv1-getv2-getv3-getv4-getval/19013):
>
> 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.”?

Possible solutions:

> [@The fastest way to read all tree branch data?](https://root-forum.cern.ch/t/the-fastest-way-to-read-all-tree-branch-data/38263/3):
>
> { TFile \*f = TFile::Open("some\_file.root"); TTree \*t; f-\>GetObject("some\_tree", t); t-\>SetEstimate(-1); // keep all results (assumes one result per entry) Long64\_t n = t-\>Draw("some\_leaf", "", "goff"); #if 1 /\* 0 or 1 \*/ if (n \> t-\>GetEstimate()) // just a precaution { t-\>SetEstimate(n); t-\>Draw("some\_leaf", "", "goff"); } #endif /\* 0 or 1 \*/ for (Long64\_t i = 0; i \< n; i++) std::cout \<\< t-\>GetV1()[i] \<\< std::endl; }

> [@How to push data to vector from branch tree](https://root-forum.cern.ch/t/how-to-push-data-to-vector-from-branch-tree/32616/2):
>
> #include "TTree.h" #include "TGraph.h" #include "TString.h" #include "TPad.h" #include "TMath.h" #include \<iostream\> TGraph \*DrawGraph(const char \*xname, const char \*yname, TTree \*tree, const char \*selection = "", const char \*gname = "MyGraph") { TGraph \*g = ((TGraph\*)0); if (!(xname && xname[0] && yname && yname[0] && tree)) return g; if (!selection) selection = ""; if (!(gname && gname[0])) gname = "MyGraph"; tree-\>SetEstimate(-1); // keep all results (assumes one r…

---

_[View the full topic](https://root-forum.cern.ch/t/bad-values-from-getv1/40326)._
