@classmethod
def create(cls, experiments, params=None):
    """
        Select the background calculator

        """
    from dials.algorithms.background.simple.algorithm import SimpleBackgroundCalculatorFactory
    from dials.algorithms.background.glm.algorithm import GLMBackgroundCalculatorFactory
    from dials.algorithms.background.gmodel.algorithm import GModelBackgroundCalculatorFactory
    if params is None:
        from dials.command_line.integrate import phil_scope
        params = phil_scope.extract()
    selection = params.integration.background.algorithm
    if selection == 'simple':
        params = params.integration.background.simple
        kwargs = {'model': params.model.algorithm, 'outlier': params.
            outlier.algorithm, 'min_pixels': params.min_pixels}
        if params.outlier.algorithm == 'null':
            pass
        elif params.outlier.algorithm == 'truncated':
            kwargs['lower'] = params.outlier.truncated.lower
            kwargs['upper'] = params.outlier.truncated.upper
        elif params.outlier.algorithm == 'nsigma':
            kwargs['lower'] = params.outlier.nsigma.lower
            kwargs['upper'] = params.outlier.nsigma.upper
        elif params.outlier.algorithm == 'normal':
            kwargs['min_pixels'] = params.outlier.normal.min_pixels
        elif params.outlier.algorithm == 'plane':
            kwargs['fraction'] = params.outlier.plane.fraction
            kwargs['n_sigma'] = params.outlier.plane.n_sigma
        elif params.outlier.algorithm == 'tukey':
            kwargs['lower'] = params.outlier.tukey.lower
            kwargs['upper'] = params.outlier.tukey.upper
        algorithm = SimpleBackgroundCalculatorFactory.create(experiments,
            **kwargs)
    elif selection == 'glm':
        params = params.integration.background.glm
        algorithm = GLMBackgroundCalculatorFactory.create(experiments,
            model=params.model.algorithm, tuning_constant=params.robust.
            tuning_constant, min_pixels=params.min_pixels)
    elif selection == 'gmodel':
        params = params.integration.background.gmodel
        algorithm = GModelBackgroundCalculatorFactory.create(experiments,
            model=params.model, robust=params.robust.algorithm,
            tuning_constant=params.robust.tuning_constant, min_pixels=
            params.min_pixels)
    else:
        raise RuntimeError('Unknown background algorithm')
    return algorithm
