# FindFirstBinAbove for THStack

**URL:** <https://root-forum.cern.ch/t/findfirstbinabove-for-thstack/15589>\
**Category:** ROOT\
**Created:** [February 4, 2013, 6:53pm UTC](https://root-forum.cern.ch/t/findfirstbinabove-for-thstack/15589 "2013-02-04T18:53:21Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [February 4, 2013, 8:31pm UTC](https://root-forum.cern.ch/t/findfirstbinabove-for-thstack/15589/2 "2013-02-04T20:31:13Z")

</div>

Try to play with this:

```auto
TH1 *h = ((TH1 *)(YourHStack->GetStack()->Last())); // the "SUM"
Int_t firstbin = h->FindFirstBinAbove(0);
Int_t lastbin = h->FindLastBinAbove(0);
TCanvas *c = new TCanvas("c", "THStack SUM");
h->Draw();

```

---

_[View the full topic](https://root-forum.cern.ch/t/findfirstbinabove-for-thstack/15589)._
