2D histogram where bin contents are the fitted gaussian sigma of data in each bin

Hello rooters

I am seeking for advice implementing a function. I would like to plot a 2D histogram where the bin contents are the fitted gaussian sigma of the bin contents in each bin. It is something similar to a TProfile2D but, instead of displaying the mean value, the bin content is the Gaussian sigma of the entries in each bin.

Naively, I should book Nx*Ny 1D histos, fill them with data falling in each range ([x[i],x[i+1]) and (y[j],y[j+1]). Then do a gaussian fit, grab the Sigma and h2D->Fill(x[i],y[j],Sigma). I have to be careful there are enough entries in each 1D histo and the fits are good.

I was wondering if this was already implemented in ROOT?

Thank you very much


Please read tips for efficient and successful posting and posting code

ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided

I guess @moneta knows

What you are looking for is probably TH3::FitSliceZ


1 Like

Amazing. Thank you so much!