def get_data_in_event_range(array, event_start=None, event_stop=None, assume_sorted=True):
logging.debug("<STR_LIT>" + str(event_start) + "<STR_LIT:U+002CU+0020>" + str(event_stop) + "<STR_LIT:[>")<EOL>event_number = array['<STR_LIT>']<EOL>if assume_sorted:<EOL><INDENT>data_event_start = event_number[<NUM_LIT:0>]<EOL>data_event_stop = event_number[-<NUM_LIT:1>]<EOL>if (event_start is not None and event_stop is not None) and (data_event_stop < event_start or data_event_start > event_stop or event_start == event_stop):  <EOL><INDENT>return array[<NUM_LIT:0>:<NUM_LIT:0>]<EOL><DEDENT>if event_start is None:<EOL><INDENT>min_index_data = <NUM_LIT:0><EOL><DEDENT>else:<EOL><INDENT>min_index_data = np.argmin(event_number < event_start)<EOL><DEDENT>if event_stop is None:<EOL><INDENT>max_index_data = event_number.shape[<NUM_LIT:0>]<EOL><DEDENT>else:<EOL><INDENT>max_index_data = np.argmax(event_number >= event_stop)<EOL><DEDENT>if min_index_data < <NUM_LIT:0>:<EOL><INDENT>min_index_data = <NUM_LIT:0><EOL><DEDENT>if max_index_data == <NUM_LIT:0> or max_index_data > event_number.shape[<NUM_LIT:0>]:<EOL><INDENT>max_index_data = event_number.shape[<NUM_LIT:0>]<EOL><DEDENT>return array[min_index_data:max_index_data]<EOL><DEDENT>else:<EOL><INDENT>return array[ne.evaluate('<STR_LIT>')]<EOL><DEDENT>
Selects the data (rows of a table) that occurred in the given event range [event_start, event_stop[

    Parameters
    ----------
    array : numpy.array
    event_start : int, None
    event_stop : int, None
    assume_sorted : bool
        Set to true if the hits are sorted by the event_number. Increases speed.

    Returns
    -------
    numpy.array
        hit array with the hits in the event range.