FIXME: Sorting of data types in [EventLoaderEUDAQ2], follow-up of !98
Jens:
// FIXME get TLU events with trigger IDs before Ni - sort by name, reversed
sort(events_.begin(), events_.end(), [](const eudaq::EventSPC& a, const eudaq::EventSPC& b) -> bool {
return a->GetDescription() > b->GetDescription();
});
If I understand this code block correctly, it sorts the (sub-)events by name in reverse alphabetical order (z->a), right?
So it's fine for now because TluRawDataEvent
ends up before NiRawDataEvent
. But once we introduce another detector with data like ZdetRawDataEvent
it'll fail.
So what if we introduced another parameter in the config file like
data_type_order = ["TluRawDataEvent","NiRawDataEvent"]
and then we sort according to the position of the names in the list?
Simon: If you implement this, please take care of all corner cases (some data type not specified, the data type specified does not exist) and also keep the performance of the algorithm in mind. Especially string comparisons are very heavy. Make sure to document the behavior of this properly.