ATLAS Offline Software
Loading...
Searching...
No Matches
G4RunToolWorkerRunManager.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
6
8
9#include "G4Event.hh"
10
11#include <memory>
12
14{
16
17 std::shared_ptr<G4EventSynchronizationInterface> syncInterface;
18 EventOutcome outcome = EventOutcome::Success;
19
20 if (currentEvent) {
21 if (auto* eventInfo = dynamic_cast<AtlasG4SyncEventUserInfo*>(
22 currentEvent->GetUserInformation())) {
23 syncInterface = eventInfo->SyncInterface();
24 if (eventInfo->EventPreparationFailed()) {
25 outcome = EventOutcome::PreparationFailed;
26 }
27 else if (currentEvent->IsAborted()) {
28 outcome = EventOutcome::Aborted;
29 }
30 }
31 }
32
33 // This stacks or deletes the G4Event and updates Geant4's event count.
34 // Notify Athena only after all Geant4 event processing is complete.
35 G4RunManager::TerminateOneEvent();
36
37 if (syncInterface) {
38 syncInterface->Complete(outcome);
39 }
40}
41
42G4WorkerRunManager*
Worker run manager which notifies Athena after Geant4 has fully terminated an event.
G4WorkerRunManager * CreateWorkerRunManager() const override