How to find "optimal" slice limits?

Hi,

do you know of a (semi?) automatic way to slice a histogram in (say) 10 bins of different widhts,
in such a way that in every bin I have more or less the same number of entries?
The general histogram shape is some sort of bifurcated gaussian, but averages, sigmaLefts
and sigmaRights may vary a lot.
(I am not even sure that the problem has one solution only)

It could of course be done “by eye”, with help from the “event statusbar”,
but I may have a lot of histos to slice…thank you very much for any hints, or scripts
that you may have done to do this.

OK, sorry for posting too early! Of course there is one (1) solution:

Divide the number of entries by N (the N of slices I want to make) and start scanning
with GetBinContent. When I have summed >=Ntot/N, then there is my 1st slice,
and its limits. And so on.

er…now the question is…is there already a TH1 function to do this? :frowning:)