File indexing completed on 2025-01-18 09:16:37
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 #include "GammaKnifePhysicsListMessenger.hh"
0028 #include "GammaKnifePhysicsList.hh"
0029 #include "G4UIdirectory.hh"
0030 #include "G4UIcmdWithoutParameter.hh"
0031 #include "G4UIcmdWithADouble.hh"
0032 #include "G4UIcmdWithADoubleAndUnit.hh"
0033 #include "G4UIcmdWithABool.hh"
0034 #include "G4UIcmdWithAString.hh"
0035 #include "G4SystemOfUnits.hh"
0036
0037 GammaKnifePhysicsListMessenger::GammaKnifePhysicsListMessenger(GammaKnifePhysicsList * physList)
0038 :physicsList(physList)
0039 {
0040 listDir = new G4UIdirectory("/Physics/");
0041
0042
0043 physicsListCmd = new G4UIcmdWithAString("/Physics/addPhysics",this);
0044 physicsListCmd->SetGuidance("Add chunks of PhysicsList.");
0045 physicsListCmd->SetParameterName("physList",false);
0046 physicsListCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
0047
0048 gammaCutCmd = new G4UIcmdWithADoubleAndUnit("/Physics/setGCut",this);
0049 gammaCutCmd->SetGuidance("Set gamma cut.");
0050 gammaCutCmd->SetParameterName("Gcut",false);
0051 gammaCutCmd->SetUnitCategory("Length");
0052 gammaCutCmd->SetRange("Gcut>0.0");
0053 gammaCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
0054
0055 electCutCmd = new G4UIcmdWithADoubleAndUnit("/Physics/setECut",this);
0056 electCutCmd->SetGuidance("Set electron cut.");
0057 electCutCmd->SetParameterName("Ecut",false);
0058 electCutCmd->SetUnitCategory("Length");
0059 electCutCmd->SetRange("Ecut>0.0");
0060 electCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
0061
0062 protoCutCmd = new G4UIcmdWithADoubleAndUnit("/Physics/setPCut",this);
0063 protoCutCmd->SetGuidance("Set positron cut.");
0064 protoCutCmd->SetParameterName("Pcut",false);
0065 protoCutCmd->SetUnitCategory("Length");
0066 protoCutCmd->SetRange("Pcut>0.0");
0067 protoCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
0068
0069 allCutCmd = new G4UIcmdWithADoubleAndUnit("/Physics/setCuts",this);
0070 allCutCmd->SetGuidance("Set cut for all.");
0071 allCutCmd->SetParameterName("cut",false);
0072 allCutCmd->SetUnitCategory("Length");
0073 allCutCmd->SetRange("cut>0.0");
0074 allCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
0075
0076
0077 }
0078
0079 GammaKnifePhysicsListMessenger::~GammaKnifePhysicsListMessenger()
0080 {
0081 delete physicsListCmd;
0082 delete gammaCutCmd;
0083 delete electCutCmd;
0084 delete protoCutCmd;
0085 delete allCutCmd;
0086 delete listDir;
0087 }
0088
0089 void GammaKnifePhysicsListMessenger::SetNewValue(G4UIcommand* command,G4String newValue)
0090 {
0091 if (command == physicsListCmd)
0092 {
0093 physicsList->AddPhysicsList(newValue);
0094 }
0095
0096 else if( command == gammaCutCmd )
0097 { physicsList->SetCutForGamma(gammaCutCmd->GetNewDoubleValue(newValue));}
0098
0099 else if( command == electCutCmd )
0100 { physicsList->SetCutForElectron(electCutCmd->GetNewDoubleValue(newValue));}
0101
0102 else if( command == protoCutCmd )
0103 { physicsList->SetCutForPositron(protoCutCmd->GetNewDoubleValue(newValue));}
0104
0105 else if( command == allCutCmd )
0106 {
0107 G4double cut = allCutCmd->GetNewDoubleValue(newValue);
0108 physicsList->SetCutForGamma(cut);
0109 physicsList->SetCutForElectron(cut);
0110 physicsList->SetCutForPositron(cut);
0111 }
0112
0113 }
0114
0115
0116
0117
0118
0119