Skip to content

Commit 43df410

Browse files
sawenzelclaude
andcommitted
Finish detector events before sending hits in parallel o2-sim
This fixes the order in which a parallel o2-sim worker finalizes and sends the hits of an event. - Detectors ran FinishEvent after SendData, while serial o2-sim (FairMCApplication) runs it before filling the output. - TRD sorts its hits in FinishEvent, and PHOS and CPV sort them and sum duplicates. - With TMessage transport their hits were written unsorted and, for PHOS and CPV, with duplicates. - With shared memory the merger read the buffers while the worker rewrote them, so TRD output differed between the two transports. - FinishEvent now runs for all detectors before SendData, and EndOfEvent after it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 745cb1a commit 43df410

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎Steer/include/Steer/O2MCApplication.h‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,17 @@ class O2MCApplication : public O2MCApplicationBase
5353

5454
finishEventCommon();
5555

56+
// detectors finalize their hits (e.g. sorting, summing duplicates) before these are sent
57+
for (auto det : listActiveDetectors) {
58+
det->FinishEvent();
59+
}
60+
5661
// This special finish event version does not fill the output tree of FairRootManager
5762
// but forwards the data to the HitMerger
5863
SendData();
5964

6065
// call end of event on active detectors
6166
for (auto det : listActiveDetectors) {
62-
det->FinishEvent();
6367
det->EndOfEvent();
6468
}
6569
fStack->Reset();

0 commit comments

Comments
 (0)