Skip to content

PyUtils: Add event slicing support when ordering trees in diff-root

It's not commonly used but diff-root historically accepts a list of TTree indices which limits the comparison to only those that are specified (e.g. --entries range(3) or 0,2,1 or 0:3). As we well know, in MT event order in the outputs can change from run-to-run. To support that, we implemented the functionality to --order-trees a while ago, which order trees using event numbers to make an apples-to-apples comparison. However, this new approach was only supporting the case when the user inputs the total number of events to be compared, e.g. --entries N. Now, we also support slicing in the format --entries N:M such that user can compare disjoint events in parallel jobs.

I did a quick test comparing the full 500 events in ART q431 MT AODs. With a single diff-root instance this takes about 40 minutes on my pretty standard desktop. If we split this into 5 parallel instances of diff-root, each comparing 100 unique events via the syntax --entries 0:100, --entries 100:200 etc., we can accomplish the same comparison in under 10 minutes, in the expense of doubling the memory usage. For a trivial change I'd say this is a pretty good boost.

cc: @elmsheus

Merge request reports