def xyz(self, idx):
        """
        return binx, biny, binz corresponding to the global bin number
        """
        # Not implemented for Python 3:
        # GetBinXYZ(i, x, y, z)
        nx  = self.GetNbinsX() + 2
        ny  = self.GetNbinsY() + 2
        ndim = self.GetDimension()
        if ndim < 2:
            binx = idx % nx
            biny = 0
            binz = 0
        elif ndim < 3:
            binx = idx % nx
            biny = ((idx - binx) // nx) % ny
            binz = 0
        elif ndim < 4:
            binx = idx % nx
            biny = ((idx - binx) // nx) % ny
            binz = ((idx - binx) // nx - biny) // ny
        else:
            raise NotImplementedError
        return binx, biny, binz
return binx, biny, binz corresponding to the global bin number