def METHOD_NAME(programs, processEvent, paramsDict):
    for program in programs["program"]:
        try:
            allowed_events = program.get_property("event").split(" ")
            if processEvent in allowed_events:
                executable = program.get_property("executable")
                if os.path.isfile(executable):
                    if processEvent == "end_multicollect":
                        endOfLineToExecute = grouped_processing(
                            "end_multicollect", paramsDict
                        )
                    elif os.path.isdir(paramsDict["xds_dir"]):
                        dataCollectionId = paramsDict.get("datacollect_id")
                        residues = paramsDict.get("residues", 0)
                        anomalous = paramsDict.get("anomalous", False)
                        spacegroup = paramsDict.get("spacegroup")
                        if spacegroup:
                            sg_opt = " -sg {0}".format(spacegroup)
                        else:
                            sg_opt = ""
                        unit_cell_constants = paramsDict.get("cell")
                        if unit_cell_constants:
                            cell_opt = ' -cell "{0}"'.format(unit_cell_constants)
                        else:
                            cell_opt = ""
                        endOfLineToExecute = (
                            " -path "
                            + paramsDict["xds_dir"]
                            + " -mode "
                            + processEvent
                            + " -datacollectionID "
                            + str(dataCollectionId)
                            + " -residues "
                            + str(residues)
                            + " -anomalous "
                            + str(anomalous)
                            + sg_opt
                            + cell_opt
                        )  # +\
                        # (paramsDict["inverse_beam"] and ' -inverse' or '')
                    lineToExecute = (
                        executable + endOfLineToExecute + " 2>&1 > /dev/null &"
                    )
                    logging.info(
                        "Process event %s, executing %s"
                        % (processEvent, str(lineToExecute))
                    )
                    subprocess.Popen(
                        str(lineToExecute),
                        shell=True,
                        stdin=None,
                        stdout=None,
                        stderr=None,
                        close_fds=True,
                    )
                else:
                    logging.getLogger().error(
                        "No program to execute found (%s)", executable
                    )
        except KeyError:
            logging.exception("autoprocessing: an error occurred")