Sliding Merge in FitslicesY()

Hello,

I am trying to use the TH2::FitSlicesY() method and it is indeed very handy and useful. Could someone explain me what the “sliding merge” option (something like using “G4S”) does in comparison to just using “G4”?

Does it group bins only if they have entries below some given threshold (parameter number 4)?

I would like to use it to group bins with a small number of entries. I tried using variable binning and it helps, but if this option implements some sort of “dynamic” binning, I could just use a very fine X axis binning on the original TH2 histogram and use this option. Then hopefully the low stat bins will be grouped automatically.

is there a better way of doing this? Is the sliding merge option the way to do it?

Thanks

Hi,

Sliding merge will merge n consecutive bins, but the group will be moved bin by bin.
So, suppose you have 100 bins and toy use TH2::FitSlicesY with the option “G4S”. In they case for each bin in Y,
you will merge with its 4 consecutive bins, but you fill fit still 100 slices (you have 100 groups, overlapping each other)
In case of G4 you will merge the 4 bins in 25 groups, which do not overlap.
I hope it is clear, you can also look at the code in

root.cern.ch/lxr/source/hist/his … H2.cxx#665

Lorenzo