def METHOD_NAME(workdir):
    """
    Return optimizing quantity 'f' and other parameters for convenience.
    Parameters
    ----------
    workdir : Path to directory where the simulation ran.
    """
    # Get beam properties at the beginning of the run
    file_list = glob.glob('diags/plotfiles/plt?????')
    if (len(file_list) <2):
        print(workdir,' did not have final plotfile')
        return np.array([np.nan, np.nan, np.nan, np.nan, np.nan])
    file_list.sort()
    datafile = file_list[0]
    filepath = os.path.join(workdir, datafile)
    charge_i, _, _, emittance_i = _beam_properties(filepath)
    # Get beam properties at the end of the run
    datafile = file_list[-1]
    filepath = os.path.join(workdir, datafile)
    charge_f, energy_avg, energy_std, emittance_f = _beam_properties(filepath)
    if (charge_f > 0.0):
        # delete simulation results, just to have smaller data
        shutil.rmtree('diags')
        # Build a quantity to minimize (f) that encompasses
        # emittance AND charge loss 1% charge loss has the
        # same impact as doubling the initial emittance.
        # we minimize f!
        f = emittance_f + emittance_i*(1.-charge_f/charge_i)*100
        warpx_out = np.array([f, energy_std, energy_avg, charge_f, emittance_f])
        return warpx_out
    else:
        return np.array([np.nan, np.nan, np.nan, np.nan, np.nan])