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