ATLAS Offline Software
Loading...
Searching...
No Matches
SyncEventAction.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5#include "SyncEventAction.h"
6
7#include "G4RunManager.hh"
8#include "G4Event.hh"
9#include "G4EventManager.hh"
10
12
13namespace G4UA
14{
15
16void SyncEventAction::BeginOfEventAction(const G4Event* event)
17{
18 if(!event->GetUserInformation()) {
19 G4RunManager::GetRunManager()->AbortRun();
20 }
21}
22
23void SyncEventAction::EndOfEventAction(const G4Event* event)
24{
25 // Simulation is done, signal back to Athena
26 if(auto* atlasG4EvtUserInfo = dynamic_cast< AtlasG4SyncEventUserInfo* >( event->GetUserInformation() )) {
27 atlasG4EvtUserInfo->SyncInterface()->EventAborted(event->IsAborted());
28 atlasG4EvtUserInfo->SyncInterface()->SetStatusDone();
29 }
30}
31
32} // namespace G4UA
virtual void EndOfEventAction(const G4Event *) override
virtual void BeginOfEventAction(const G4Event *) override