8#include "G4GeometryManager.hh"
9#include "G4LogicalVolumeStore.hh"
10#include "G4ParallelWorldScoringProcess.hh"
11#include "G4RegionStore.hh"
13#include "G4ScoringManager.hh"
14#include "G4StateManager.hh"
15#include "G4TransportationManager.hh"
16#include "G4UImanager.hh"
17#include "G4UserRunAction.hh"
18#include "G4Version.hh"
45 G4RunManager::Initialize();
53 G4RunManager::SetUserInitialization(
56 G4RunManager::InitializeGeometry();
59 ATH_MSG_WARNING(
" User Detector not set!!! Geometry NOT initialized!!!" );
74 kernel->InitializePhysics();
75 physicsInitialized =
true;
81 description <<
"InitializePhysics: Failed to retrieve IPhysicsListSvc.";
82 G4Exception(
"G4AtlasRunManager",
"CouldNotRetrievePLTool", FatalException,
description);
97 G4StateManager* stateManager = G4StateManager::GetStateManager();
98 stateManager->SetNewState(G4State_GeomClosed);
100 currentEvent = event;
102 eventManager->ProcessOneEvent(currentEvent);
103 if (currentEvent->IsAborted()) {
104 ATH_MSG_WARNING(
"G4AtlasRunManager::ProcessEvent: Event Aborted at Detector Simulation level" );
105 currentEvent =
nullptr;
111 this->StackPreviousEvent(currentEvent);
112 bool abort = currentEvent->IsAborted();
113 currentEvent =
nullptr;
125 this->CleanUpPreviousEvents();
126 previousEvents->clear();
129 userRunAction->EndOfRunAction(currentRun);
133 currentRun =
nullptr;
137 G4StateManager* stateManager = G4StateManager::GetStateManager();
138 stateManager->SetNewState(G4State_Idle);
141 G4GeometryManager::GetInstance()->OpenGeometry();
143 ATH_MSG_VERBOSE(
"Terminating the run... State is " << stateManager->GetStateString( stateManager->GetCurrentState() ) );
144 kernel->RunTermination();
147 userRunAction =
nullptr;
148 userEventAction =
nullptr;
149 userSteppingAction =
nullptr;
150 userStackingAction =
nullptr;
151 userTrackingAction =
nullptr;
152 userDetector =
nullptr;
153 userPrimaryGeneratorAction =
nullptr;
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
G4AtlasRunManager *G4AtlasRunManager::GetG4AtlasRunManager ATLAS_NOT_THREAD_SAFE()
Install fatal handler with default options.
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
ATLAS custom singleton run manager.
void InitializeGeometry() override final
bool ProcessEvent(G4Event *event)
Does the work of simulating an ATLAS event.
ServiceHandle< IPhysicsListSvc > m_physListSvc
std::map< std::string, double > m_volumeSmartlessLevel
IDetectorConstructionTool * m_detConstruction
void RunTermination() override final
G4 function called at end of run.
G4AtlasRunManager()
Pure singleton private constructor.
bool m_quietMode
Quiet Mode for production.
std::unique_ptr< IFluxRecorder > m_fluxRecorder
Interface to flux recording.
void Initialize() override final
void InitializePhysics() override final
std::string description
glabal timer - how long have I taken so far?