Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer << 3 // * DISCLAIMER * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th << 5 // * The following disclaimer summarizes all the specific disclaimers * 6 // * the Geant4 Collaboration. It is provided << 6 // * of contributors to this software. The specific disclaimers,which * 7 // * conditions of the Geant4 Software License << 7 // * govern, are listed with their locations in: * 8 // * LICENSE and available at http://cern.ch/ << 8 // * http://cern.ch/geant4/license * 9 // * include a list of copyright holders. << 10 // * 9 // * * 11 // * Neither the authors of this software syst 10 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 11 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 12 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 13 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file << 14 // * use. * 16 // * for the full disclaimer and the limitatio << 17 // * 15 // * * 18 // * This code implementation is the result << 16 // * This code implementation is the intellectual property of the * 19 // * technical work of the GEANT4 collaboratio << 17 // * GEANT4 collaboration. * 20 // * By using, copying, modifying or distri << 18 // * By copying, distributing or modifying the Program (or any work * 21 // * any work based on the software) you ag << 19 // * based on the Program) you indicate your acceptance of this * 22 // * use in resulting scientific publicati << 20 // * statement, and all its terms. * 23 // * acceptance of all terms of the Geant4 Sof << 24 // ******************************************* 21 // ******************************************************************** 25 // 22 // 26 // 23 // >> 24 // $Id: XrayFluoMercuryPrimarygeneratorMessenger.cc >> 25 // GEANT4 tag $Name: 27 // 26 // 28 // Author: Alfonso Mantero (Alfonso.mantero@ge 27 // Author: Alfonso Mantero (Alfonso.mantero@ge.infn.it) 29 // 28 // 30 // History: 29 // History: 31 // ----------- 30 // ----------- 32 // 19 Sep 2003 Alfonso Mantero created 31 // 19 Sep 2003 Alfonso Mantero created 33 // 32 // 34 // ------------------------------------------- 33 // ------------------------------------------------------------------- 35 34 36 #include "XrayFluoMercuryPrimaryGeneratorMesse 35 #include "XrayFluoMercuryPrimaryGeneratorMessenger.hh" 37 #include "XrayFluoMercuryPrimaryGeneratorActio 36 #include "XrayFluoMercuryPrimaryGeneratorAction.hh" 38 #include "G4UIcmdWithAString.hh" 37 #include "G4UIcmdWithAString.hh" 39 #include "G4UIcmdWithABool.hh" 38 #include "G4UIcmdWithABool.hh" 40 39 41 //....oooOO0OOooo........oooOO0OOooo........oo 40 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 42 41 43 XrayFluoMercuryPrimaryGeneratorMessenger::Xray 42 XrayFluoMercuryPrimaryGeneratorMessenger::XrayFluoMercuryPrimaryGeneratorMessenger(XrayFluoMercuryPrimaryGeneratorAction* XrayFluoGun) 44 :XrayFluoAction(XrayFluoGun) 43 :XrayFluoAction(XrayFluoGun) 45 { 44 { 46 spectrum = new G4UIcmdWithAString("/gun/spec 45 spectrum = new G4UIcmdWithAString("/gun/spectrum",this); 47 spectrum->SetGuidance("Shoot the incident pa 46 spectrum->SetGuidance("Shoot the incident particle with a certain energy spectrum."); 48 spectrum->SetGuidance(" Choice : on(default 47 spectrum->SetGuidance(" Choice : on(default), off"); 49 spectrum->SetParameterName("choice",true); 48 spectrum->SetParameterName("choice",true); 50 spectrum->SetDefaultValue("on"); 49 spectrum->SetDefaultValue("on"); 51 spectrum->SetCandidates("on off"); 50 spectrum->SetCandidates("on off"); 52 spectrum->AvailableForStates(G4State_PreInit 51 spectrum->AvailableForStates(G4State_PreInit,G4State_Idle); 53 52 54 globalCmd = new G4UIcmdWithABool("/gun/globa 53 globalCmd = new G4UIcmdWithABool("/gun/globalIllumunation",this); 55 globalCmd->SetGuidance("Illuminate the entir 54 globalCmd->SetGuidance("Illuminate the entire Mercury globe, not only the area seen by the optics"); 56 globalCmd->SetGuidance("Choice : true, 1, fa 55 globalCmd->SetGuidance("Choice : true, 1, false, 0"); 57 globalCmd->SetParameterName("illuminaton",tr 56 globalCmd->SetParameterName("illuminaton",true); 58 globalCmd->SetDefaultValue("false"); 57 globalCmd->SetDefaultValue("false"); 59 globalCmd->AvailableForStates(G4State_PreIni 58 globalCmd->AvailableForStates(G4State_PreInit,G4State_Idle); 60 59 61 G4cout << "XrayFluoMercuryPrimaryGeneratorMe 60 G4cout << "XrayFluoMercuryPrimaryGeneratorMessenger created" << G4endl; 62 61 63 } 62 } 64 63 65 //....oooOO0OOooo........oooOO0OOooo........oo 64 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 66 65 67 XrayFluoMercuryPrimaryGeneratorMessenger::~Xra 66 XrayFluoMercuryPrimaryGeneratorMessenger::~XrayFluoMercuryPrimaryGeneratorMessenger() 68 { 67 { 69 delete spectrum; 68 delete spectrum; 70 delete globalCmd; 69 delete globalCmd; 71 70 72 G4cout << "XrayFluoMercuryPrimaryGeneratorMe 71 G4cout << "XrayFluoMercuryPrimaryGeneratorMessenger deleted" << G4endl; 73 72 74 } 73 } 75 74 76 //....oooOO0OOooo........oooOO0OOooo........oo 75 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 77 76 78 void XrayFluoMercuryPrimaryGeneratorMessenger: 77 void XrayFluoMercuryPrimaryGeneratorMessenger::SetNewValue(G4UIcommand * command,G4String newValue) 79 { 78 { 80 79 81 if( command == spectrum ) 80 if( command == spectrum ) 82 { XrayFluoAction->SetSpectrum(newValue);} 81 { XrayFluoAction->SetSpectrum(newValue);} 83 82 84 if( command == globalCmd ) 83 if( command == globalCmd ) 85 { 84 { 86 G4bool newGlobalFlag = globalCmd->GetNew 85 G4bool newGlobalFlag = globalCmd->GetNewBoolValue(newValue); 87 XrayFluoAction->SetGlobalFlag(newGlobalF 86 XrayFluoAction->SetGlobalFlag(newGlobalFlag); 88 } 87 } 89 } 88 } 90 89 91 //....oooOO0OOooo........oooOO0OOooo........oo 90 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo.... 92 91 93 92