File indexing completed on 2026-09-09 08:28:24
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
0042
0043 #include "PhysicsListMessenger.hh"
0044
0045 #include "PhysicsList.hh"
0046 #include "TestParameters.hh"
0047
0048 #include "G4UIcmdWithADouble.hh"
0049 #include "G4UIcmdWithADoubleAndUnit.hh"
0050 #include "G4UIcmdWithAString.hh"
0051 #include "G4UIcmdWithAnInteger.hh"
0052 #include "G4UIdirectory.hh"
0053
0054
0055
0056 PhysicsListMessenger::PhysicsListMessenger(PhysicsList* pPhys)
0057 : G4UImessenger(), fPhysicsList(pPhys)
0058 {
0059 fPhysDir = new G4UIdirectory("/testex/phys/");
0060 fPhysDir->SetGuidance("physics list commands");
0061
0062 fECmd = new G4UIcmdWithADoubleAndUnit("/testex/phys/setMaxE", this);
0063 fECmd->SetGuidance("Set max energy deposit");
0064 fECmd->SetParameterName("Emax", false);
0065 fECmd->SetUnitCategory("Energy");
0066 fECmd->SetRange("Emax>0.0");
0067 fECmd->AvailableForStates(G4State_PreInit, G4State_Idle);
0068
0069 fEBCmd = new G4UIcmdWithAnInteger("/testex/phys/setNbinsE", this);
0070 fEBCmd->SetGuidance("Set number of bins in energy.");
0071 fEBCmd->SetParameterName("Ebins", false);
0072 fEBCmd->SetRange("Ebins>0");
0073 fEBCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
0074
0075 fListCmd = new G4UIcmdWithAString("/testex/phys/addPhysics", this);
0076 fListCmd->SetGuidance("Add modula physics list.");
0077 fListCmd->SetParameterName("PList", false);
0078 fListCmd->AvailableForStates(G4State_PreInit);
0079
0080 fPHCmd = new G4UIcmdWithADoubleAndUnit("/testex/phys/setLDMPhotonMass", this);
0081 fPHCmd->SetGuidance("Set LDMPhotonMass");
0082 fPHCmd->SetParameterName("LDMPmass", false);
0083 fPHCmd->SetUnitCategory("Energy");
0084 fPHCmd->SetRange("LDMPmass>0.0");
0085 fPHCmd->AvailableForStates(G4State_PreInit);
0086
0087 fHCmd = new G4UIcmdWithADoubleAndUnit("/testex/phys/setLDMHiMass", this);
0088 fHCmd->SetGuidance("Set LDMHiMass");
0089 fHCmd->SetParameterName("LDMHmass", false);
0090 fHCmd->SetUnitCategory("Energy");
0091 fHCmd->SetRange("LDMHmass>0.0");
0092 fHCmd->AvailableForStates(G4State_PreInit);
0093 }
0094
0095
0096
0097 PhysicsListMessenger::~PhysicsListMessenger()
0098 {
0099 delete fECmd;
0100 delete fPHCmd;
0101 delete fHCmd;
0102 delete fEBCmd;
0103 delete fListCmd;
0104 delete fPhysDir;
0105 }
0106
0107
0108
0109 void PhysicsListMessenger::SetNewValue(G4UIcommand* command, G4String newValue)
0110 {
0111 TestParameters* man = TestParameters::GetPointer();
0112
0113 if (command == fECmd) {
0114 man->SetMaxEnergy(fECmd->GetNewDoubleValue(newValue));
0115 }
0116 if (command == fEBCmd) {
0117 man->SetNumberBins(fEBCmd->GetNewIntValue(newValue));
0118 }
0119 if (command == fListCmd) {
0120 fPhysicsList->AddPhysicsList(newValue);
0121 }
0122 if (command == fPHCmd) {
0123 fPhysicsList->SetLDMPhotonMass(fPHCmd->GetNewDoubleValue(newValue));
0124 }
0125 if (command == fHCmd) {
0126 fPhysicsList->SetLDMHiMass(fHCmd->GetNewDoubleValue(newValue));
0127 }
0128 }
0129
0130