Guarantee deterministic tie-breaking in finalsink `is_better_event()`
In !22 (merged) we define is_better_event()
, which is used to determine the preferred event when clustering events.
Currently is_better_event()
compares events by their statistical significance based on coherent SNR, which itself depends on the extracted chisq series for each IFO, and then tie-breaks somewhat arbitrarily by end time.
Another theoretically possible source of nondeterminism in the is_better_event()
outputs could result in multiple runs of the same pipeline where the selected end time itself could vary for each best template. In the 2022-07-11 review, the review team identified this possible outlier.
In the case that two events are considered equal, we have no technical or scientific reason to pick one over the other, as we have no further information to distinguish which event is more statistically significant. To guarantee we avoid this rare case, we can select some arbitrary but unique additional metric by which to tie-break.
The most convenient to implement metric that is guaranteed to distinguish events with the same end time is the global template id.
This can be implemented by first tie-breaking by bankid
, then by tmplt_idx
.
This additional tie-break has no scientific significance, but guarantees deterministic behaviour, as desired.