![]() |
Precalibrated Ion Beam Identification Detector Simulation 1.0
A pilot study detector simulation, written in C++ with Geant4.
|
Creates commands that can be used to control the RunAction via the command line. More...
#include <RunActionMessenger.hh>
Public Member Functions | |
RunActionMessenger (RunAction *) | |
Constructor, constructs the object. | |
virtual | ~RunActionMessenger () |
Destructor, destroys the object. | |
void | SetNewValue (G4UIcommand *, G4String) |
This method is invoked when a command that alters RunAction is typed in via the command line. | |
Private Attributes | |
RunAction * | runAction |
The RunAction associated with this RunActionMessenger. | |
G4UIdirectory * | eventDir |
The directory in which the command will be contained. | |
G4UIcmdWithAString * | SimulationResultsFileCmd |
The command itself. | |
G4UIcmdWithAString * | VerboseResultsFile |
G4UIcmdWithABool * | UseVerboseFile |
Creates commands that can be used to control the RunAction via the command line.
Definition at line 33 of file RunActionMessenger.hh.
RunActionMessenger::RunActionMessenger | ( | RunAction * | RunAct | ) |
Constructor, constructs the object.
RunAct | The RunAction to associate with this RunActionMessenger. |
Definition at line 3 of file RunActionMessenger.cc.
References eventDir, RunAction::SetNewResultsFileName(), RunAction::SetNewVerboseResultsFileName(), RunAction::SetVerboseFileUsage(), and SimulationResultsFileCmd.
:runAction(RunAct) { eventDir = new G4UIdirectory("/PIBIDS/files"); eventDir->SetGuidance("File control"); SimulationResultsFileCmd = new G4UIcmdWithAString("/PIBIDS/files/resultsFile",this); SimulationResultsFileCmd->SetGuidance("File to dump the results of the current run to."); SimulationResultsFileCmd->SetParameterName("FileName",false); SimulationResultsFileCmd->SetDefaultValue("SimulationResults.txt"); RunAct->SetNewResultsFileName("SimulationResults.txt"); VerboseResultsFile = new G4UIcmdWithAString("/PIBIDS/files/verboseResultsFile",this); VerboseResultsFile->SetGuidance("Print verbose results to this file."); VerboseResultsFile->SetParameterName("FileName",false); VerboseResultsFile->SetDefaultValue("VerboseSimulationResults.txt"); RunAct->SetNewVerboseResultsFileName("VerboseSimulationResults.txt"); UseVerboseFile = new G4UIcmdWithABool("/PIBIDS/files/useVerboseResultsFile",this); UseVerboseFile->SetGuidance("Use this to switch the usage of a verbose file on or off"); UseVerboseFile->SetParameterName("UseFile",false); RunAct->SetVerboseFileUsage(false); }
void RunActionMessenger::SetNewValue | ( | G4UIcommand * | command, |
G4String | newValue | ||
) |
This method is invoked when a command that alters RunAction is typed in via the command line.
command | The G4UIcommand which we want to change value in. |
newValue | The string containing the new value. |
Definition at line 35 of file RunActionMessenger.cc.
References runAction, RunAction::SetNewResultsFileName(), RunAction::SetNewVerboseResultsFileName(), RunAction::SetVerboseFileUsage(), and SimulationResultsFileCmd.
{ if(command == SimulationResultsFileCmd) runAction->SetNewResultsFileName(newValue); if(command == VerboseResultsFile) {runAction->SetNewVerboseResultsFileName(newValue);} if(command == UseVerboseFile) {runAction->SetVerboseFileUsage(UseVerboseFile->GetNewBoolValue(newValue));} }