def METHOD_NAME(sphere_model, run_in_tmpdir):
    # Set maximum number of tracks per process to write
    sphere_model.settings.max_tracks = 25
    sphere_model.settings.photon_transport = True
    # Run OpenMC to generate tracks.h5 file
    generate_track_file(sphere_model, tracks=True)
    tracks = openmc.Tracks('tracks.h5')
    for track in tracks:
        # Test filtering by particle
        matches = track.filter(particle='photon')
        for x in matches:
            assert x.particle == openmc.ParticleType.PHOTON
        # Test general state filter
        matches = track.filter(state_filter=lambda s: s['cell_id'] == 1)
        assert isinstance(matches, openmc.Track)
        assert matches.particle_tracks == track.particle_tracks
        matches = track.filter(state_filter=lambda s: s['cell_id'] == 2)
        assert matches.particle_tracks == []
        matches = track.filter(state_filter=lambda s: s['E'] < 0.0)
        assert matches.particle_tracks == []
    # Test filter method on Tracks
    matches = tracks.filter(particle='neutron')
    assert isinstance(matches, openmc.Tracks)
    assert matches == tracks
    matches = tracks.filter(state_filter=lambda s: s['E'] > 0.0)
    assert matches == tracks
    matches = tracks.filter(particle='bunnytron')
    assert matches == []