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