--------------------------------------------------------------------
| 74 | |
| 75 | // -------------------------------------------------------------------- |
| 76 | G4WorkerRunManager::G4WorkerRunManager() : G4RunManager(workerRM) |
| 77 | { |
| 78 | // This constructor should never be called in non-multithreaded mode |
| 79 | |
| 80 | #ifndef G4MULTITHREADED |
| 81 | G4ExceptionDescription msg; |
| 82 | msg << "Geant4 code is compiled without multi-threading support " |
| 83 | "(-DG4MULTITHREADED " |
| 84 | "is set to off)."; |
| 85 | msg << " This type of RunManager can only be used in mult-threaded " |
| 86 | "applications."; |
| 87 | G4Exception("G4WorkerRunManager::G4WorkerRunManager()", "Run0103", FatalException, msg); |
| 88 | #endif |
| 89 | // G4ParticleTable::GetParticleTable()->WorkerG4ParticleTable(); |
| 90 | // WorkerG4ParticleTable() would be performed twice, |
| 91 | // as it is called already from G4ParticleTable::GetParticleTable() |
| 92 | // which is called beforehand by other Geant4 classes |
| 93 | G4ScoringManager* masterScM = G4MTRunManager::GetMasterScoringManager(); |
| 94 | if (masterScM != nullptr) G4ScoringManager::GetScoringManager(); // TLS instance for a worker |
| 95 | |
| 96 | // Properly initialise luxury level for Ranlux* engines... |
| 97 | // |
| 98 | if (dynamic_cast<const CLHEP::Ranlux64Engine*>(G4Random::getTheEngine()) != nullptr) { |
| 99 | const auto theEngine = dynamic_cast<const CLHEP::Ranlux64Engine*>(G4Random::getTheEngine()); |
| 100 | luxury = theEngine->getLuxury(); |
| 101 | } |
| 102 | else if (dynamic_cast<const CLHEP::RanluxEngine*>(G4Random::getTheEngine()) != nullptr) { |
| 103 | const auto theEngine = dynamic_cast<const CLHEP::RanluxEngine*>(G4Random::getTheEngine()); |
| 104 | luxury = theEngine->getLuxury(); |
| 105 | } |
| 106 | |
| 107 | G4UImanager::GetUIpointer()->SetIgnoreCmdNotFound(true); |
| 108 | |
| 109 | #ifdef G4MULTITHREADED |
| 110 | G4VVisManager* pVVis = G4VVisManager::GetConcreteInstance(); |
| 111 | if (pVVis != nullptr) { |
| 112 | pVVis->SetUpForAThread(); |
| 113 | visIsSetUp = true; |
| 114 | } |
| 115 | #endif |
| 116 | } |
| 117 | |
| 118 | // -------------------------------------------------------------------- |
| 119 | G4WorkerRunManager::~G4WorkerRunManager() |
nothing calls this directly
no test coverage detected