# Error calculation of 2D histogram

**URL:** <https://root-forum.cern.ch/t/error-calculation-of-2d-histogram/50712>\
**Category:** Newbie\
**Created:** [July 7, 2022, 6:34pm UTC](https://root-forum.cern.ch/t/error-calculation-of-2d-histogram/50712 "2022-07-07T18:34:04Z")\
**Posts on this page:** 1\
**Showing post:** 3

<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 8, 2022, 7:17am UTC](https://root-forum.cern.ch/t/error-calculation-of-2d-histogram/50712/3 "2022-07-08T07:17:33Z")

</div>

```cpp
  TH2F *h_ratio_errors = (TH2F*)h_ratio->Clone("h_ratio_errors");
  for (int i = 0; i < h_ratio_errors->GetSize(); i++)
    h_ratio_errors->GetArray()[i] = h_ratio_errors->GetBinError(i);
  h_ratio_errors->Sumw2(kFALSE);
  // h_ratio_errors->ResetStats();

```

---

_[View the full topic](https://root-forum.cern.ch/t/error-calculation-of-2d-histogram/50712)._
