File indexing completed on 2025-01-31 09:22:30
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 #include "IORTPhysicsListMessenger.hh"
0042
0043 #include "IORTPhysicsList.hh"
0044 #include "G4UIdirectory.hh"
0045 #include "G4UIcmdWithADoubleAndUnit.hh"
0046 #include "G4UIcmdWithAString.hh"
0047
0048
0049 IORTPhysicsListMessenger::IORTPhysicsListMessenger(IORTPhysicsList* pPhys)
0050 :pPhysicsList(pPhys)
0051 {
0052 physDir = new G4UIdirectory("/Physics/");
0053 physDir->SetGuidance("Commands to activate physics models and set cuts");
0054
0055 gammaCutCmd = new G4UIcmdWithADoubleAndUnit("/Physics/setGCut",this);
0056 gammaCutCmd->SetGuidance("Set gamma cut.");
0057 gammaCutCmd->SetParameterName("Gcut",false);
0058 gammaCutCmd->SetUnitCategory("Length");
0059 gammaCutCmd->SetRange("Gcut>0.0");
0060 gammaCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
0061
0062 electCutCmd = new G4UIcmdWithADoubleAndUnit("/Physics/setECut",this);
0063 electCutCmd->SetGuidance("Set electron cut.");
0064 electCutCmd->SetParameterName("Ecut",false);
0065 electCutCmd->SetUnitCategory("Length");
0066 electCutCmd->SetRange("Ecut>0.0");
0067 electCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
0068
0069 protoCutCmd = new G4UIcmdWithADoubleAndUnit("/Physics/setPCut",this);
0070 protoCutCmd->SetGuidance("Set positron cut.");
0071 protoCutCmd->SetParameterName("Pcut",false);
0072 protoCutCmd->SetUnitCategory("Length");
0073 protoCutCmd->SetRange("Pcut>0.0");
0074 protoCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
0075
0076 allCutCmd = new G4UIcmdWithADoubleAndUnit("/Physics/setCuts",this);
0077 allCutCmd->SetGuidance("Set cut for all.");
0078 allCutCmd->SetParameterName("cut",false);
0079 allCutCmd->SetUnitCategory("Length");
0080 allCutCmd->SetRange("cut>0.0");
0081 allCutCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
0082
0083 allDetectorCmd = new G4UIcmdWithADoubleAndUnit("/Physics/setDetectorCuts",this);
0084 allDetectorCmd->SetGuidance("Set cut for all. into Detector");
0085 allDetectorCmd->SetParameterName("cut",false);
0086 allDetectorCmd->SetUnitCategory("Length");
0087 allDetectorCmd->SetRange("cut>0.0");
0088 allDetectorCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
0089
0090 pListCmd = new G4UIcmdWithAString("/Physics/addPhysics",this);
0091 pListCmd->SetGuidance("Add physics list.");
0092 pListCmd->SetParameterName("PList",false);
0093 pListCmd->AvailableForStates(G4State_PreInit, G4State_Idle);
0094 }
0095
0096
0097 IORTPhysicsListMessenger::~IORTPhysicsListMessenger()
0098 {
0099 delete gammaCutCmd;
0100 delete electCutCmd;
0101 delete protoCutCmd;
0102 delete allCutCmd;
0103 delete allDetectorCmd;
0104 delete pListCmd;
0105 delete physDir;
0106 }
0107
0108
0109 void IORTPhysicsListMessenger::SetNewValue(G4UIcommand* command,
0110 G4String newValue)
0111 {
0112 if( command == gammaCutCmd )
0113 { pPhysicsList->SetCutForGamma(gammaCutCmd->GetNewDoubleValue(newValue));}
0114
0115 else if( command == electCutCmd )
0116 { pPhysicsList->SetCutForElectron(electCutCmd->GetNewDoubleValue(newValue));}
0117
0118 else if( command == protoCutCmd )
0119 { pPhysicsList->SetCutForPositron(protoCutCmd->GetNewDoubleValue(newValue));}
0120
0121 else if( command == allCutCmd )
0122 {
0123 G4double cut = allCutCmd->GetNewDoubleValue(newValue);
0124 pPhysicsList->SetCutForGamma(cut);
0125 pPhysicsList->SetCutForElectron(cut);
0126 pPhysicsList->SetCutForPositron(cut);
0127 }
0128 else if( command == allDetectorCmd)
0129 {
0130 G4double cut = allDetectorCmd -> GetNewDoubleValue(newValue);
0131 pPhysicsList -> SetDetectorCut(cut);
0132 }
0133 else if( command == pListCmd )
0134 { pPhysicsList->AddPhysicsList(newValue);}
0135 }