Remove data elements from TH1F?


I was wondering whether it is possible to remove data once I have put it in a TH1F? In this particular case, I want to remove the two maximum and minimum data points, and re-evaluate the mean. I know that one can add and subtract amounts from bins, but I want to pull the actual data points out so that the calculations of Mean and RMS are accurate.


You can set some of the bin contents to zero. By setting new bin contents the statics should be recalculated when GetMean or GetRMS is called. (You can also call TH1::ResetStats() to force the re-calculation of the histogram statistics)