ATLAS Offline Software
Loading...
Searching...
No Matches
SyncEventAction.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 "SyncEventAction.h"
6
8
9#include "G4RunManager.hh"
10#include "G4Event.hh"
11
12namespace G4UA
13{
14
15void SyncEventAction::BeginOfEventAction(const G4Event* event)
16{
17 const auto* eventInfo = dynamic_cast<const AtlasG4SyncEventUserInfo*>(
18 event->GetUserInformation());
19 if(!eventInfo) {
20 // A closed event queue supplies no sync event user info.
21 G4RunManager::GetRunManager()->AbortRun();
22 }
23 else if(eventInfo->EventPreparationFailed()) {
24 // Event preparation failed. Abort only this event so that the worker can
25 // continue processing subsequent Athena events.
26 G4RunManager::GetRunManager()->AbortEvent();
27 }
28}
29
30} // namespace G4UA
virtual void BeginOfEventAction(const G4Event *) override