File indexing completed on 2026-04-29 07:38:56
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 "G4UIcmdWithADouble.hh"
0034 #include "G4UIcmdWithAString.hh"
0035 #include "G4UIdirectory.hh"
0036
0037
0038
0039 PhysicsListMessenger::PhysicsListMessenger(PhysicsList* physL)
0040 : G4UImessenger(),
0041 fPhysList(physL),
0042 fPhysDir(0),
0043 fGammaToMuPairFacCmd(0),
0044 fAnnihiToMuPairFacCmd(0),
0045 fAnnihiToHadronFacCmd(0),
0046 fListCmd(0)
0047 {
0048 fPhysDir = new G4UIdirectory("/testem/phys/");
0049 fPhysDir->SetGuidance("physics list commands");
0050
0051 fGammaToMuPairFacCmd = new G4UIcmdWithADouble("/testem/phys/SetGammaToMuPairFac", this);
0052 fGammaToMuPairFacCmd->SetGuidance(
0053 "Set factor to artificially increase the GammaToMuPair cross section");
0054 fGammaToMuPairFacCmd->SetParameterName("GammaToMuPairFac", false);
0055 fGammaToMuPairFacCmd->SetRange("GammaToMuPairFac>0.0");
0056 fGammaToMuPairFacCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
0057
0058 fAnnihiToMuPairFacCmd = new G4UIcmdWithADouble("/testem/phys/SetAnnihiToMuPairFac", this);
0059 fAnnihiToMuPairFacCmd->SetGuidance(
0060 "Set factor to artificially increase the AnnihiToMuPair cross section");
0061 fAnnihiToMuPairFacCmd->SetParameterName("AnnihiToMuPairFac", false);
0062 fAnnihiToMuPairFacCmd->SetRange("AnnihiToMuPairFac>0.0");
0063 fAnnihiToMuPairFacCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
0064
0065 fAnnihiToHadronFacCmd = new G4UIcmdWithADouble("/testem/phys/SetAnnihiToHadronFac", this);
0066 fAnnihiToHadronFacCmd->SetGuidance(
0067 "Set factor to artificially increase the AnnihiToHadrons cross section");
0068 fAnnihiToHadronFacCmd->SetParameterName("AnnihiToHadFac", false);
0069 fAnnihiToHadronFacCmd->SetRange("AnnihiToHadFac>0.0");
0070 fAnnihiToHadronFacCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
0071
0072 fListCmd = new G4UIcmdWithAString("/testem/phys/addPhysics", this);
0073 fListCmd->SetGuidance("Add modula physics list.");
0074 fListCmd->SetParameterName("PList", false);
0075 fListCmd->AvailableForStates(G4State_PreInit);
0076 }
0077
0078
0079
0080 PhysicsListMessenger::~PhysicsListMessenger()
0081 {
0082 delete fGammaToMuPairFacCmd;
0083 delete fAnnihiToMuPairFacCmd;
0084 delete fAnnihiToHadronFacCmd;
0085 delete fPhysDir;
0086 delete fListCmd;
0087 }
0088
0089
0090
0091 void PhysicsListMessenger::SetNewValue(G4UIcommand* command, G4String newValue)
0092 {
0093 if (command == fGammaToMuPairFacCmd) {
0094 fPhysList->SetGammaToMuPairFac(fGammaToMuPairFacCmd->GetNewDoubleValue(newValue));
0095 }
0096
0097 if (command == fAnnihiToMuPairFacCmd) {
0098 fPhysList->SetAnnihiToMuPairFac(fAnnihiToMuPairFacCmd->GetNewDoubleValue(newValue));
0099 }
0100
0101 if (command == fAnnihiToHadronFacCmd) {
0102 fPhysList->SetAnnihiToHadronFac(fAnnihiToHadronFacCmd->GetNewDoubleValue(newValue));
0103 }
0104
0105 if (command == fListCmd) {
0106 fPhysList->AddPhysicsList(newValue);
0107 }
0108 }
0109
0110