11#include "G4StateManager.hh"
12#include "G4GeometryManager.hh"
13#include "G4UserRunAction.hh"
15#include "G4LogicalVolumeStore.hh"
16#include "G4MTRunManagerKernel.hh"
18#include "G4IonTable.hh"
19#include "G4ParticleTable.hh"
20#include "G4CascadeInterface.hh"
22#include "GaudiKernel/ISvcLocator.h"
23#include "GaudiKernel/Bootstrap.h"
25G4AtlasMTRunManager::G4AtlasMTRunManager()
28 , m_physListSvc(
"PhysicsListSvc",
"G4AtlasMTRunManager")
34 static G4AtlasMTRunManager* thisManager =
nullptr;
35 if (!thisManager) { thisManager =
new G4AtlasMTRunManager; }
40void G4AtlasMTRunManager::Initialize()
44 G4RunManager::Initialize();
46 ConstructScoringWorlds();
49 if (m_quietMode) { SetVerboseLevel(0); }
53 GetMTMasterRunManagerKernel()->SetUpDecayChannels();
55 PrepareCommandsStack();
59void G4AtlasMTRunManager::InitializeGeometry()
64 SetUserInitialization(m_detConstruction->GetDetectorConstruction().release());
66 G4RunManager::InitializeGeometry();
70 ATH_MSG_WARNING(
"User Detector not set!!! Geometry NOT initialized!!!");
74void G4AtlasMTRunManager::InitializePhysics()
77 kernel->InitializePhysics();
80 G4CascadeInterface::Initialize();
81 physicsInitialized =
true;
84 if (m_physListSvc.retrieve().isFailure()) {
87 description <<
"InitializePhysics: Failed to retrieve IPhysicsListSvc.";
88 G4Exception(
"G4AtlasMTRunManager",
"CouldNotRetrievePLTool",
92 m_physListSvc->SetPhysicsOptions();
99void G4AtlasMTRunManager::RunTermination()
102 CleanUpPreviousEvents();
103 previousEvents->clear();
105 if(userRunAction) { userRunAction->EndOfRunAction(currentRun); }
108 currentRun =
nullptr;
112 G4StateManager* stateManager = G4StateManager::GetStateManager();
113 stateManager->SetNewState(G4State_Idle);
116 G4GeometryManager::GetInstance()->OpenGeometry();
119 stateManager->GetStateString( stateManager->GetCurrentState() ) );
120 kernel->RunTermination();
123 userRunAction =
nullptr;
124 userEventAction =
nullptr;
125 userSteppingAction =
nullptr;
126 userStackingAction =
nullptr;
127 userTrackingAction =
nullptr;
129 userDetector =
nullptr;
130 userPrimaryGeneratorAction =
nullptr;
#define ATH_MSG_WARNING(x)
#define ATLAS_NOT_THREAD_SAFE
getNoisyStrip() Find noisy strips from hitmaps and write out into xml/db formats
Class to provide easy MsgStream access and capabilities.
std::string description
glabal timer - how long have I taken so far?