File indexing completed on 2026-05-02 07:42:15
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 "PhysicsListMessenger.hh"
0030
0031 #include "PhysicsList.hh"
0032
0033 #include "G4UIcmdWithABool.hh"
0034 #include "G4UIcmdWithADoubleAndUnit.hh"
0035 #include "G4UIcmdWithAString.hh"
0036 #include "G4UIdirectory.hh"
0037
0038
0039
0040 PhysicsListMessenger::PhysicsListMessenger(PhysicsList* physL)
0041 : G4UImessenger(), fPhysList(physL), fPhysDir(0), fSRTypeCmd(0)
0042 {
0043 fPhysDir = new G4UIdirectory("/testem/phys/");
0044 fPhysDir->SetGuidance("physics list commands");
0045
0046 fSRTypeCmd = new G4UIcmdWithABool("/testem/phys/analyticSR", this);
0047 fSRTypeCmd->SetGuidance("choose analytic synchrotron radiation");
0048 fSRTypeCmd->SetParameterName("SRType", true);
0049 fSRTypeCmd->SetDefaultValue(true);
0050
0051 fXrayReflectionRoughnessCmd =
0052 new G4UIcmdWithADoubleAndUnit("/testem/phys/SetXrayReflectionRoughness", this);
0053 fXrayReflectionRoughnessCmd->SetGuidance(
0054 "Set the XrayReflection surface roughness, typically between 0 and 10 "
0055 "nm");
0056 fXrayReflectionRoughnessCmd->SetParameterName("XrayReflSurfRoughness", false);
0057 fXrayReflectionRoughnessCmd->SetRange("XrayReflSurfRoughness>=0");
0058 fXrayReflectionRoughnessCmd->SetUnitCategory("Length");
0059 fXrayReflectionRoughnessCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
0060 }
0061
0062
0063
0064 void PhysicsListMessenger::SetNewValue(G4UIcommand* command, G4String newValue)
0065 {
0066 if (command == fSRTypeCmd) {
0067 fPhysList->SetAnalyticSR(fSRTypeCmd->GetNewBoolValue(newValue));
0068 }
0069
0070 if (command == fXrayReflectionRoughnessCmd) {
0071 fPhysList->SetXrayReflectionRoughness(fXrayReflectionRoughnessCmd->GetNewDoubleValue(newValue));
0072 }
0073 }
0074
0075