From 4ce602b5408da59def62ba392ad7028b37ad2467 Mon Sep 17 00:00:00 2001 From: Anton Alkin Date: Tue, 25 Jul 2023 10:33:56 +0200 Subject: [PATCH] fix mctracks-proxy partial timeframes --- run/o2sim_mctracks_proxy.cxx | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/run/o2sim_mctracks_proxy.cxx b/run/o2sim_mctracks_proxy.cxx index 10809180d62a6..8bd37a11bb44d 100644 --- a/run/o2sim_mctracks_proxy.cxx +++ b/run/o2sim_mctracks_proxy.cxx @@ -133,26 +133,18 @@ InjectorFunction o2simKinematicsConverter(std::vector const& specs, } ++(*totalEventCounter); - if (nPerTF > 0 && *eventCounter == nPerTF) { - // if aggregation is requested, only send the accumulated vectors + if (nPerTF > 0 && *eventCounter == *Nparts) { + // send the events when the timeframe is accumulated LOGP(info, ">> Events: {}; TF counter: {}", *eventCounter, *TFcounter); *eventCounter = 0; - ++(*TFcounter); sendOnChannel(device, *MCHeadersMessageCache.get(), channelRetriever(specs[0], *TFcounter), *TFcounter); sendOnChannel(device, *MCTracksMessageCache.get(), channelRetriever(specs[1], *TFcounter), *TFcounter); + ++(*TFcounter); MCHeadersMessageCache->Clear(); MCTracksMessageCache->Clear(); } if (*totalEventCounter == nevents) { - if (nPerTF > 0) { - // send accumulated messages if the limit is reached - ++(*TFcounter); - sendOnChannel(device, *MCHeadersMessageCache.get(), channelRetriever(specs[0], *TFcounter), *TFcounter); - sendOnChannel(device, *MCTracksMessageCache.get(), channelRetriever(specs[1], *TFcounter), *TFcounter); - MCHeadersMessageCache->Clear(); - MCTracksMessageCache->Clear(); - } // I am done (I don't expect more events to convert); so tell the proxy device to shut-down stop = true; }