File indexing completed on 2025-02-23 09:20:47
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 "RMC01DetectorMessenger.hh"
0042
0043 #include "RMC01DetectorConstruction.hh"
0044
0045 #include "G4UIcmdWith3VectorAndUnit.hh"
0046 #include "G4UIcmdWithADoubleAndUnit.hh"
0047 #include "G4UIdirectory.hh"
0048
0049
0050
0051 RMC01DetectorMessenger::RMC01DetectorMessenger(RMC01DetectorConstruction* GeneralDet)
0052 : G4UImessenger(),
0053 fTheDetector(GeneralDet),
0054 fGeneralDir(0),
0055 fDetDir(0),
0056 fSetSensitiveVolumeHeightCmd(0),
0057 fSetSensitiveVolumeRadiusCmd(0),
0058 fSetShieldingThicknessCmd(0)
0059 {
0060 fGeneralDir = new G4UIdirectory("/RMC01/");
0061 fGeneralDir->SetGuidance("Control of the Geant4 Reverse Monte Carlo example1");
0062
0063 fDetDir = new G4UIdirectory("/RMC01/geometry/");
0064 fDetDir->SetGuidance("Geometry control");
0065
0066 fSetSensitiveVolumeHeightCmd =
0067 new G4UIcmdWithADoubleAndUnit("/RMC01/geometry/SetSensitiveVolumeHeight", this);
0068 fSetSensitiveVolumeHeightCmd->SetGuidance("Set the height of the sensitive cylinder");
0069 fSetSensitiveVolumeHeightCmd->AvailableForStates(G4State_PreInit);
0070
0071 fSetSensitiveVolumeRadiusCmd =
0072 new G4UIcmdWithADoubleAndUnit("/RMC01/geometry/SetSensitiveVolumeRadius", this);
0073 fSetSensitiveVolumeRadiusCmd->SetGuidance("Set the radius of the sensitive cylinder");
0074 fSetSensitiveVolumeRadiusCmd->AvailableForStates(G4State_PreInit);
0075
0076 fSetShieldingThicknessCmd =
0077 new G4UIcmdWithADoubleAndUnit("/RMC01/geometry/SetShieldingThickness", this);
0078 fSetShieldingThicknessCmd->SetGuidance("Set the thickness of the Aluminum Shielding sphere");
0079 fSetShieldingThicknessCmd->AvailableForStates(G4State_PreInit);
0080 }
0081
0082
0083
0084 RMC01DetectorMessenger::~RMC01DetectorMessenger()
0085 {
0086 if (fGeneralDir) delete fGeneralDir;
0087 if (fDetDir) delete fDetDir;
0088 if (fSetSensitiveVolumeHeightCmd) delete fSetSensitiveVolumeHeightCmd;
0089 if (fSetSensitiveVolumeRadiusCmd) delete fSetSensitiveVolumeRadiusCmd;
0090 if (fSetShieldingThicknessCmd) delete fSetShieldingThicknessCmd;
0091 }
0092
0093
0094
0095 void RMC01DetectorMessenger::SetNewValue(G4UIcommand* command, G4String newValue)
0096 {
0097 if (command == fSetSensitiveVolumeHeightCmd) {
0098 fTheDetector->SetSensitiveVolumeHeight(
0099 fSetSensitiveVolumeHeightCmd->GetNewDoubleValue(newValue));
0100 }
0101
0102 else if (command == fSetSensitiveVolumeRadiusCmd) {
0103 fTheDetector->SetSensitiveVolumeRadius(
0104 fSetSensitiveVolumeRadiusCmd->GetNewDoubleValue(newValue));
0105 }
0106
0107 else if (command == fSetShieldingThicknessCmd) {
0108 fTheDetector->SetShieldingThickness(fSetShieldingThicknessCmd->GetNewDoubleValue(newValue));
0109 }
0110 }
0111
0112