File indexing completed on 2025-01-18 09:17:10
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 #include "XrayFluoPhysicsListMessenger.hh"
0033
0034 #include "XrayFluoPhysicsList.hh"
0035 #include "G4RunManager.hh"
0036 #include "G4UIdirectory.hh"
0037 #include "G4UIcmdWithAString.hh"
0038 #include "G4UIcmdWithADoubleAndUnit.hh"
0039 #include "G4UIcmdWithABool.hh"
0040
0041
0042
0043 XrayFluoPhysicsListMessenger::XrayFluoPhysicsListMessenger(XrayFluoPhysicsList* pPhys)
0044 :pPhysicsList(pPhys)
0045 {
0046 physDir = new G4UIdirectory("/phys/");
0047 physDir->SetGuidance("physics list commands");
0048
0049 pListCmd = new G4UIcmdWithAString("/phys/addPhysics",this);
0050 pListCmd->SetGuidance("Add modules physics list.");
0051 pListCmd->SetParameterName("PList",false);
0052 pListCmd->AvailableForStates(G4State_PreInit);
0053
0054 gammaCutCmd = new G4UIcmdWithADoubleAndUnit("/phys/setGCut",this);
0055 gammaCutCmd->SetGuidance("Set gamma cut.");
0056 gammaCutCmd->SetParameterName("Gcut",false);
0057 gammaCutCmd->SetUnitCategory("Length");
0058 gammaCutCmd->SetRange("Gcut>0.0");
0059 gammaCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
0060
0061 electCutCmd = new G4UIcmdWithADoubleAndUnit("/phys/setECut",this);
0062 electCutCmd->SetGuidance("Set electron and positron cuts.");
0063 electCutCmd->SetParameterName("Ecut",false);
0064 electCutCmd->SetUnitCategory("Length");
0065 electCutCmd->SetRange("Ecut>0.0");
0066 electCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
0067
0068 protoCutCmd = new G4UIcmdWithADoubleAndUnit("/phys/setPCut",this);
0069 protoCutCmd->SetGuidance("Set proton cut.");
0070 protoCutCmd->SetParameterName("Pcut",false);
0071 protoCutCmd->SetUnitCategory("Length");
0072 protoCutCmd->SetRange("Pcut>0.0");
0073 protoCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
0074
0075 allCutCmd = new G4UIcmdWithADoubleAndUnit("/phys/setCuts",this);
0076 allCutCmd->SetGuidance("Set cut for all.");
0077 allCutCmd->SetParameterName("cut",false);
0078 allCutCmd->SetUnitCategory("Length");
0079 allCutCmd->SetRange("cut>0.0");
0080 allCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
0081
0082
0083
0084
0085
0086
0087
0088
0089
0090
0091
0092 }
0093
0094
0095
0096 XrayFluoPhysicsListMessenger::~XrayFluoPhysicsListMessenger()
0097 {
0098 delete pListCmd;
0099 delete gammaCutCmd;
0100 delete electCutCmd;
0101 delete protoCutCmd;
0102 delete allCutCmd;
0103 delete physDir;
0104
0105
0106 }
0107
0108
0109
0110 void XrayFluoPhysicsListMessenger::SetNewValue(G4UIcommand* command, G4String newValue)
0111 {
0112 if( command == pListCmd )
0113 { pPhysicsList->AddPhysicsList(newValue);}
0114
0115 if( command == gammaCutCmd )
0116 { pPhysicsList->SetCutForGamma(gammaCutCmd->GetNewDoubleValue(newValue));}
0117
0118 if( command == electCutCmd )
0119 {
0120 G4double cut = electCutCmd->GetNewDoubleValue(newValue);
0121 pPhysicsList->SetCutForElectron(cut);
0122 pPhysicsList->SetCutForPositron(cut);
0123 }
0124
0125 if( command == protoCutCmd )
0126 { pPhysicsList->SetCutForProton(protoCutCmd->GetNewDoubleValue(newValue));}
0127
0128 if( command == allCutCmd )
0129 {
0130 G4double cut = allCutCmd->GetNewDoubleValue(newValue);
0131 pPhysicsList->SetCutForGamma(cut);
0132 pPhysicsList->SetCutForElectron(cut);
0133 pPhysicsList->SetCutForPositron(cut);
0134 pPhysicsList->SetCutForProton(cut);
0135 }
0136
0137
0138 G4RunManager::GetRunManager()->PhysicsHasBeenModified();
0139
0140
0141
0142
0143
0144
0145 }
0146
0147