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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Communication and Control• G4double GetNewDoubleValue(G4String paramString)Convert G4String parameter value given by the SetNewValue() method of your messenger into double.Please note that the return value has already been multiplied by the value of the given unit.• G4double GetNewDoubleRawValue(G4String paramString)Convert G4String parameter value given by the SetNewValue() method of your messenger into double butwithout multiplying the value of the given unit.• G4double GetNewUnitValue(G4String paramString)Convert G4String unit value given by the SetNewValue() method of your messenger into double.• G4String convertToString(G4bool currVal, char* unitName)Convert the current double value to a G4String, which should be returned by the GetCurrentValue()method of your messenger. The double value will be divided by the value of the given unit and converted toa string. Given unit will be added to the string.G4UIcmdWith3VectorAndUnitThis is a G4UIcommand derived class which takes one three vector parameter and its unit.• G4UIcmdWith3VectorAndUnit(char* commandpath, G4UImanager* theMessenger)Constructor. Arguments are the (full-path) command name and the pointer to your messenger.• void SetParameterName(char* paramNamX, char* paramNamY, char*paramNamZ,G4bool omittable)Define the names of each component of the three vector and set the omittable flag. If omittable is true, youshould define the default value using the next method.• void SetDefaultValue(G4ThreeVector defVal)Define the default value of the three vector.• void SetUnitCategory(char* unitCategory)Define acceptable unit category.• void SetDefaultUnit(char* defUnit)Define the default unit. Please use this method and the SetUnitCategory() method alternatively.• G4ThreeVector GetNew3VectorValue(G4String paramString)Convert a G4String parameter value given by the SetNewValue() method of your messenger into aG4ThreeVector. Please note that the return value has already been multiplied by the value of the given unit.• G4ThreeVector GetNew3VectorRawValue(G4String paramString)Convert a G4String parameter value given by the SetNewValue() method of your messenger into threevector, but without multiplying the value of the given unit.• G4double GetNewUnitValue(G4String paramString)Convert a G4String unit value given by the SetNewValue() method of your messenger into a double.• G4String convertToString(G4ThreeVector currVal, char* unitName)Convert the current three vector to a G4String which should be returned by the GetCurrentValue() methodof your messenger. The three vector value will be divided by the value of the given unit and converted to astring. Given unit will be added to the string.Additional comments on the SetParameterName() methodYou can add one additional argument of G4bool type <strong>for</strong> every SetParameterName() method mentionedabove. This additional argument is named currentAsDefaultFlag and the default value of this argument is209

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

Saved successfully!

Ooh no, something went wrong!