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 "G4AdjointPhysicsMessenger.hh"
0042
0043 #include "G4AdjointPhysicsList.hh"
0044 #include "G4UIcmdWith3VectorAndUnit.hh"
0045 #include "G4UIcmdWithABool.hh"
0046 #include "G4UIcmdWithADouble.hh"
0047 #include "G4UIcmdWithADoubleAndUnit.hh"
0048 #include "G4UIcmdWithAString.hh"
0049 #include "G4UIcmdWithAnInteger.hh"
0050 #include "G4UIcmdWithoutParameter.hh"
0051 #include "G4UIdirectory.hh"
0052 #include "G4UnitsTable.hh"
0053
0054
0055
0056 G4AdjointPhysicsMessenger::G4AdjointPhysicsMessenger(G4AdjointPhysicsList* pPhysicsList)
0057 : G4UImessenger(),
0058 fPhysicsList(pPhysicsList),
0059 fPhysicsDir(0),
0060 fUsepIonisationCmd(0),
0061 fUseBremCmd(0),
0062 fUseComptonCmd(0),
0063 fUseMSCmd(0),
0064 fUsePEEffectCmd(0),
0065 fUseGammaConversionCmd(0),
0066 fUseEgainFluctuationCmd(0),
0067 fSetEminAdjModelsCmd(0),
0068 fSetEmaxAdjModelsCmd(0)
0069 {
0070 fPhysicsDir = new G4UIdirectory("/adjoint_physics/");
0071
0072 fPhysicsDir->SetGuidance("Definition of adjoint and forward physics processes");
0073
0074 fUsepIonisationCmd = new G4UIcmdWithABool("/adjoint_physics/UseProtonIonisation", this);
0075 fUsepIonisationCmd->SetGuidance("If true (false) the proton ionisation is (not) considered");
0076 fUsepIonisationCmd->AvailableForStates(G4State_PreInit);
0077
0078 fUseBremCmd = new G4UIcmdWithABool("/adjoint_physics/UseBremsstrahlung", this);
0079 fUseBremCmd->SetGuidance("If true (false) the bremsstrahlung process is (not) considered");
0080 fUseBremCmd->AvailableForStates(G4State_PreInit);
0081
0082 fUseComptonCmd = new G4UIcmdWithABool("/adjoint_physics/UseCompton", this);
0083 fUseComptonCmd->SetGuidance("If true (false) the Compton scattering is (not) considered");
0084 fUseComptonCmd->AvailableForStates(G4State_PreInit);
0085
0086 fUseMSCmd = new G4UIcmdWithABool("/adjoint_physics/UseMS", this);
0087 fUseMSCmd->SetGuidance("If true (false) the continuous multiple scattering is (not) considered");
0088 fUseMSCmd->AvailableForStates(G4State_PreInit);
0089
0090 fUseEgainFluctuationCmd = new G4UIcmdWithABool("/adjoint_physics/UseEgainElossFluctuation", this);
0091 fUseEgainFluctuationCmd->SetGuidance(
0092 "Switch on/off the fluctation for continuous energy gain/loss");
0093 fUseEgainFluctuationCmd->AvailableForStates(G4State_PreInit);
0094
0095 fUsePEEffectCmd = new G4UIcmdWithABool("/adjoint_physics/UsePEEffect", this);
0096 fUsePEEffectCmd->AvailableForStates(G4State_PreInit);
0097 fUsePEEffectCmd->SetGuidance("If true (false) the photo electric effect is (not) considered");
0098
0099 fUseGammaConversionCmd = new G4UIcmdWithABool("/adjoint_physics/UseGammaConversion", this);
0100 fUseGammaConversionCmd->AvailableForStates(G4State_PreInit);
0101 fUseGammaConversionCmd->SetGuidance("If true the fwd gamma pair conversion is considered");
0102
0103 fSetEminAdjModelsCmd =
0104 new G4UIcmdWithADoubleAndUnit("/adjoint_physics/SetEminForAdjointModels", this);
0105 fSetEminAdjModelsCmd->SetGuidance("Set the minimum energy of the adjoint models");
0106 fSetEminAdjModelsCmd->SetParameterName("Emin", false);
0107 fSetEminAdjModelsCmd->SetUnitCategory("Energy");
0108 fSetEminAdjModelsCmd->AvailableForStates(G4State_PreInit);
0109
0110 fSetEmaxAdjModelsCmd =
0111 new G4UIcmdWithADoubleAndUnit("/adjoint_physics/SetEmaxForAdjointModels", this);
0112 fSetEmaxAdjModelsCmd->SetGuidance("Set the minimum energy of the adjoint models.");
0113 fSetEmaxAdjModelsCmd->SetParameterName("Emax", false);
0114 fSetEmaxAdjModelsCmd->SetUnitCategory("Energy");
0115 fSetEmaxAdjModelsCmd->AvailableForStates(G4State_PreInit);
0116 }
0117
0118
0119
0120 G4AdjointPhysicsMessenger::~G4AdjointPhysicsMessenger()
0121 {
0122 delete fUsepIonisationCmd;
0123 delete fUseBremCmd;
0124 delete fUseComptonCmd;
0125 delete fUseMSCmd;
0126 delete fUsePEEffectCmd;
0127 delete fUseGammaConversionCmd;
0128 delete fUseEgainFluctuationCmd;
0129 delete fSetEminAdjModelsCmd;
0130 delete fSetEmaxAdjModelsCmd;
0131 }
0132
0133
0134
0135 void G4AdjointPhysicsMessenger::SetNewValue(G4UIcommand* command, G4String newValue)
0136 {
0137 if (command == fUsepIonisationCmd) {
0138 fPhysicsList->SetUseProtonIonisation(fUsepIonisationCmd->GetNewBoolValue(newValue));
0139 }
0140 else if (command == fUseBremCmd) {
0141 fPhysicsList->SetUseBrem(fUseBremCmd->GetNewBoolValue(newValue));
0142 }
0143 else if (command == fUseComptonCmd) {
0144 fPhysicsList->SetUseCompton(fUseComptonCmd->GetNewBoolValue(newValue));
0145 }
0146 else if (command == fUseMSCmd) {
0147 fPhysicsList->SetUseMS(fUseMSCmd->GetNewBoolValue(newValue));
0148 }
0149 else if (command == fUsePEEffectCmd) {
0150 fPhysicsList->SetUsePEEffect(fUsePEEffectCmd->GetNewBoolValue(newValue));
0151 }
0152 else if (command == fUseGammaConversionCmd) {
0153 fPhysicsList->SetUseGammaConversion(fUseGammaConversionCmd->GetNewBoolValue(newValue));
0154 }
0155 else if (command == fUseEgainFluctuationCmd) {
0156 fPhysicsList->SetUseEgainFluctuation(fUseEgainFluctuationCmd->GetNewBoolValue(newValue));
0157 }
0158
0159 else if (command == fSetEminAdjModelsCmd) {
0160 fPhysicsList->SetEminAdjModels(fSetEminAdjModelsCmd->GetNewDoubleValue(newValue));
0161 }
0162 else if (command == fSetEmaxAdjModelsCmd) {
0163 fPhysicsList->SetEmaxAdjModels(fSetEmaxAdjModelsCmd->GetNewDoubleValue(newValue));
0164 }
0165 }
0166
0167