# Problem in smearing histogram plotted from a text file

**URL:** <https://root-forum.cern.ch/t/problem-in-smearing-histogram-plotted-from-a-text-file/53641>\
**Category:** Newbie\
**Tags:** hist, root\
**Created:** [February 15, 2023, 11:58am UTC](https://root-forum.cern.ch/t/problem-in-smearing-histogram-plotted-from-a-text-file/53641 "2023-02-15T11:58:46Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Dilicus](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/dilicus/32/14338_2.png) [@Dilicus](https://root-forum.cern.ch/u/Dilicus)\
**Post date:** [February 16, 2023, 1:45pm UTC](https://root-forum.cern.ch/t/problem-in-smearing-histogram-plotted-from-a-text-file/53641/3 "2023-02-16T13:45:26Z")

</div>

Hi @gini,  
as explained in this previous topic

> [@Problem in smearing histogram](https://root-forum.cern.ch/t/problem-in-smearing-histogram/52707/6):
>
> Hi @gini Smear the data means to adding the effect of a resolution broadening your histogram. What you are doing in your code is not smearing, but just changing the number of counts in each bin. From your code I see that you have just a file with the number of counts for each bin. I slightly modified your code to correctly smear the histogram. I generate a gaussian using the mean and std of h1. { gStyle-\>SetOptStat(2211); gStyle-\>SetOptFit(1111); auto c1 = new TCanvas("c1"…

adding a random gaussian resolution to the content bin does not smear the histogram, you are just randomizing the total counts as can be seen from the integral value. Such value should not change after a smearing operation.

We discussed quite a lot such issue in your previous post linked above.

---

_[View the full topic](https://root-forum.cern.ch/t/problem-in-smearing-histogram-plotted-from-a-text-file/53641)._
