filter trace by partition function