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 "XrayFluoPrimaryGeneratorMessenger.hh"
0037 #include "XrayFluoPrimaryGeneratorAction.hh"
0038 #include "G4UIcmdWithAString.hh"
0039 #include "G4UIcmdWithABool.hh"
0040
0041
0042
0043 XrayFluoPrimaryGeneratorMessenger::XrayFluoPrimaryGeneratorMessenger(XrayFluoPrimaryGeneratorAction* XrayFluoGun)
0044 :XrayFluoAction(XrayFluoGun)
0045 {
0046 RndmCmd = new G4UIcmdWithAString("/gun/random",this);
0047 RndmCmd->SetGuidance("Shoot randomly the incident particle.");
0048 RndmCmd->SetGuidance(" Choice : on(default), off");
0049 RndmCmd->SetParameterName("choice",true);
0050 RndmCmd->SetDefaultValue("on");
0051 RndmCmd->SetCandidates("on off");
0052 RndmCmd->AvailableForStates(G4State_PreInit,G4State_Idle);
0053
0054 RndmVert = new G4UIcmdWithAString("/gun/randomVert",this);
0055 RndmVert->SetGuidance("Shoot randomly the incident particle.");
0056 RndmVert->SetGuidance(" Choice : on(default), off");
0057 RndmVert->SetParameterName("choice",true);
0058 RndmVert->SetDefaultValue("on");
0059 RndmVert->SetCandidates("on off");
0060 RndmVert->AvailableForStates(G4State_PreInit,G4State_Idle);
0061
0062 spectrum = new G4UIcmdWithAString("/gun/spectrum",this);
0063 spectrum->SetGuidance("Shoot the incident particle with a certain energy spectrum.");
0064 spectrum->SetGuidance(" Choice : on(default), off");
0065 spectrum->SetParameterName("choice",true);
0066 spectrum->SetDefaultValue("on");
0067 spectrum->SetCandidates("on off");
0068 spectrum->AvailableForStates(G4State_PreInit,G4State_Idle);
0069
0070 isoVert = new G4UIcmdWithAString("/gun/isoVert",this);
0071 isoVert->SetGuidance("Shoot the incident particle from an isotrofic direction.");
0072 isoVert->SetGuidance(" Choice : on(default), off");
0073 isoVert->SetParameterName("choice",true);
0074 isoVert->SetDefaultValue("on");
0075 isoVert->SetCandidates("on off");
0076 isoVert->AvailableForStates(G4State_PreInit,G4State_Idle);
0077
0078 loadPahseSpace=new G4UIcmdWithAString("/gun/loadGunData",this);
0079 loadPahseSpace->SetGuidance("Load emission from samples form previous runs");
0080 loadPahseSpace->SetGuidance("Please enter the filename");
0081 loadPahseSpace->SetParameterName("choice",true);
0082 loadPahseSpace->AvailableForStates(G4State_Idle);
0083
0084 loadRayleighData=new G4UIcmdWithABool("/gun/loadRayleighFlag",this);
0085 loadRayleighData->SetGuidance("Select if data form rayleigh scattering must be loaded");
0086 loadRayleighData->SetGuidance("To be used before and togheter with /gun/loadGunData");
0087 loadRayleighData->SetParameterName("Rayleigh Flag",true);
0088 loadRayleighData->SetDefaultValue(true);
0089 loadRayleighData->AvailableForStates(G4State_Idle);
0090
0091 G4cout << "XrayFluoPrimaryGeneratorMessenger created" << G4endl;
0092
0093 }
0094
0095
0096
0097 XrayFluoPrimaryGeneratorMessenger::~XrayFluoPrimaryGeneratorMessenger()
0098 {
0099 delete RndmCmd;
0100 delete RndmVert;
0101 delete spectrum;
0102 delete isoVert;
0103 delete loadPahseSpace;
0104 delete loadRayleighData;
0105 G4cout << "XrayFluoPrimaryGeneratorMessenger deleted" << G4endl;
0106
0107 }
0108
0109
0110
0111 void XrayFluoPrimaryGeneratorMessenger::SetNewValue(G4UIcommand * command,G4String newValue)
0112 {
0113 if( command == RndmCmd )
0114 { XrayFluoAction->SetRndmFlag(newValue);}
0115 if( command == RndmVert )
0116 { XrayFluoAction->SetRndmVert(newValue);}
0117 if( command == spectrum )
0118 { XrayFluoAction->SetSpectrum(newValue);}
0119 if( command == isoVert )
0120 { XrayFluoAction->SetIsoVert(newValue);}
0121 if( command == loadPahseSpace )
0122 { XrayFluoAction->ActivatePhaseSpace(newValue);}
0123 if( command == loadRayleighData )
0124 {
0125 G4cout << "newValue: " << newValue << G4endl;
0126
0127 G4bool newRayFlag = loadRayleighData->GetNewBoolValue(newValue);
0128 XrayFluoAction->SetRayleighFlag(newRayFlag);
0129 }
0130 }
0131
0132
0133