Check how many trackers are selected
import bpy

context = bpy.context

# choose from data
tracks = bpy.data.movieclips["clip_name"].tracking.objects

# choose from context
tracks = context.scene.active_clip.tracking.objects 

# selected camera tracks
selected_camera_tracks = [t for t in tracks['Camera'].tracks if t.select]

# selected object_tracks
selected_object_tracks = [t for t in tracks['Object'].tracks if t.select]

# toggle selected object tracks
for t in tracks['Object'].tracks:
    t.select = not t.select