Warning, file /geant4/examples/advanced/hadrontherapy/src/HadrontherapyTIFPAPassiveProtonBeamLineMessenger.cc was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
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
0030 #include "HadrontherapyTIFPAPassiveProtonBeamLine.hh"
0031 #include "HadrontherapyTIFPAPassiveProtonBeamLineMessenger.hh"
0032 #include "G4UIdirectory.hh"
0033 #include "G4UIcmdWithADoubleAndUnit.hh"
0034 #include "G4UIcmdWithAString.hh"
0035 #include "G4SystemOfUnits.hh"
0036
0037 TrentoPassiveProtonBeamLineMessenger::TrentoPassiveProtonBeamLineMessenger(TrentoPassiveProtonBeamLine* TrentoLine)
0038 :TrentoPassiveProton(TrentoLine)
0039
0040 {
0041 changeTheBeamLineDir = new G4UIdirectory("/ChangeBeamLine/");
0042 changeTheBeamLineDir -> SetGuidance("Command to change the transport beam line");
0043
0044 changeTheBeamLineNameCmd = new G4UIcmdWithAString("/ChangeBeamLine/beamLineName",this);
0045 changeTheBeamLineNameCmd -> SetGuidance("Insert the name of the beam line you want simulate");
0046 changeTheBeamLineNameCmd -> SetParameterName("List",false);
0047 changeTheBeamLineNameCmd -> AvailableForStates(G4State_PreInit);
0048
0049 modulatorDir = new G4UIdirectory("/modulator/");
0050 modulatorDir -> SetGuidance("Command to rotate the modulator wheel");
0051
0052 beamLineDir = new G4UIdirectory("/beamLine/");
0053 beamLineDir -> SetGuidance("set specification of range shifter");
0054
0055 ScatteringFoilXSizeCmd = new G4UIcmdWithADoubleAndUnit("/beamLine/ScatteringFoil/thickness",this);
0056 ScatteringFoilXSizeCmd -> SetGuidance("Set half thickness of scattering foil");
0057 ScatteringFoilXSizeCmd -> SetParameterName("Size",false);
0058 ScatteringFoilXSizeCmd -> SetDefaultUnit("mm");
0059 ScatteringFoilXSizeCmd -> SetUnitCandidates("mm cm m");
0060 ScatteringFoilXSizeCmd -> AvailableForStates(G4State_Idle);
0061
0062 scatteringFoilMatCmd = new G4UIcmdWithAString("/beamLine/ScatteringFoil/material",this);
0063 scatteringFoilMatCmd -> SetGuidance("Set material of scatterer");
0064 scatteringFoilMatCmd -> SetParameterName("choice",false);
0065 scatteringFoilMatCmd -> AvailableForStates(G4State_Idle);
0066
0067 preCollimatorXSizeCmd = new G4UIcmdWithADoubleAndUnit("/beamLine/preCollimator/XSize",this);
0068 preCollimatorXSizeCmd -> SetGuidance("Set half x side of pre collimator");
0069 preCollimatorXSizeCmd -> SetParameterName("Size",false);
0070 preCollimatorXSizeCmd -> SetDefaultUnit("mm");
0071 preCollimatorXSizeCmd -> SetUnitCandidates("mm cm m");
0072 preCollimatorXSizeCmd -> AvailableForStates(G4State_Idle);
0073
0074 preCollimatorXPositionCmd = new G4UIcmdWithADoubleAndUnit("/beamLine/preCollimator/XPosition",this);
0075 preCollimatorXPositionCmd -> SetGuidance("Set the position along x ");
0076 preCollimatorXPositionCmd -> SetParameterName("Position",false);
0077 preCollimatorXPositionCmd -> SetDefaultUnit("mm");
0078 preCollimatorXPositionCmd -> SetUnitCandidates("mm cm m");
0079 preCollimatorXPositionCmd -> AvailableForStates(G4State_Idle);
0080
0081 AirTubeYSizeCmd = new G4UIcmdWithADoubleAndUnit("/beamLine/airTube/YSide",this);
0082 AirTubeYSizeCmd -> SetGuidance("Set of pre collimator the outer radius of the hole in the collimator ");
0083 AirTubeYSizeCmd -> SetParameterName("Radius",false);
0084 AirTubeYSizeCmd -> SetDefaultUnit("mm");
0085 AirTubeYSizeCmd -> SetUnitCandidates("mm cm m");
0086 AirTubeYSizeCmd -> AvailableForStates(G4State_Idle);
0087
0088
0089 AirTubeZSizeCmd = new G4UIcmdWithADoubleAndUnit("/beamLine/FirstCollimator/innerRadius",this);
0090 AirTubeZSizeCmd -> SetGuidance("Set the inner radius of the collimator ");
0091 AirTubeZSizeCmd -> SetParameterName("Radius",false);
0092 AirTubeZSizeCmd -> SetDefaultUnit("mm");
0093 AirTubeZSizeCmd -> SetUnitCandidates("mm cm m");
0094 AirTubeZSizeCmd -> AvailableForStates(G4State_Idle);
0095
0096 }
0097
0098 TrentoPassiveProtonBeamLineMessenger::~TrentoPassiveProtonBeamLineMessenger()
0099 {
0100 delete AirTubeZSizeCmd;
0101 delete AirTubeYSizeCmd;
0102 delete ScatteringFoilXSizeCmd;
0103 delete scatteringFoilMatCmd;
0104 delete preCollimatorXSizeCmd;
0105 delete beamLineDir;
0106 delete modulatorDir;
0107 }
0108
0109
0110
0111
0112 void TrentoPassiveProtonBeamLineMessenger::SetNewValue(G4UIcommand* command,G4String newValue)
0113 {
0114 if( command == ScatteringFoilXSizeCmd )
0115 {TrentoPassiveProton -> SetScatteringFoilXSize
0116 (ScatteringFoilXSizeCmd -> GetNewDoubleValue(newValue));}
0117
0118 else if( command == scatteringFoilMatCmd )
0119 { TrentoPassiveProton -> SetScattererMaterial(newValue);}
0120
0121 else if( command == preCollimatorXSizeCmd )
0122 { TrentoPassiveProton -> SetPreCollimatorXSize
0123 (preCollimatorXSizeCmd -> GetNewDoubleValue(newValue));}
0124
0125 else if( command == preCollimatorXPositionCmd )
0126 { TrentoPassiveProton -> SetPreCollimatorXPosition
0127 (preCollimatorXPositionCmd -> GetNewDoubleValue(newValue));}
0128
0129 else if( command == AirTubeYSizeCmd )
0130 { TrentoPassiveProton -> SetAirTubeYSize
0131 (AirTubeYSizeCmd -> GetNewDoubleValue(newValue));}
0132
0133 else if( command == AirTubeZSizeCmd )
0134 { TrentoPassiveProton -> SetAirTubeZSize
0135 (AirTubeZSizeCmd -> GetNewDoubleValue(newValue));}
0136
0137 }
0138