ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Simulation
G4Utilities
G4RunManagement
src
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
5
#include "
G4RunToolWorkerRunManager.h
"
6
7
#include "
G4RunManagement/AtlasG4SyncEventUserInfo.h
"
8
9
#include "G4Event.hh"
10
11
#include <memory>
12
13
void
G4RunToolWorkerRunManager::TerminateOneEvent
()
14
{
15
using
EventOutcome =
G4EventSynchronizationInterface::EventOutcome
;
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
42
G4WorkerRunManager*
43
G4RunToolWorkerThreadInitialization::CreateWorkerRunManager
()
const
44
{
45
return
new
G4RunToolWorkerRunManager
;
46
}
AtlasG4SyncEventUserInfo.h
G4RunToolWorkerRunManager.h
AtlasG4SyncEventUserInfo
Definition
AtlasG4SyncEventUserInfo.h:58
G4EventSynchronizationInterface::EventOutcome
EventOutcome
Definition
AtlasG4SyncEventUserInfo.h:35
G4RunToolWorkerRunManager
Worker run manager which notifies Athena after Geant4 has fully terminated an event.
Definition
G4RunToolWorkerRunManager.h:14
G4RunToolWorkerRunManager::TerminateOneEvent
void TerminateOneEvent() override
Definition
G4RunToolWorkerRunManager.cxx:13
G4RunToolWorkerThreadInitialization::CreateWorkerRunManager
G4WorkerRunManager * CreateWorkerRunManager() const override
Definition
G4RunToolWorkerRunManager.cxx:43
Generated on
for ATLAS Offline Software by
1.17.0