Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer 3 // * License and Disclaimer * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/ 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. 9 // * include a list of copyright holders. * 10 // * 10 // * * 11 // * Neither the authors of this software syst 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitatio 16 // * for the full disclaimer and the limitation of liability. * 17 // * 17 // * * 18 // * This code implementation is the result 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboratio 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distri 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you ag 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publicati 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Sof 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************* 24 // ******************************************************************** 25 // 25 // 26 // 26 // >> 27 // $Id: XrayFluoPrimarygeneratorMessenger.cc >> 28 // GEANT4 tag $Name: xray_fluo-V03-02-00 27 // 29 // 28 // Author: Elena Guardincerri (Elena.Guardince 30 // Author: Elena Guardincerri (Elena.Guardincerri@ge.infn.it) 29 // 31 // 30 // History: 32 // History: 31 // ----------- 33 // ----------- 32 // 28 Nov 2001 Elena Guardincerri Created 34 // 28 Nov 2001 Elena Guardincerri Created 33 // 35 // 34 // ------------------------------------------- 36 // ------------------------------------------------------------------- 35 37 36 #include "XrayFluoPrimaryGeneratorMessenger.hh 38 #include "XrayFluoPrimaryGeneratorMessenger.hh" 37 #include "XrayFluoPrimaryGeneratorAction.hh" 39 #include "XrayFluoPrimaryGeneratorAction.hh" 38 #include "G4UIcmdWithAString.hh" 40 #include "G4UIcmdWithAString.hh" 39 #include "G4UIcmdWithABool.hh" 41 #include "G4UIcmdWithABool.hh" 40 42 41 //....oooOO0OOooo........oooOO0OOooo........oo 43 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 42 44 43 XrayFluoPrimaryGeneratorMessenger::XrayFluoPri 45 XrayFluoPrimaryGeneratorMessenger::XrayFluoPrimaryGeneratorMessenger(XrayFluoPrimaryGeneratorAction* XrayFluoGun) 44 :XrayFluoAction(XrayFluoGun) 46 :XrayFluoAction(XrayFluoGun) 45 { 47 { 46 RndmCmd = new G4UIcmdWithAString("/gun/rando 48 RndmCmd = new G4UIcmdWithAString("/gun/random",this); 47 RndmCmd->SetGuidance("Shoot randomly the inc 49 RndmCmd->SetGuidance("Shoot randomly the incident particle."); 48 RndmCmd->SetGuidance(" Choice : on(default) 50 RndmCmd->SetGuidance(" Choice : on(default), off"); 49 RndmCmd->SetParameterName("choice",true); 51 RndmCmd->SetParameterName("choice",true); 50 RndmCmd->SetDefaultValue("on"); 52 RndmCmd->SetDefaultValue("on"); 51 RndmCmd->SetCandidates("on off"); 53 RndmCmd->SetCandidates("on off"); 52 RndmCmd->AvailableForStates(G4State_PreInit, 54 RndmCmd->AvailableForStates(G4State_PreInit,G4State_Idle); 53 55 54 RndmVert = new G4UIcmdWithAString("/gun/rand 56 RndmVert = new G4UIcmdWithAString("/gun/randomVert",this); 55 RndmVert->SetGuidance("Shoot randomly the in 57 RndmVert->SetGuidance("Shoot randomly the incident particle."); 56 RndmVert->SetGuidance(" Choice : on(default 58 RndmVert->SetGuidance(" Choice : on(default), off"); 57 RndmVert->SetParameterName("choice",true); 59 RndmVert->SetParameterName("choice",true); 58 RndmVert->SetDefaultValue("on"); 60 RndmVert->SetDefaultValue("on"); 59 RndmVert->SetCandidates("on off"); 61 RndmVert->SetCandidates("on off"); 60 RndmVert->AvailableForStates(G4State_PreInit 62 RndmVert->AvailableForStates(G4State_PreInit,G4State_Idle); 61 63 62 spectrum = new G4UIcmdWithAString("/gun/spec 64 spectrum = new G4UIcmdWithAString("/gun/spectrum",this); 63 spectrum->SetGuidance("Shoot the incident pa 65 spectrum->SetGuidance("Shoot the incident particle with a certain energy spectrum."); 64 spectrum->SetGuidance(" Choice : on(default 66 spectrum->SetGuidance(" Choice : on(default), off"); 65 spectrum->SetParameterName("choice",true); 67 spectrum->SetParameterName("choice",true); 66 spectrum->SetDefaultValue("on"); 68 spectrum->SetDefaultValue("on"); 67 spectrum->SetCandidates("on off"); 69 spectrum->SetCandidates("on off"); 68 spectrum->AvailableForStates(G4State_PreInit 70 spectrum->AvailableForStates(G4State_PreInit,G4State_Idle); 69 71 70 isoVert = new G4UIcmdWithAString("/gun/isoVe 72 isoVert = new G4UIcmdWithAString("/gun/isoVert",this); 71 isoVert->SetGuidance("Shoot the incident par 73 isoVert->SetGuidance("Shoot the incident particle from an isotrofic direction."); 72 isoVert->SetGuidance(" Choice : on(default) 74 isoVert->SetGuidance(" Choice : on(default), off"); 73 isoVert->SetParameterName("choice",true); 75 isoVert->SetParameterName("choice",true); 74 isoVert->SetDefaultValue("on"); 76 isoVert->SetDefaultValue("on"); 75 isoVert->SetCandidates("on off"); 77 isoVert->SetCandidates("on off"); 76 isoVert->AvailableForStates(G4State_PreInit, 78 isoVert->AvailableForStates(G4State_PreInit,G4State_Idle); 77 79 78 loadPahseSpace=new G4UIcmdWithAString("/gun/ 80 loadPahseSpace=new G4UIcmdWithAString("/gun/loadGunData",this); 79 loadPahseSpace->SetGuidance("Load emission f 81 loadPahseSpace->SetGuidance("Load emission from samples form previous runs"); 80 loadPahseSpace->SetGuidance("Please enter th 82 loadPahseSpace->SetGuidance("Please enter the filename"); 81 loadPahseSpace->SetParameterName("choice",tr 83 loadPahseSpace->SetParameterName("choice",true); 82 loadPahseSpace->AvailableForStates(G4State_I 84 loadPahseSpace->AvailableForStates(G4State_Idle); 83 85 84 loadRayleighData=new G4UIcmdWithABool("/gun/ 86 loadRayleighData=new G4UIcmdWithABool("/gun/loadRayleighFlag",this); 85 loadRayleighData->SetGuidance("Select if dat 87 loadRayleighData->SetGuidance("Select if data form rayleigh scattering must be loaded"); 86 loadRayleighData->SetGuidance("To be used be 88 loadRayleighData->SetGuidance("To be used before and togheter with /gun/loadGunData"); 87 loadRayleighData->SetParameterName("Rayleigh 89 loadRayleighData->SetParameterName("Rayleigh Flag",true); 88 loadRayleighData->SetDefaultValue(true); 90 loadRayleighData->SetDefaultValue(true); 89 loadRayleighData->AvailableForStates(G4State 91 loadRayleighData->AvailableForStates(G4State_Idle); 90 92 91 G4cout << "XrayFluoPrimaryGeneratorMessenger 93 G4cout << "XrayFluoPrimaryGeneratorMessenger created" << G4endl; 92 94 93 } 95 } 94 96 95 //....oooOO0OOooo........oooOO0OOooo........oo 97 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 96 98 97 XrayFluoPrimaryGeneratorMessenger::~XrayFluoPr 99 XrayFluoPrimaryGeneratorMessenger::~XrayFluoPrimaryGeneratorMessenger() 98 { 100 { 99 delete RndmCmd; 101 delete RndmCmd; 100 delete RndmVert; 102 delete RndmVert; 101 delete spectrum; 103 delete spectrum; 102 delete isoVert; 104 delete isoVert; 103 delete loadPahseSpace; 105 delete loadPahseSpace; 104 delete loadRayleighData; 106 delete loadRayleighData; 105 G4cout << "XrayFluoPrimaryGeneratorMessenger 107 G4cout << "XrayFluoPrimaryGeneratorMessenger deleted" << G4endl; 106 108 107 } 109 } 108 110 109 //....oooOO0OOooo........oooOO0OOooo........oo 111 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 110 112 111 void XrayFluoPrimaryGeneratorMessenger::SetNew 113 void XrayFluoPrimaryGeneratorMessenger::SetNewValue(G4UIcommand * command,G4String newValue) 112 { 114 { 113 if( command == RndmCmd ) 115 if( command == RndmCmd ) 114 { XrayFluoAction->SetRndmFlag(newValue);} 116 { XrayFluoAction->SetRndmFlag(newValue);} 115 if( command == RndmVert ) 117 if( command == RndmVert ) 116 { XrayFluoAction->SetRndmVert(newValue);} 118 { XrayFluoAction->SetRndmVert(newValue);} 117 if( command == spectrum ) 119 if( command == spectrum ) 118 { XrayFluoAction->SetSpectrum(newValue);} 120 { XrayFluoAction->SetSpectrum(newValue);} 119 if( command == isoVert ) 121 if( command == isoVert ) 120 { XrayFluoAction->SetIsoVert(newValue);} 122 { XrayFluoAction->SetIsoVert(newValue);} 121 if( command == loadPahseSpace ) 123 if( command == loadPahseSpace ) 122 { XrayFluoAction->ActivatePhaseSpace(newVal 124 { XrayFluoAction->ActivatePhaseSpace(newValue);} 123 if( command == loadRayleighData ) 125 if( command == loadRayleighData ) 124 { 126 { 125 G4cout << "newValue: " << newValue << G4e 127 G4cout << "newValue: " << newValue << G4endl; 126 128 127 G4bool newRayFlag = loadRayleighData->Get 129 G4bool newRayFlag = loadRayleighData->GetNewBoolValue(newValue); 128 XrayFluoAction->SetRayleighFlag(newRayFla 130 XrayFluoAction->SetRayleighFlag(newRayFlag); 129 } 131 } 130 } 132 } 131 133 132 //....oooOO0OOooo........oooOO0OOooo........oo 134 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 133 135 134 136