--------------------------------------------------------------------
| 606 | |
| 607 | // -------------------------------------------------------------------- |
| 608 | G4bool G4RunManagerKernel::RunInitialization(G4bool fakeRun) |
| 609 | { |
| 610 | G4StateManager* stateManager = G4StateManager::GetStateManager(); |
| 611 | G4ApplicationState currentState = stateManager->GetCurrentState(); |
| 612 | |
| 613 | if (!geometryInitialized) { |
| 614 | G4Exception("G4RunManagerKernel::RunInitialization", "Run0021", JustWarning, |
| 615 | "Geometry has not yet initialized : method ignored."); |
| 616 | return false; |
| 617 | } |
| 618 | |
| 619 | if (!physicsInitialized) { |
| 620 | G4Exception("G4RunManagerKernel::RunInitialization", "Run0022", JustWarning, |
| 621 | "Physics has not yet initialized : method ignored."); |
| 622 | return false; |
| 623 | } |
| 624 | |
| 625 | if (currentState != G4State_Idle) { |
| 626 | G4Exception("G4RunManagerKernel::RunInitialization", "Run0023", JustWarning, |
| 627 | "Geant4 kernel not in Idle state : method ignored."); |
| 628 | return false; |
| 629 | } |
| 630 | |
| 631 | if (geometryNeedsToBeClosed) CheckRegularGeometry(); |
| 632 | |
| 633 | stateManager->SetNewState(G4State_Init); |
| 634 | PropagateGenericIonID(); |
| 635 | SetupShadowProcess(); |
| 636 | UpdateRegion(); |
| 637 | BuildPhysicsTables(fakeRun); |
| 638 | |
| 639 | if (geometryNeedsToBeClosed) { |
| 640 | if(!fakeRun || resetNavigatorAtInitialization) ResetNavigator(); |
| 641 | // CheckRegularGeometry(); |
| 642 | // Notify the VisManager as well |
| 643 | if (G4Threading::IsMasterThread()) { |
| 644 | G4VVisManager* pVVisManager = G4VVisManager::GetConcreteInstance(); |
| 645 | if (pVVisManager != nullptr) pVVisManager->GeometryHasChanged(); |
| 646 | } |
| 647 | } |
| 648 | |
| 649 | GetPrimaryTransformer()->CheckUnknown(); |
| 650 | |
| 651 | #ifdef G4MULTITHREADED |
| 652 | G4UnitDefinition::GetUnitsTable().Synchronize(); |
| 653 | #endif |
| 654 | |
| 655 | stateManager->SetNewState(G4State_Idle); |
| 656 | stateManager->SetNewState(G4State_GeomClosed); |
| 657 | return true; |
| 658 | } |
| 659 | |
| 660 | // -------------------------------------------------------------------- |
| 661 | void G4RunManagerKernel::PropagateGenericIonID() |
nothing calls this directly
no test coverage detected