File indexing completed on 2025-01-31 09:22:20
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 "PassiveCarbonBeamLineMessenger.hh"
0030 #include "PassiveCarbonBeamLine.hh"
0031 #include "G4UIdirectory.hh"
0032 #include "G4UIcmdWithADoubleAndUnit.hh"
0033 #include "G4UIcmdWithAString.hh"
0034 #include "G4SystemOfUnits.hh"
0035
0036 PassiveCarbonBeamLineMessenger::PassiveCarbonBeamLineMessenger(PassiveCarbonBeamLine* beamLine)
0037 :passiveCarbon(beamLine)
0038
0039 {
0040 beamLineDir = new G4UIdirectory("/beamLine/");
0041 beamLineDir -> SetGuidance("set specification of ripple filter");
0042
0043 RippleFilterDir = new G4UIdirectory("/beamLine/RippleFilter/");
0044 RippleFilterDir -> SetGuidance("set specification of ripple filter");
0045
0046 finalCollimatorDir = new G4UIdirectory("/beamLine/FinalCollimator/");
0047 finalCollimatorDir -> SetGuidance("set specification of final collimator");
0048
0049 RippleFilterMatCmd = new G4UIcmdWithAString("/beamLine/RippleFilter/RFMat",this);
0050 RippleFilterMatCmd -> SetGuidance("Set material of ripple filter");
0051 RippleFilterMatCmd -> SetParameterName("choice",false);
0052 RippleFilterMatCmd -> AvailableForStates(G4State_Idle);
0053
0054 RippleFilterXPositionCmd = new G4UIcmdWithADoubleAndUnit("/beamLine/RippleFilter/position",this);
0055 RippleFilterXPositionCmd -> SetGuidance("Set position of ripple filter");
0056 RippleFilterXPositionCmd -> SetParameterName("Size",false);
0057 RippleFilterXPositionCmd -> SetDefaultUnit("mm");
0058 RippleFilterXPositionCmd -> SetUnitCandidates("mm cm m");
0059 RippleFilterXPositionCmd -> AvailableForStates(G4State_Idle);
0060
0061 innerRadiusFinalCollimatorCmd = new G4UIcmdWithADoubleAndUnit("/beamLine/FinalCollimator/halfInnerRad",this);
0062 innerRadiusFinalCollimatorCmd -> SetGuidance("Set size of inner radius ( max 21.5 mm)");
0063 innerRadiusFinalCollimatorCmd -> SetParameterName("Size",false);
0064 innerRadiusFinalCollimatorCmd -> SetDefaultUnit("mm");
0065 innerRadiusFinalCollimatorCmd -> SetUnitCandidates("mm cm m");
0066 innerRadiusFinalCollimatorCmd -> AvailableForStates(G4State_Idle);
0067
0068 }
0069
0070 PassiveCarbonBeamLineMessenger::~PassiveCarbonBeamLineMessenger()
0071 {
0072
0073 delete innerRadiusFinalCollimatorCmd;
0074 delete RippleFilterXPositionCmd;
0075 delete RippleFilterMatCmd;
0076 delete finalCollimatorDir;
0077 delete RippleFilterDir;
0078 delete beamLineDir;
0079
0080 }
0081
0082
0083 void PassiveCarbonBeamLineMessenger::SetNewValue(G4UIcommand* command,G4String newValue)
0084 {
0085 if( command == RippleFilterMatCmd )
0086 { passiveCarbon -> SetRippleFilterMaterial(newValue);
0087 }
0088
0089 else if( command == RippleFilterXPositionCmd )
0090 { passiveCarbon -> SetRippleFilterXPosition
0091 (RippleFilterXPositionCmd -> GetNewDoubleValue(newValue));
0092 }
0093
0094 else if( command == innerRadiusFinalCollimatorCmd )
0095 { passiveCarbon -> SetInnerRadiusFinalCollimator
0096 (innerRadiusFinalCollimatorCmd -> GetNewDoubleValue(newValue));
0097 }
0098
0099
0100 }
0101