def select_hits_from_cluster_info(input_file_hits, output_file_hits, cluster_size_condition, n_cluster_condition, chunk_size=<NUM_LIT>):
logging.info('<STR_LIT>' + str(input_file_hits) + '<STR_LIT>' + cluster_size_condition + '<STR_LIT>' + n_cluster_condition + '<STR_LIT>' + str(output_file_hits))<EOL>with tb.open_file(input_file_hits, mode="<STR_LIT>") as in_hit_file_h5:<EOL><INDENT>analysis_utils.index_event_number(in_hit_file_h5.root.Hits)<EOL>analysis_utils.index_event_number(in_hit_file_h5.root.Cluster)<EOL>with tb.open_file(output_file_hits, mode="<STR_LIT:w>") as out_hit_file_h5:<EOL><INDENT>hit_table_out = out_hit_file_h5.create_table(out_hit_file_h5.root, name='<STR_LIT>', description=data_struct.HitInfoTable, title='<STR_LIT>', filters=tb.Filters(complib='<STR_LIT>', complevel=<NUM_LIT:5>, fletcher32=False))<EOL>cluster_table = in_hit_file_h5.root.Cluster<EOL>last_word_number = <NUM_LIT:0><EOL>progress_bar = progressbar.ProgressBar(widgets=['<STR_LIT>', progressbar.Percentage(), '<STR_LIT:U+0020>', progressbar.Bar(marker='<STR_LIT:*>', left='<STR_LIT:|>', right='<STR_LIT:|>'), '<STR_LIT:U+0020>', progressbar.AdaptiveETA()], maxval=cluster_table.shape[<NUM_LIT:0>], term_width=<NUM_LIT>)<EOL>progress_bar.start()<EOL>for data, index in analysis_utils.data_aligned_at_events(cluster_table, chunk_size=chunk_size):<EOL><INDENT>selected_events_1 = analysis_utils.get_events_with_cluster_size(event_number=data['<STR_LIT>'], cluster_size=data['<STR_LIT:size>'], condition=cluster_size_condition)  <EOL>selected_events_2 = analysis_utils.get_events_with_n_cluster(event_number=data['<STR_LIT>'], condition=n_cluster_condition)  <EOL>selected_events = analysis_utils.get_events_in_both_arrays(selected_events_1, selected_events_2)  <EOL>logging.debug('<STR_LIT>' + str(len(selected_events)) + '<STR_LIT>' + n_cluster_condition + '<STR_LIT>' + cluster_size_condition)<EOL>last_word_number = analysis_utils.write_hits_in_events(hit_table_in=in_hit_file_h5.root.Hits, hit_table_out=hit_table_out, events=selected_events, start_hit_word=last_word_number)  <EOL>progress_bar.update(index)<EOL><DEDENT>progress_bar.finish()<EOL>in_hit_file_h5.root.meta_data.copy(out_hit_file_h5.root)<EOL><DEDENT><DEDENT>
Takes a hit table and stores only selected hits into a new table. The selection is done on an event base and events are selected if they have a certain number of cluster or cluster size.
    To increase the analysis speed a event index for the input hit file is created first. Since a cluster hit table can be created to this way of hit selection is
    not needed anymore.

     Parameters
    ----------
    input_file_hits: str
        the input file name with hits
    output_file_hits: str
        the output file name for the hits
    cluster_size_condition: str
        the cluster size condition to select events (e.g.: 'cluster_size_condition <= 2')
    n_cluster_condition: str
        the number of cluster in a event ((e.g.: 'n_cluster_condition == 1')