--------------------------------------------------------------------
| 651 | |
| 652 | // -------------------------------------------------------------------- |
| 653 | void G4RunManager::InitializeGeometry() |
| 654 | { |
| 655 | if (userDetector == nullptr) { |
| 656 | G4Exception("G4RunManager::InitializeGeometry", "Run0033", FatalException, |
| 657 | "G4VUserDetectorConstruction is not defined!"); |
| 658 | return; |
| 659 | } |
| 660 | |
| 661 | if (verboseLevel > 1) G4cout << "userDetector->Construct() start." << G4endl; |
| 662 | |
| 663 | G4StateManager* stateManager = G4StateManager::GetStateManager(); |
| 664 | G4ApplicationState currentState = stateManager->GetCurrentState(); |
| 665 | if (currentState == G4State_PreInit || currentState == G4State_Idle) { |
| 666 | stateManager->SetNewState(G4State_Init); |
| 667 | } |
| 668 | if (!geometryDirectlyUpdated) { |
| 669 | kernel->DefineWorldVolume(userDetector->Construct(), false); |
| 670 | userDetector->ConstructSDandField(); |
| 671 | nParallelWorlds = userDetector->ConstructParallelGeometries(); |
| 672 | userDetector->ConstructParallelSD(); |
| 673 | kernel->SetNumberOfParallelWorld(nParallelWorlds); |
| 674 | } |
| 675 | // Notify the VisManager as well |
| 676 | if (G4Threading::IsMasterThread()) { |
| 677 | G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance(); |
| 678 | if (pVVisManager != nullptr) pVVisManager->GeometryHasChanged(); |
| 679 | } |
| 680 | |
| 681 | geometryDirectlyUpdated = false; |
| 682 | geometryInitialized = true; |
| 683 | stateManager->SetNewState(currentState); |
| 684 | } |
| 685 | |
| 686 | // -------------------------------------------------------------------- |
| 687 | void G4RunManager::InitializePhysics() |
nothing calls this directly
no test coverage detected