File indexing completed on 2025-01-31 09:22:29
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
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041 #include "Collimator50BeamLineMessenger.hh"
0042 #include "Collimator50BeamLine.hh"
0043 #include "G4UIdirectory.hh"
0044 #include "G4UIcmdWithADoubleAndUnit.hh"
0045 #include "G4UIcmdWithAString.hh"
0046
0047 Collimator50BeamLineMessenger::Collimator50BeamLineMessenger(Collimator50BeamLine* beamLine)
0048 :collimator50(beamLine)
0049 {
0050 beamLineDir = new G4UIdirectory("/beamLine/");
0051 beamLineDir -> SetGuidance("set specification of range shifter");
0052
0053 FinalCollimatorIORTDir = new G4UIdirectory("/beamLine/FinalCollimatorIORT/");
0054 FinalCollimatorIORTDir -> SetGuidance("set specification of final collimator");
0055
0056
0057 innerRadiusFinalCollimatorIORTCmd = new G4UIcmdWithADoubleAndUnit("/beamLine/FinalCollimatorIORT/halfInnerRad",this);
0058 innerRadiusFinalCollimatorIORTCmd -> SetGuidance("Set size of inner radius ( max 21.5 mm)");
0059 innerRadiusFinalCollimatorIORTCmd -> SetParameterName("Size",false);
0060 innerRadiusFinalCollimatorIORTCmd -> SetDefaultUnit("mm");
0061 innerRadiusFinalCollimatorIORTCmd -> SetUnitCandidates("mm cm m");
0062 innerRadiusFinalCollimatorIORTCmd -> AvailableForStates(G4State_Idle);
0063
0064 OuterRadiusFinalCollimatorIORTCmd = new G4UIcmdWithADoubleAndUnit("/beamLine/FinalCollimatorIORT/halfOuterRad",this);
0065 OuterRadiusFinalCollimatorIORTCmd -> SetGuidance("Set size of outer radius ( max 21.5 mm)");
0066 OuterRadiusFinalCollimatorIORTCmd -> SetParameterName("Size",false);
0067 OuterRadiusFinalCollimatorIORTCmd -> SetDefaultUnit("mm");
0068 OuterRadiusFinalCollimatorIORTCmd -> SetUnitCandidates("mm cm m");
0069 OuterRadiusFinalCollimatorIORTCmd -> AvailableForStates(G4State_Idle);
0070
0071 }
0072
0073 Collimator50BeamLineMessenger::~Collimator50BeamLineMessenger()
0074 {
0075
0076 delete OuterRadiusFinalCollimatorIORTCmd;
0077 delete innerRadiusFinalCollimatorIORTCmd;
0078 delete FinalCollimatorIORTDir;
0079 delete beamLineDir;
0080
0081
0082 }
0083
0084
0085
0086
0087 void Collimator50BeamLineMessenger::SetNewValue(G4UIcommand* command,G4String newValue)
0088 {
0089
0090
0091 if( command == innerRadiusFinalCollimatorIORTCmd )
0092 { collimator50 -> SetInnerRadiusFinalCollimatorIORT
0093 (innerRadiusFinalCollimatorIORTCmd -> GetNewDoubleValue(newValue));}
0094
0095 else if( command == OuterRadiusFinalCollimatorIORTCmd )
0096 { collimator50 -> SetOuterRadiusFinalCollimatorIORT
0097 (OuterRadiusFinalCollimatorIORTCmd -> GetNewDoubleValue(newValue));}
0098
0099 }
0100