Precalibrated Ion Beam Identification Detector Simulation 1.0
A pilot study detector simulation, written in C++ with Geant4.
Public Member Functions | Private Attributes
RunActionMessenger Class Reference

Creates commands that can be used to control the RunAction via the command line. More...

#include <RunActionMessenger.hh>

List of all members.

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

RunActionrunAction
 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

Detailed Description

Creates commands that can be used to control the RunAction via the command line.

Definition at line 33 of file RunActionMessenger.hh.


Constructor & Destructor Documentation

RunActionMessenger::RunActionMessenger ( RunAction RunAct)

Constructor, constructs the object.

Parameters:
RunActThe 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);

}

Member Function Documentation

void RunActionMessenger::SetNewValue ( G4UIcommand *  command,
G4String  newValue 
)

This method is invoked when a command that alters RunAction is typed in via the command line.

Parameters:
commandThe G4UIcommand which we want to change value in.
newValueThe 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));}
  
}

The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Defines

Back to the main page of the Precalibrated Ion Beam Identification Detector project

Created by Rikard Lundmark