def select_hits(hits_array, condition=None):
if condition is None:<EOL><INDENT>return hits_array<EOL><DEDENT>for variable in set(re.findall(r'<STR_LIT>', condition)):<EOL><INDENT>exec(variable + '<STR_LIT>' + variable + '<STR_LIT>')<EOL><DEDENT>return hits_array[ne.evaluate(condition)]<EOL>
Selects the hits with condition.
    E.g.: condition = 'rel_BCID == 7 & event_number < 1000'

    Parameters
    ----------
    hits_array : numpy.array
    condition : string
        A condition that is applied to the hits in numexpr. Only if the expression evaluates to True the hit is taken.

    Returns
    -------
    numpy.array
        hit array with the selceted hits