MCPcopy Create free account
hub / github.com/Geant4/geant4 / GetCurrentValue

Method GetCurrentValue

source/run/src/G4RunMessenger.cc:655–693  ·  view source on GitHub ↗

--------------------------------------------------------------------

Source from the content-addressed store, hash-verified

653
654// --------------------------------------------------------------------
655G4String G4RunMessenger::GetCurrentValue(G4UIcommand* command)
656{
657 G4String cv;
658
659 if (command == verboseCmd) {
660 cv = verboseCmd->ConvertToString(runManager->GetVerboseLevel());
661 }
662 else if (command == printProgCmd) {
663 cv = printProgCmd->ConvertToString(runManager->GetPrintProgress());
664 }
665 else if (command == randDirCmd) {
666 cv = runManager->GetRandomNumberStoreDir();
667 }
668 else if (command == randEvtCmd) {
669 cv = randEvtCmd->ConvertToString(runManager->GetFlagRandomNumberStatusToG4Event());
670 }
671 else if (command == nThreadsCmd) {
672 G4RunManager::RMType rmType = runManager->GetRunManagerType();
673 if (rmType == G4RunManager::masterRM) {
674 cv = nThreadsCmd->ConvertToString(
675 static_cast<G4MTRunManager*>(runManager)->GetNumberOfThreads());
676 }
677 else if (rmType == G4RunManager::sequentialRM) {
678 cv = "0";
679 }
680 }
681 else if (command == evModCmd) {
682 G4RunManager::RMType rmType = runManager->GetRunManagerType();
683 if (rmType == G4RunManager::masterRM) {
684 cv = evModCmd->ConvertToString(static_cast<G4MTRunManager*>(runManager)->GetEventModulo())
685 + " " + evModCmd->ConvertToString(G4MTRunManager::SeedOncePerCommunication());
686 }
687 else if (rmType == G4RunManager::sequentialRM) {
688 G4cout << "*** /run/eventModulo command is valid only in MT mode." << G4endl;
689 }
690 }
691
692 return cv;
693}

Callers

nothing calls this directly

Calls 7

GetPrintProgressMethod · 0.80
GetRunManagerTypeMethod · 0.80
GetEventModuloMethod · 0.80
ConvertToStringMethod · 0.45
GetVerboseLevelMethod · 0.45
GetNumberOfThreadsMethod · 0.45

Tested by

no test coverage detected