--------------------------------------------------------------------
| 144 | |
| 145 | // -------------------------------------------------------------------- |
| 146 | void G4WorkerRunManager::InitializeGeometry() |
| 147 | { |
| 148 | if (userDetector == nullptr) { |
| 149 | G4Exception("G4RunManager::InitializeGeometry", "Run0033", FatalException, |
| 150 | "G4VUserDetectorConstruction is not defined!"); |
| 151 | return; |
| 152 | } |
| 153 | |
| 154 | if (fGeometryHasBeenDestroyed) { |
| 155 | G4TransportationManager::GetTransportationManager()->ClearParallelWorlds(); |
| 156 | } |
| 157 | |
| 158 | // Step 0: Contribute to the voxelisation of the geometry |
| 159 | G4GeometryManager* geomManager = G4GeometryManager::GetInstance(); |
| 160 | if( geomManager->IsParallelOptimisationConfigured() && ! geomManager->IsParallelOptimisationFinished() ) { |
| 161 | G4cout << "G4RunManager::InitializeGeometry calling GeometryManager's UndertakeOptimisation" |
| 162 | << G4endl; // TODO - suppress / delete this in final version |
| 163 | geomManager->UndertakeOptimisation(); |
| 164 | } |
| 165 | // A barrier must ensure that all that all threads have finished this work. |
| 166 | // Currently we rely on the (later) barrier at the end of initialisation. |
| 167 | |
| 168 | // Step1: Get pointer to the physiWorld (note: needs to get the "super |
| 169 | // pointer, i.e. the one shared by all threads" |
| 170 | G4RunManagerKernel* masterKernel = G4MTRunManager::GetMasterRunManagerKernel(); |
| 171 | G4VPhysicalVolume* worldVol = masterKernel->GetCurrentWorld(); |
| 172 | // Step2:, Call a new "WorkerDefineWorldVolume( pointer from 2-, false); |
| 173 | kernel->WorkerDefineWorldVolume(worldVol, false); |
| 174 | kernel->SetNumberOfParallelWorld(masterKernel->GetNumberOfParallelWorld()); |
| 175 | // Step3: Call user's ConstructSDandField() |
| 176 | userDetector->ConstructSDandField(); |
| 177 | userDetector->ConstructParallelSD(); |
| 178 | geometryInitialized = true; |
| 179 | } |
| 180 | |
| 181 | // -------------------------------------------------------------------- |
| 182 | void G4WorkerRunManager::RunInitialization() |
nothing calls this directly
no test coverage detected