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