How to select objects by collection from selected objects in the scene with Python?
Sample script based on your collection name.

import bpy

sel_objs = bpy.context.selected_objects

#identify and choose collection union
col = bpy.data.collections["Abete massiccio"]

# create a list requiring both objects selected and in chosen collection
objs_in_col = [obj for obj in col.objects if obj in sel_objs]

for obj in objs_in_col:
    print("Object name: %s \t Collection: %s" %(obj.name, col.name))