12.07.2015 Views

Geant4 User's Guide for Application Developers - Geant4 - CERN

Geant4 User's Guide for Application Developers - Geant4 - CERN

Geant4 User's Guide for Application Developers - Geant4 - CERN

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Communication and Control• at least one parameter of the command has a range• at least one parameter of the command has a candidate list• at least the value of one parameter is omitted and this parameter is defined as omittable and currentValueAsDefaultFor the first two cases, you can re-set the range or the candidate list if you need to do so, but these ``re-set''parameters are needed only <strong>for</strong> the case where the range or the candidate list varies dynamically.A command can be ``state sensitive'', i.e., the command can be accepted only <strong>for</strong> a certain G4<strong>Application</strong>State(s).For example, the /run/beamOn command should not be accepted when <strong>Geant4</strong> is processing another event(``G4State_EventProc'' state). You can set the states available <strong>for</strong> the command with the Available-ForStates() method.7.2.2. G4UIcommand and its derived classesMethods available <strong>for</strong> all derived classesThese are methods defined in the G4UIcommand base class which should be used from the derived classes.• void SetGuidance(char*)Define a guidance line. You can invoke this method as many times as you need to give enough amount ofguidance. Please note that the first line will be used as a title head of the command guidance.• void availableForStates(G4<strong>Application</strong>State s1,...)If your command is valid only <strong>for</strong> certain states of the <strong>Geant4</strong> kernel, specify these states by thismethod. Currently available states are G4State_PreInit, G4State_Init, G4State_Idle,G4State_GeomClosed, and G4State_EventProc. Refer to the section 3.4.2 <strong>for</strong> meaning of each state.Please note that the Pause state had been removed from G4<strong>Application</strong>State.• void SetRange(char* range)Define a range of the parameter(s). Use C++ notation, e.g., "x > 0 && x < 10", with variable name(s)defined by the SetParameterName() method. For the case of a G4ThreeVector, you can set the relationbetween parameters, e.g., "x > y".G4UIdirectoryThis is a G4UIcommand derived class <strong>for</strong> defining a directory.• G4UIdirectory(char* directoryPath)Constructor. Argument is the (full-path) directory, which must begin and terminate with `/'.G4UIcmdWithoutParameterThis is a G4UIcommand derived class <strong>for</strong> a command which takes no parameter.• G4UIcmdWithoutParameter(char* commandPath, G4UImessenger* theMessenger)Constructor. Arguments are the (full-path) command name and the pointer to your messenger.G4UIcmdWithABoolThis is a G4UIcommand derived class which takes one boolean type parameter.• G4UIcmdWithABool(char* commandpath,G4UImanager* theMessenger)Constructor. Arguments are the (full-path) command name and the pointer to your messenger.• void SetParameterName(char* paramName, G4bool omittable)206

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!