How to add experimental resolution to a 1D Histogram in root

Assuming that “Aff1” is in “amu” units and you want to add a Gaussian smearing with “3.5 amu” sigma, you could try:

tree->Draw("Aff1 + 3.5 * TMath::Sqrt2() * TMath::ErfInverse(2. * rndm() - 1.) >> h1"); // inverse Gaussian CDF transform sampling