Use predefined numbers in ExecutionReportsWriter
The ExecutionReportsWriter algorithm numbers each DecReport object with an incrementing counter starting from zero. This is problematic for two reasons:
- Zero is considered an invalid
DecReportID (although I don't know why, ideas @graven?) - The IDs must be aligned with those set in the
HltANNSvcso that the correct names can be associated to the reports on deserialisation. Because the reports writer is acting in 'isolation', we cannot syncronise the IDs in the configuration.
The reports writer should either query the ANN service to get the IDs, or we can configure the writer explicitly alongside the ANN service, e.g.
lines = [] # get all lines
selection_ids = {line.name: idx + 1 for idx, line in lines}
erw = ExecutionReportsWriter(
# …
SelectionIDs=selection_ids
)
hlt_ann_svc = setup_component(
"HltANNSvc",
# …
Hlt1SelectionID=selection_ids
)
Although a part of me doesn't like 'coupling' things in the C++, I don't like syncing the IDs 'by hand' in Python more, so would probably query the ANN service in the reports writer.