Skip to content

Commit

Permalink
fix mctracks-proxy partial timeframes
Browse files Browse the repository at this point in the history
  • Loading branch information
aalkin committed Aug 8, 2023
1 parent 96cae76 commit 4ce602b
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions run/o2sim_mctracks_proxy.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -133,26 +133,18 @@ InjectorFunction o2simKinematicsConverter(std::vector<OutputSpec> 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;
}
Expand Down

0 comments on commit 4ce602b

Please sign in to comment.