def retrieve_entry_pre_c_mass(self, pre_c_mass):
    mass_error_threshold = ((pre_c_mass * self.ppm) / 1000000)
    ret_entries = []
    loc_dict = (int(pre_c_mass) - (int(pre_c_mass) % self.db.dalt_diff_lookup_bin))
    loc_dict_lower = (int((pre_c_mass - mass_error_threshold)) - (int((pre_c_mass - mass_error_threshold)) % self.db.dalt_diff_lookup_bin))
    loc_dict_upper = (int((pre_c_mass + mass_error_threshold)) - (int((pre_c_mass + mass_error_threshold)) % self.db.dalt_diff_lookup_bin))
    locs_to_search = list(set([loc_dict, loc_dict_lower, loc_dict_upper]))
    for loc in locs_to_search:
        try:
            for (name, entr) in self.db.ms1_dict_lookup[loc].items():
                mass_error = abs((entr.mw - pre_c_mass))
                if (mass_error < mass_error_threshold):
                    ret_entries.append([name, mass_error, entr])
        except KeyError:
            logging.warning(('Could not find an entry in the database for prec mass: %s' % pre_c_mass))
            continue
    return ret_entries
def retrieve_entry_pre_c_mass(self, pre_c_mass):
    mass_error_threshold = ((pre_c_mass * self.ppm) / 1000000)
    ret_entries = []
    loc_dict = (int(pre_c_mass) - (int(pre_c_mass) % self.db.dalt_diff_lookup_bin))
    loc_dict_lower = (int((pre_c_mass - mass_error_threshold)) - (int((pre_c_mass - mass_error_threshold)) % self.db.dalt_diff_lookup_bin))
    loc_dict_upper = (int((pre_c_mass + mass_error_threshold)) - (int((pre_c_mass + mass_error_threshold)) % self.db.dalt_diff_lookup_bin))
    locs_to_search = list(set([loc_dict, loc_dict_lower, loc_dict_upper]))
    for loc in locs_to_search:
        try:
            for (name, entr) in self.db.ms1_dict_lookup[loc].items():
                mass_error = abs((entr.mw - pre_c_mass))
                if (mass_error < mass_error_threshold):
                    ret_entries.append([name, mass_error, entr])
        except KeyError:
            logging.warning(('Could not find an entry in the database for prec mass: %s' % pre_c_mass))
            continue
    return ret_entries