Separation of energy fractions of an electron beam by a localized nonuniformity of magnetic field in the collector region of gyrodevices