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