This function accepts a set of ids and a vector of categorical tracks. For
each track it calculates how many ids appear in the track. Each id is
counted only once.
Ids can originate from a track or be provided within Ids Table.
Note: The internal iterator that runs over each track is defined with
'keepref=TRUE'.