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
0033
0034
0035
0036 #include "XrayFluoPlanePrimaryGeneratorMessenger.hh"
0037 #include "XrayFluoPlanePrimaryGeneratorAction.hh"
0038 #include "G4UIcmdWithAString.hh"
0039
0040
0041
0042 XrayFluoPlanePrimaryGeneratorMessenger::XrayFluoPlanePrimaryGeneratorMessenger(XrayFluoPlanePrimaryGeneratorAction* XrayFluoGun)
0043 :XrayFluoAction(XrayFluoGun)
0044 {
0045 RndmCmd = new G4UIcmdWithAString("/gun/random",this);
0046 RndmCmd->SetGuidance("Shoot particles from a point-like source at infinity, witth an incidence angle with the plane of 45 deg");
0047 RndmCmd->SetGuidance(" Choice : on(default), off");
0048 RndmCmd->SetParameterName("choice",true);
0049 RndmCmd->SetDefaultValue("on");
0050 RndmCmd->SetCandidates("on off");
0051 RndmCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
0052
0053 RndmVert = new G4UIcmdWithAString("/gun/beam",this);
0054 RndmVert->SetGuidance("Creates a round beam of particles of 0.5mm in diameter.");
0055 RndmVert->SetGuidance(" Choice : on(default), off");
0056 RndmVert->SetParameterName("choice",true);
0057 RndmVert->SetDefaultValue("on");
0058 RndmVert->SetCandidates("on off");
0059 RndmVert->AvailableForStates(G4State_PreInit,G4State_Idle);
0060
0061 spectrum = new G4UIcmdWithAString("/gun/spectrum",this);
0062 spectrum->SetGuidance("Shoot the incident particle with a certain energy spectrum.");
0063 spectrum->SetGuidance(" Choice : on(default), off");
0064 spectrum->SetParameterName("choice",true);
0065 spectrum->SetDefaultValue("on");
0066 spectrum->SetCandidates("on off");
0067 spectrum->AvailableForStates(G4State_PreInit,G4State_Idle);
0068
0069 isoVert = new G4UIcmdWithAString("/gun/isoVert",this);
0070 isoVert->SetGuidance("Shoot the incident particle from an isotropic direction.");
0071 isoVert->SetGuidance(" Choice : on(default), off");
0072 isoVert->SetParameterName("choice",true);
0073 isoVert->SetDefaultValue("on");
0074 isoVert->SetCandidates("on off");
0075 isoVert->AvailableForStates(G4State_PreInit,G4State_Idle);
0076
0077 G4cout << "XrayFluoPlanePrimaryGeneratorMessenger created" << G4endl;
0078
0079 }
0080
0081
0082
0083 XrayFluoPlanePrimaryGeneratorMessenger::~XrayFluoPlanePrimaryGeneratorMessenger()
0084 {
0085 delete RndmCmd;
0086 delete RndmVert;
0087 delete spectrum;
0088 delete isoVert;
0089
0090 G4cout << "XrayFluoPlanePrimaryGeneratorMessenger deleted" << G4endl;
0091
0092 }
0093
0094
0095
0096 void XrayFluoPlanePrimaryGeneratorMessenger::SetNewValue(G4UIcommand * command,G4String newValue)
0097 {
0098 if( command == RndmCmd )
0099 {
0100 XrayFluoAction->SetRndmFlag(newValue);
0101 XrayFluoAction->SetRndmVert("off");
0102 XrayFluoAction->SetIsoVert("off");
0103 }
0104
0105 if( command == RndmVert )
0106 {
0107 XrayFluoAction->SetRndmVert(newValue);
0108 XrayFluoAction->SetIsoVert("off");
0109 XrayFluoAction->SetRndmFlag("off");
0110 }
0111 if( command == spectrum )
0112 { XrayFluoAction->SetSpectrum(newValue);}
0113
0114 if( command == isoVert )
0115 {
0116 XrayFluoAction->SetIsoVert(newValue);
0117 XrayFluoAction->SetRndmFlag("off");
0118 XrayFluoAction->SetRndmVert("off");
0119 }
0120 }
0121
0122
0123