EvLoEUDAQ2: create new StdEvent instead of recycling if decoding fails
We should create new StandardEvents after the decoding of one failed. Currently, we are re-using the event which might already contain some information set before the decoding process returned false
.
Imagine a decoder:
bool MyStdEventConverter::Converting(eudaq::EventSPC d1, eudaq::StandardEventSP d2, eudaq::ConfigurationSPC conf) const {
auto ev = std::dynamic_pointer_cast<const eudaq::RawEvent>(d1);
// Set a tag
d2->SetTag("soup", "magic");
if(1) false;
}
This will first set a tag in the event object d2
and then return false. If we continue with
auto stevt = eudaq:StandardEvent::MakeShared();
do {
//...
bool failed = Convert(event, stdevt);
} while (failed)
The tag will persist. Thus, we need to delete the failed stdevt
attempt and create a new one.