TProfile -- normalizing to compare with other data

Hi there!

I have three TProfile distributions, that have almost the same shape but shifted Y values for a known reason. I would like to normalize them, say, set Y value at a given X to 0, then shift the rest of the Y values along Y axis. At the end I should get merged one distribution. Is there a way to realize it in ROOT and to get numeric values of X and Y(calculated as an avarage for every bin in X) from TProfile? Thanks in advance!

This sounds a bit easier to do on the underlying distributions, i.e. before you build the profile. Is that an option? Maybe @moneta has another idea?

Hi Axel,

Thanks for your reply. I do not think so, for comparison I need averaged Y values. But if there is a way to get this average Y values for every bin in X without profile, then it may be. Is there?

Hi,

I think the easiest solution for this is to do it manually, we do not have such function in the ROOT Profile class.
You can do it before filling as suggested before, but you need to compute first the averages, or you can retrieve the Y data given X bin using TProfile::GetBinContent(bin) and TProfile::GetBinError(bin) and then fill another TH1 or TGraph with the retrieve Y values and errors and apply the correct scaling or call TH1::Add(function).

Lorenzo

Thanks, Lorenzo!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.