Obtaining a histogram from a vector of "bin contents"

Hello,
I need to apply to a histogram the so called “smoothing”: in each bin I have to substitute the bin content with the mean content between that bin, the previous one, and the following one. And so on, over all the bins.
To do so, I was thinking about looping over the bin contents saved as a vector of dimensions equal to the number of bins, and treat that vector with the smoothing. But then, how can I fill a new histogram with the new vector obtained? I mean, if I have a vector (n1,…,nn), whose “ni” has to be the content of the “i-th” bin of a histogram, how can I fill and plot this histogram?
Thank you very much!
Elena

see TH1::Smooth
root.cern.ch/root/html/TH1.html#TH1:Smooth

Rene