File indexing completed on 2025-01-31 09:22:18
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029 #include "HadrontherapyParameterMessenger.hh"
0030 #include "HadrontherapyInteractionParameters.hh"
0031 #include "G4SystemOfUnits.hh"
0032
0033 #include "G4UIdirectory.hh"
0034 #include "G4UIcmdWithAString.hh"
0035
0036 HadrontherapyParameterMessenger::HadrontherapyParameterMessenger(HadrontherapyInteractionParameters* param)
0037 :pParam(param)
0038 {
0039 paramDir = new G4UIdirectory("/parameter/");
0040 paramDir -> SetGuidance("Commands to generate stopping power and range");
0041
0042 dedxCmd = new G4UIcmdWithAString("/parameter/getstopping",this);
0043 dedxCmd->SetGuidance("Get mass stopping powers"
0044 "\n[usage]: /parameter/getstopping Material [Emin] [Emax] [N] [Particle] [File]"
0045 "\n Material:(string) Material name, like G4_H, G4_WATER,..., look at /parameter/nist"
0046 "\n Emin Emax:(double) minimum and maximum kinetic energy (MeV)"
0047 "\n N:(double) [number of points]"
0048 "\n Particle:(string) Particle name, look at /particle/list"
0049 "\n File:(string) Name for the output file."
0050 "\nDefault values for parameters inside [] are respectively:"
0051 "\n \"1 MeV\", \"Emin\", \"1\", \"proton\", \"stdout\"");
0052 dedxCmd->SetParameterName("inputData",false);
0053 dedxCmd->AvailableForStates(G4State_Idle);
0054
0055 listCmd = new G4UIcmdWithAString("/parameter/nist",this);
0056 listCmd -> SetGuidance("Print NIST elements/materials.\nParameters:"
0057 "\n\t all: will print elements and compounds"
0058 "\n\t simple: will print elements only"
0059 "\n\t compound: will print compounds only"
0060 "\n\t hep: will print hep compounds"
0061 "\n\t list: will print a simple full list of all elements and compounds");
0062 listCmd -> SetParameterName("String",true);
0063 listCmd -> SetDefaultValue("list");
0064 listCmd -> SetCandidates("all simple compound hep list");
0065 listCmd ->AvailableForStates(G4State_Idle);
0066
0067 }
0068 HadrontherapyParameterMessenger::~HadrontherapyParameterMessenger()
0069 {
0070 delete paramDir;
0071 delete dedxCmd;
0072 delete listCmd;
0073 }
0074
0075 void HadrontherapyParameterMessenger::SetNewValue(G4UIcommand* command, G4String vararg)
0076 {
0077 if (command == dedxCmd)
0078 {
0079 pParam -> GetStoppingTable(vararg);
0080 }
0081 else if (command == listCmd)
0082 {
0083 pParam -> ListOfNistMaterials(vararg);
0084 }
0085 }
0086