<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def fitNormalization(self, specVals, xlims):
 """Fit the normalization given a set of spectral values that define a spectral shape This version is faster, and solves for the root of the derivatvie Parameters specVals : an array of (nebin values that define a spectral shape xlims : fit limits returns the best-fit normalization value """

        from scipy.optimize import brentq

        def fDeriv(x): return self.norm_derivative(specVals, x)
        try:
            result = brentq(fDeriv, xlims[0], xlims[1])
        except:
            check_underflow = self.__call__(specVals * xlims[0]) < \
                self.__call__(specVals * xlims[1])
            if check_underflow.any():
                return xlims[0]
            else:
                return xlims[1]
        return result