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 // G4GeneralParticleSourceMessenger class impl << 26 /////////////////////////////////////////////////////////////////////////////// >> 27 // >> 28 // MODULE: G4GeneralParticleSourceMessenger.cc >> 29 // >> 30 // Version: 2.0 >> 31 // Date: 5/02/04 >> 32 // Author: Fan Lei >> 33 // Organisation: QinetiQ ltd. >> 34 // Customer: ESA/ESTEC >> 35 // >> 36 /////////////////////////////////////////////////////////////////////////////// >> 37 // >> 38 // CHANGE HISTORY >> 39 // -------------- >> 40 // >> 41 // Version 2.0, 05/02/2004, Fan Lei, Created. >> 42 // After changes to version 1.1 as in Geant4 v6.0 >> 43 // - Mutilple particle source definition >> 44 // - Re-structured commands >> 45 // - old commands have been retained for backward compatibility, will be >> 46 // removed in the future. >> 47 // >> 48 /////////////////////////////////////////////////////////////////////////////// 27 // 49 // 28 // Author: Fan Lei, QinetiQ ltd. << 29 // Customer: ESA/ESTEC << 30 // Revisions: Andrew Green, Andrea Dotti << 31 // ------------------------------------------- << 32 << 33 #include "G4GeneralParticleSourceMessenger.hh" << 34 << 35 #include "G4PhysicalConstants.hh" << 36 #include "G4SystemOfUnits.hh" << 37 #include "G4Geantino.hh" 50 #include "G4Geantino.hh" 38 #include "G4ThreeVector.hh" 51 #include "G4ThreeVector.hh" 39 #include "G4ParticleTable.hh" 52 #include "G4ParticleTable.hh" 40 #include "G4IonTable.hh" << 41 #include "G4UIdirectory.hh" 53 #include "G4UIdirectory.hh" 42 #include "G4UIcmdWithoutParameter.hh" 54 #include "G4UIcmdWithoutParameter.hh" 43 #include "G4UIcmdWithAString.hh" 55 #include "G4UIcmdWithAString.hh" 44 #include "G4UIcmdWithADoubleAndUnit.hh" 56 #include "G4UIcmdWithADoubleAndUnit.hh" 45 #include "G4UIcmdWith3Vector.hh" 57 #include "G4UIcmdWith3Vector.hh" 46 #include "G4UIcmdWith3VectorAndUnit.hh" 58 #include "G4UIcmdWith3VectorAndUnit.hh" 47 #include "G4UIcmdWithAnInteger.hh" 59 #include "G4UIcmdWithAnInteger.hh" 48 #include "G4UIcmdWithADouble.hh" 60 #include "G4UIcmdWithADouble.hh" 49 #include "G4UIcmdWithABool.hh" 61 #include "G4UIcmdWithABool.hh" 50 #include "G4ios.hh" 62 #include "G4ios.hh" 51 63 52 #include "G4Tokenizer.hh" 64 #include "G4Tokenizer.hh" >> 65 #include "G4GeneralParticleSourceMessenger.hh" 53 #include "G4SingleParticleSource.hh" 66 #include "G4SingleParticleSource.hh" 54 #include "G4GeneralParticleSource.hh" 67 #include "G4GeneralParticleSource.hh" 55 68 56 #include "G4AutoLock.hh" << 69 /////////////////////////////////////////////////////////////////////////////// 57 << 58 namespace << 59 { << 60 G4Mutex creationM = G4MUTEX_INITIALIZER; << 61 G4GeneralParticleSourceMessenger* theInstanc << 62 } << 63 << 64 G4GeneralParticleSourceMessenger* << 65 G4GeneralParticleSourceMessenger::GetInstance( << 66 { << 67 G4AutoLock l(&creationM); << 68 if ( theInstance == nullptr ) << 69 theInstance = new G4GeneralParticleSourceM << 70 return theInstance; << 71 } << 72 << 73 void G4GeneralParticleSourceMessenger::Destroy << 74 { << 75 G4AutoLock l(&creationM); << 76 if ( theInstance != nullptr ) << 77 { << 78 delete theInstance; << 79 theInstance = nullptr; << 80 } << 81 } << 82 << 83 // ------------------------------------------- << 84 // 70 // 85 G4GeneralParticleSourceMessenger:: << 71 G4GeneralParticleSourceMessenger::G4GeneralParticleSourceMessenger 86 G4GeneralParticleSourceMessenger(G4GeneralPart << 72 (G4GeneralParticleSource *fPtclGun) 87 : fGPS(fPtclGun) << 73 : fGPS(fPtclGun),fShootIon(false) 88 { 74 { 89 // A.Dotti - 10th October 2014 << 90 // This messenger is special: it is instanti << 91 // in a thread). << 92 // The UI commands it defines should be exec << 93 // because they operate on shared resources << 94 // take effect BEFORE the threads do some wo << 95 // initialized). << 96 // To achieve this behavior we set to true a << 97 // data member. Since it makes no sense to h << 98 // of the messenger, we check that we actual << 99 // Note that the logic of implementing, in a << 100 // messenger is deleted/fated to the creator << 101 << 102 commandsShouldBeInMaster = true; << 103 << 104 particleTable = G4ParticleTable::GetParticle 75 particleTable = G4ParticleTable::GetParticleTable(); 105 histtype = "biasx"; 76 histtype = "biasx"; 106 77 107 // UI Commands only for master << 78 gpsDirectory = new G4UIdirectory("/gps/"); 108 // << 79 gpsDirectory->SetGuidance("General Paricle Source control commands."); 109 G4bool broadcast = false; << 80 // gpsDirectory->SetGuidance(" The first 9 commands are the same as in G4ParticleGun "); 110 gpsDirectory = new G4UIdirectory("/gps/",bro << 111 << 112 gpsDirectory->SetGuidance("General Particle << 113 81 114 // Now the commands for multiple sources << 82 // now the commands for mutiple sources 115 // << 116 sourceDirectory = new G4UIdirectory("/gps/so 83 sourceDirectory = new G4UIdirectory("/gps/source/"); 117 sourceDirectory->SetGuidance("Multiple sourc 84 sourceDirectory->SetGuidance("Multiple source control sub-directory"); 118 85 119 addsourceCmd = new G4UIcmdWithADouble("/gps/ 86 addsourceCmd = new G4UIcmdWithADouble("/gps/source/add",this); 120 addsourceCmd->SetGuidance("Add a new source << 87 addsourceCmd->SetGuidance("add a new source defintion to the particle gun with the specified intensity"); 121 addsourceCmd->SetGuidance(" with the specifi << 122 addsourceCmd->SetParameterName("addsource",f 88 addsourceCmd->SetParameterName("addsource",false,false); 123 addsourceCmd->SetRange("addsource > 0."); 89 addsourceCmd->SetRange("addsource > 0."); 124 90 125 listsourceCmd = new G4UIcmdWithoutParameter( 91 listsourceCmd = new G4UIcmdWithoutParameter("/gps/source/list",this); 126 listsourceCmd->SetGuidance("List the defined 92 listsourceCmd->SetGuidance("List the defined particle sources"); 127 93 128 clearsourceCmd = new G4UIcmdWithoutParameter 94 clearsourceCmd = new G4UIcmdWithoutParameter("/gps/source/clear",this); 129 clearsourceCmd->SetGuidance("Remove all the 95 clearsourceCmd->SetGuidance("Remove all the defined particle sources"); 130 96 131 getsourceCmd = new G4UIcmdWithoutParameter(" 97 getsourceCmd = new G4UIcmdWithoutParameter("/gps/source/show",this); 132 getsourceCmd->SetGuidance("Show the current 98 getsourceCmd->SetGuidance("Show the current source index and intensity"); 133 99 134 setsourceCmd = new G4UIcmdWithAnInteger("/gp 100 setsourceCmd = new G4UIcmdWithAnInteger("/gps/source/set",this); 135 setsourceCmd->SetGuidance("Set the indexed s << 101 setsourceCmd->SetGuidance("set the indexed source as the current one"); 136 setsourceCmd->SetGuidance(" so one can chang << 102 setsourceCmd->SetGuidance(" so one can change its source definition"); 137 setsourceCmd->SetParameterName("setsource",f 103 setsourceCmd->SetParameterName("setsource",false,false); 138 setsourceCmd->SetRange("setsource >= 0"); 104 setsourceCmd->SetRange("setsource >= 0"); 139 105 140 deletesourceCmd = new G4UIcmdWithAnInteger(" 106 deletesourceCmd = new G4UIcmdWithAnInteger("/gps/source/delete",this); 141 deletesourceCmd->SetGuidance("Delete the ind << 107 deletesourceCmd->SetGuidance("delete the indexed source from the list"); 142 deletesourceCmd->SetParameterName("deletesou 108 deletesourceCmd->SetParameterName("deletesource",false,false); 143 deletesourceCmd->SetRange("deletesource > 0" 109 deletesourceCmd->SetRange("deletesource > 0"); 144 110 145 setintensityCmd = new G4UIcmdWithADouble("/g 111 setintensityCmd = new G4UIcmdWithADouble("/gps/source/intensity",this); 146 setintensityCmd->SetGuidance("Reset the curr << 112 setintensityCmd->SetGuidance("reset the current source to the specified intensity"); 147 setintensityCmd->SetParameterName("setintens 113 setintensityCmd->SetParameterName("setintensity",false,false); 148 setintensityCmd->SetRange("setintensity > 0. 114 setintensityCmd->SetRange("setintensity > 0."); 149 115 150 multiplevertexCmd = new G4UIcmdWithABool("/g 116 multiplevertexCmd = new G4UIcmdWithABool("/gps/source/multiplevertex",this); 151 multiplevertexCmd->SetGuidance("True for sim << 117 multiplevertexCmd->SetGuidance("true for simulaneous generation mutiple vertex"); 152 multiplevertexCmd->SetGuidance(" Default is << 118 multiplevertexCmd->SetGuidance("Default is false"); 153 multiplevertexCmd->SetParameterName("multipl 119 multiplevertexCmd->SetParameterName("multiplevertex",true); 154 multiplevertexCmd->SetDefaultValue(false); 120 multiplevertexCmd->SetDefaultValue(false); 155 121 156 flatsamplingCmd = new G4UIcmdWithABool("/gps << 122 // below we reproduce commands awailable in G4Particle Gun 157 flatsamplingCmd->SetGuidance("True for apply << 158 flatsamplingCmd->SetGuidance("Default is fal << 159 flatsamplingCmd->SetParameterName("flatsampl << 160 flatsamplingCmd->SetDefaultValue(false); << 161 123 162 // Below we reproduce commands awailable in << 163 // << 164 listCmd = new G4UIcmdWithoutParameter("/gps/ 124 listCmd = new G4UIcmdWithoutParameter("/gps/List",this); 165 listCmd->SetGuidance("List available particl 125 listCmd->SetGuidance("List available particles."); 166 listCmd->SetGuidance(" Invoke G4ParticleTabl 126 listCmd->SetGuidance(" Invoke G4ParticleTable."); 167 127 168 particleCmd = new G4UIcmdWithAString("/gps/p 128 particleCmd = new G4UIcmdWithAString("/gps/particle",this); 169 particleCmd->SetGuidance("Set particle to be 129 particleCmd->SetGuidance("Set particle to be generated."); 170 particleCmd->SetGuidance(" (geantino is defa 130 particleCmd->SetGuidance(" (geantino is default)"); 171 particleCmd->SetGuidance(" (ion can be speci 131 particleCmd->SetGuidance(" (ion can be specified for shooting ions)"); 172 particleCmd->SetParameterName("particleName" 132 particleCmd->SetParameterName("particleName",true); 173 particleCmd->SetDefaultValue("geantino"); 133 particleCmd->SetDefaultValue("geantino"); 174 G4String candidateList; 134 G4String candidateList; 175 G4int nPtcl = particleTable->entries(); 135 G4int nPtcl = particleTable->entries(); 176 for(G4int i=0; i<nPtcl; ++i) << 136 for(G4int i=0;i<nPtcl;i++) 177 { 137 { 178 candidateList += particleTable->GetParticl 138 candidateList += particleTable->GetParticleName(i); 179 candidateList += " "; 139 candidateList += " "; 180 } 140 } 181 candidateList += "ion "; 141 candidateList += "ion "; 182 particleCmd->SetCandidates(candidateList); 142 particleCmd->SetCandidates(candidateList); 183 143 184 directionCmd = new G4UIcmdWith3Vector("/gps/ 144 directionCmd = new G4UIcmdWith3Vector("/gps/direction",this); 185 directionCmd->SetGuidance("Set momentum dire 145 directionCmd->SetGuidance("Set momentum direction."); 186 directionCmd->SetGuidance(" Direction needs << 146 directionCmd->SetGuidance("Direction needs not to be a unit vector."); 187 directionCmd->SetGuidance(" Angular distribu << 147 directionCmd->SetParameterName("Px","Py","Pz",true,true); 188 directionCmd->SetParameterName("Px","Py","Pz << 189 directionCmd->SetRange("Px != 0 || Py != 0 | 148 directionCmd->SetRange("Px != 0 || Py != 0 || Pz != 0"); 190 149 191 energyCmd = new G4UIcmdWithADoubleAndUnit("/ 150 energyCmd = new G4UIcmdWithADoubleAndUnit("/gps/energy",this); 192 energyCmd->SetGuidance("Set kinetic energy." 151 energyCmd->SetGuidance("Set kinetic energy."); 193 energyCmd->SetParameterName("Energy",false,f << 152 energyCmd->SetParameterName("Energy",true,true); 194 energyCmd->SetDefaultUnit("GeV"); 153 energyCmd->SetDefaultUnit("GeV"); 195 //energyCmd->SetUnitCategory("Energy"); 154 //energyCmd->SetUnitCategory("Energy"); 196 //energyCmd->SetUnitCandidates("eV keV MeV G 155 //energyCmd->SetUnitCandidates("eV keV MeV GeV TeV"); 197 156 198 positionCmd = new G4UIcmdWith3VectorAndUnit( 157 positionCmd = new G4UIcmdWith3VectorAndUnit("/gps/position",this); 199 positionCmd->SetGuidance("Set starting posit << 158 positionCmd->SetGuidance("Set starting position of the particle."); 200 positionCmd->SetGuidance(" Same effect as th << 159 positionCmd->SetParameterName("X","Y","Z",true,true); 201 positionCmd->SetParameterName("X","Y","Z",fa << 202 positionCmd->SetDefaultUnit("cm"); 160 positionCmd->SetDefaultUnit("cm"); 203 //positionCmd->SetUnitCategory("Length"); 161 //positionCmd->SetUnitCategory("Length"); 204 //positionCmd->SetUnitCandidates("microm mm 162 //positionCmd->SetUnitCandidates("microm mm cm m km"); 205 163 206 ionCmd = new G4UIcommand("/gps/ion",this); 164 ionCmd = new G4UIcommand("/gps/ion",this); 207 ionCmd->SetGuidance("Set properties of ion t 165 ionCmd->SetGuidance("Set properties of ion to be generated."); 208 ionCmd->SetGuidance("[usage] /gps/ion Z A Q 166 ionCmd->SetGuidance("[usage] /gps/ion Z A Q E"); 209 ionCmd->SetGuidance(" Z:(int) AtomicN 167 ionCmd->SetGuidance(" Z:(int) AtomicNumber"); 210 ionCmd->SetGuidance(" A:(int) AtomicM 168 ionCmd->SetGuidance(" A:(int) AtomicMass"); 211 ionCmd->SetGuidance(" Q:(int) Charge 169 ionCmd->SetGuidance(" Q:(int) Charge of Ion (in unit of e)"); 212 ionCmd->SetGuidance(" E:(double) Exci 170 ionCmd->SetGuidance(" E:(double) Excitation energy (in keV)"); 213 << 171 214 G4UIparameter* param; 172 G4UIparameter* param; 215 param = new G4UIparameter("Z",'i',false); 173 param = new G4UIparameter("Z",'i',false); 216 param->SetDefaultValue("1"); 174 param->SetDefaultValue("1"); 217 ionCmd->SetParameter(param); 175 ionCmd->SetParameter(param); 218 param = new G4UIparameter("A",'i',false); 176 param = new G4UIparameter("A",'i',false); 219 param->SetDefaultValue("1"); 177 param->SetDefaultValue("1"); 220 ionCmd->SetParameter(param); 178 ionCmd->SetParameter(param); 221 param = new G4UIparameter("Q",'i',true); 179 param = new G4UIparameter("Q",'i',true); 222 param->SetDefaultValue("0"); 180 param->SetDefaultValue("0"); 223 ionCmd->SetParameter(param); 181 ionCmd->SetParameter(param); 224 param = new G4UIparameter("E",'d',true); 182 param = new G4UIparameter("E",'d',true); 225 param->SetDefaultValue("0.0"); 183 param->SetDefaultValue("0.0"); 226 ionCmd->SetParameter(param); 184 ionCmd->SetParameter(param); 227 185 228 ionLvlCmd = new G4UIcommand("/gps/ionLvl",th << 229 ionLvlCmd->SetGuidance("Set properties of io << 230 ionLvlCmd->SetGuidance("[usage] /gps/ion Z A << 231 ionLvlCmd->SetGuidance(" Z:(int) Atom << 232 ionLvlCmd->SetGuidance(" A:(int) Atom << 233 ionLvlCmd->SetGuidance(" Q:(int) Char << 234 ionLvlCmd->SetGuidance(" Lvl:(int) Nu << 235 << 236 G4UIparameter* paramL; << 237 paramL = new G4UIparameter("Z",'i',false); << 238 paramL->SetDefaultValue("1"); << 239 ionLvlCmd->SetParameter(paramL); << 240 paramL = new G4UIparameter("A",'i',false); << 241 paramL->SetDefaultValue("1"); << 242 ionLvlCmd->SetParameter(paramL); << 243 paramL = new G4UIparameter("Q",'i',true); << 244 paramL->SetDefaultValue("0"); << 245 ionLvlCmd->SetParameter(paramL); << 246 paramL = new G4UIparameter("Lvl",'i',true); << 247 paramL->SetDefaultValue("0.0"); << 248 ionLvlCmd->SetParameter(paramL); << 249 186 250 timeCmd = new G4UIcmdWithADoubleAndUnit("/gp 187 timeCmd = new G4UIcmdWithADoubleAndUnit("/gps/time",this); 251 timeCmd->SetGuidance("Set initial time of th 188 timeCmd->SetGuidance("Set initial time of the particle."); 252 timeCmd->SetParameterName("t0",false,false); << 189 timeCmd->SetParameterName("t0",true,true); 253 timeCmd->SetDefaultUnit("ns"); 190 timeCmd->SetDefaultUnit("ns"); 254 //timeCmd->SetUnitCategory("Time"); 191 //timeCmd->SetUnitCategory("Time"); 255 //timeCmd->SetUnitCandidates("ns ms s"); 192 //timeCmd->SetUnitCandidates("ns ms s"); 256 193 257 polCmd = new G4UIcmdWith3Vector("/gps/polari 194 polCmd = new G4UIcmdWith3Vector("/gps/polarization",this); 258 polCmd->SetGuidance("Set polarization."); 195 polCmd->SetGuidance("Set polarization."); 259 polCmd->SetParameterName("Px","Py","Pz",fals << 196 polCmd->SetParameterName("Px","Py","Pz",true,true); 260 polCmd->SetRange("Px>=-1.&&Px<=1.&&Py>=-1.&& 197 polCmd->SetRange("Px>=-1.&&Px<=1.&&Py>=-1.&&Py<=1.&&Pz>=-1.&&Pz<=1."); 261 198 262 numberCmd = new G4UIcmdWithAnInteger("/gps/n 199 numberCmd = new G4UIcmdWithAnInteger("/gps/number",this); 263 numberCmd->SetGuidance("Set number of partic 200 numberCmd->SetGuidance("Set number of particles to be generated per vertex."); 264 numberCmd->SetParameterName("N",false,false) << 201 numberCmd->SetParameterName("N",true,true); 265 numberCmd->SetRange("N>0"); 202 numberCmd->SetRange("N>0"); 266 203 267 // Verbosity << 204 // verbosity 268 // << 269 verbosityCmd = new G4UIcmdWithAnInteger("/gp 205 verbosityCmd = new G4UIcmdWithAnInteger("/gps/verbose",this); 270 verbosityCmd->SetGuidance("Set Verbose level 206 verbosityCmd->SetGuidance("Set Verbose level for GPS"); 271 verbosityCmd->SetGuidance(" 0 : Silent"); 207 verbosityCmd->SetGuidance(" 0 : Silent"); 272 verbosityCmd->SetGuidance(" 1 : Limited info 208 verbosityCmd->SetGuidance(" 1 : Limited information"); 273 verbosityCmd->SetGuidance(" 2 : Detailed inf 209 verbosityCmd->SetGuidance(" 2 : Detailed information"); 274 verbosityCmd->SetParameterName("level",false 210 verbosityCmd->SetParameterName("level",false); 275 verbosityCmd->SetRange("level>=0 && level <= 211 verbosityCmd->SetRange("level>=0 && level <=2"); 276 212 277 volChkCmd = new G4UIcmdWithABool("/gps/check << 213 // now extended commands 278 volChkCmd->SetGuidance("Switch on/off the ch << 279 volChkCmd->SetGuidance("By default the check << 280 volChkCmd->SetGuidance("but the user has to << 281 volChkCmd->SetParameterName("switch",true,tr << 282 << 283 // Now extended commands << 284 // Positional ones: 214 // Positional ones: 285 // << 286 positionDirectory = new G4UIdirectory("/gps/ 215 positionDirectory = new G4UIdirectory("/gps/pos/"); 287 positionDirectory->SetGuidance("Positional c 216 positionDirectory->SetGuidance("Positional commands sub-directory"); 288 217 289 typeCmd1 = new G4UIcmdWithAString("/gps/pos/ 218 typeCmd1 = new G4UIcmdWithAString("/gps/pos/type",this); 290 typeCmd1->SetGuidance("Sets source distribut 219 typeCmd1->SetGuidance("Sets source distribution type."); 291 typeCmd1->SetGuidance("Either Point, Beam, P 220 typeCmd1->SetGuidance("Either Point, Beam, Plane, Surface or Volume"); 292 typeCmd1->SetParameterName("DisType",false,f << 221 typeCmd1->SetParameterName("DisType",true,true); 293 typeCmd1->SetDefaultValue("Point"); 222 typeCmd1->SetDefaultValue("Point"); 294 typeCmd1->SetCandidates("Point Beam Plane Su 223 typeCmd1->SetCandidates("Point Beam Plane Surface Volume"); 295 224 296 shapeCmd1 = new G4UIcmdWithAString("/gps/pos 225 shapeCmd1 = new G4UIcmdWithAString("/gps/pos/shape",this); 297 shapeCmd1->SetGuidance("Sets source shape fo 226 shapeCmd1->SetGuidance("Sets source shape for Plan, Surface or Volume type source."); 298 shapeCmd1->SetParameterName("Shape",false,fa << 227 shapeCmd1->SetParameterName("Shape",true,true); 299 shapeCmd1->SetDefaultValue("NULL"); 228 shapeCmd1->SetDefaultValue("NULL"); 300 shapeCmd1->SetCandidates("Circle Annulus Ell << 229 shapeCmd1->SetCandidates("Circle Annulus Ellipse Square Rectangle Sphere Ellipsoid Cylinder Para"); 301 230 302 centreCmd1 = new G4UIcmdWith3VectorAndUnit(" 231 centreCmd1 = new G4UIcmdWith3VectorAndUnit("/gps/pos/centre",this); 303 centreCmd1->SetGuidance("Set centre coordina 232 centreCmd1->SetGuidance("Set centre coordinates of source."); 304 centreCmd1->SetParameterName("X","Y","Z",fal << 233 centreCmd1->SetGuidance(" same effect as the /gps/position command"); >> 234 centreCmd1->SetParameterName("X","Y","Z",true,true); 305 centreCmd1->SetDefaultUnit("cm"); 235 centreCmd1->SetDefaultUnit("cm"); 306 // centreCmd1->SetUnitCandidates("micron mm << 236 centreCmd1->SetUnitCandidates("micron mm cm m km"); 307 237 308 posrot1Cmd1 = new G4UIcmdWith3Vector("/gps/p 238 posrot1Cmd1 = new G4UIcmdWith3Vector("/gps/pos/rot1",this); 309 posrot1Cmd1->SetGuidance("Set the 1st vector 239 posrot1Cmd1->SetGuidance("Set the 1st vector defining the rotation matrix'."); 310 posrot1Cmd1->SetGuidance("It does not need t 240 posrot1Cmd1->SetGuidance("It does not need to be a unit vector."); 311 posrot1Cmd1->SetParameterName("R1x","R1y","R << 241 posrot1Cmd1->SetParameterName("R1x","R1y","R1z",true,true); 312 posrot1Cmd1->SetRange("R1x != 0 || R1y != 0 242 posrot1Cmd1->SetRange("R1x != 0 || R1y != 0 || R1z != 0"); 313 243 314 posrot2Cmd1 = new G4UIcmdWith3Vector("/gps/p 244 posrot2Cmd1 = new G4UIcmdWith3Vector("/gps/pos/rot2",this); 315 posrot2Cmd1->SetGuidance("Set the 2nd vector 245 posrot2Cmd1->SetGuidance("Set the 2nd vector defining the rotation matrix'."); 316 posrot2Cmd1->SetGuidance("It does not need t 246 posrot2Cmd1->SetGuidance("It does not need to be a unit vector."); 317 posrot2Cmd1->SetParameterName("R2x","R2y","R << 247 posrot2Cmd1->SetParameterName("R2x","R2y","R2z",true,true); 318 posrot2Cmd1->SetRange("R2x != 0 || R2y != 0 248 posrot2Cmd1->SetRange("R2x != 0 || R2y != 0 || R2z != 0"); 319 249 320 halfxCmd1 = new G4UIcmdWithADoubleAndUnit("/ 250 halfxCmd1 = new G4UIcmdWithADoubleAndUnit("/gps/pos/halfx",this); 321 halfxCmd1->SetGuidance("Set x half length of 251 halfxCmd1->SetGuidance("Set x half length of source."); 322 halfxCmd1->SetParameterName("Halfx",false,fa << 252 halfxCmd1->SetParameterName("Halfx",true,true); 323 halfxCmd1->SetDefaultUnit("cm"); 253 halfxCmd1->SetDefaultUnit("cm"); 324 // halfxCmd1->SetUnitCandidates("micron mm c << 254 halfxCmd1->SetUnitCandidates("micron mm cm m km"); 325 255 326 halfyCmd1 = new G4UIcmdWithADoubleAndUnit("/ 256 halfyCmd1 = new G4UIcmdWithADoubleAndUnit("/gps/pos/halfy",this); 327 halfyCmd1->SetGuidance("Set y half length of 257 halfyCmd1->SetGuidance("Set y half length of source."); 328 halfyCmd1->SetParameterName("Halfy",false,fa << 258 halfyCmd1->SetParameterName("Halfy",true,true); 329 halfyCmd1->SetDefaultUnit("cm"); 259 halfyCmd1->SetDefaultUnit("cm"); 330 // halfyCmd1->SetUnitCandidates("micron mm c << 260 halfyCmd1->SetUnitCandidates("micron mm cm m km"); 331 261 332 halfzCmd1 = new G4UIcmdWithADoubleAndUnit("/ 262 halfzCmd1 = new G4UIcmdWithADoubleAndUnit("/gps/pos/halfz",this); 333 halfzCmd1->SetGuidance("Set z half length of 263 halfzCmd1->SetGuidance("Set z half length of source."); 334 halfzCmd1->SetParameterName("Halfz",false,fa << 264 halfzCmd1->SetParameterName("Halfz",true,true); 335 halfzCmd1->SetDefaultUnit("cm"); 265 halfzCmd1->SetDefaultUnit("cm"); 336 // halfzCmd1->SetUnitCandidates("micron mm c << 266 halfzCmd1->SetUnitCandidates("micron mm cm m km"); 337 267 338 radiusCmd1 = new G4UIcmdWithADoubleAndUnit(" 268 radiusCmd1 = new G4UIcmdWithADoubleAndUnit("/gps/pos/radius",this); 339 radiusCmd1->SetGuidance("Set radius of sourc 269 radiusCmd1->SetGuidance("Set radius of source."); 340 radiusCmd1->SetParameterName("Radius",false, << 270 radiusCmd1->SetParameterName("Radius",true,true); 341 radiusCmd1->SetDefaultUnit("cm"); 271 radiusCmd1->SetDefaultUnit("cm"); 342 // radiusCmd1->SetUnitCandidates("micron mm << 272 radiusCmd1->SetUnitCandidates("micron mm cm m km"); 343 273 344 radius0Cmd1 = new G4UIcmdWithADoubleAndUnit( 274 radius0Cmd1 = new G4UIcmdWithADoubleAndUnit("/gps/pos/inner_radius",this); 345 radius0Cmd1->SetGuidance("Set inner radius o 275 radius0Cmd1->SetGuidance("Set inner radius of source when required."); 346 radius0Cmd1->SetParameterName("Radius0",fals << 276 radius0Cmd1->SetParameterName("Radius0",true,true); 347 radius0Cmd1->SetDefaultUnit("cm"); 277 radius0Cmd1->SetDefaultUnit("cm"); 348 // radius0Cmd1->SetUnitCandidates("micron mm << 278 radius0Cmd1->SetUnitCandidates("micron mm cm m km"); 349 279 350 possigmarCmd1 = new G4UIcmdWithADoubleAndUni 280 possigmarCmd1 = new G4UIcmdWithADoubleAndUnit("/gps/pos/sigma_r",this); 351 possigmarCmd1->SetGuidance("Set standard dev 281 possigmarCmd1->SetGuidance("Set standard deviation in radial of the beam positional profile"); 352 possigmarCmd1->SetGuidance(" applicable to B 282 possigmarCmd1->SetGuidance(" applicable to Beam type source only"); 353 possigmarCmd1->SetParameterName("Sigmar",fal << 283 possigmarCmd1->SetParameterName("Sigmar",true,true); 354 possigmarCmd1->SetDefaultUnit("cm"); 284 possigmarCmd1->SetDefaultUnit("cm"); 355 // possigmarCmd1->SetUnitCandidates("micron << 285 possigmarCmd1->SetUnitCandidates("micron mm cm m km"); 356 286 357 possigmaxCmd1 = new G4UIcmdWithADoubleAndUni 287 possigmaxCmd1 = new G4UIcmdWithADoubleAndUnit("/gps/pos/sigma_x",this); 358 possigmaxCmd1->SetGuidance("Set standard dev 288 possigmaxCmd1->SetGuidance("Set standard deviation of beam positional profile in x-dir"); 359 possigmaxCmd1->SetGuidance(" applicable to B 289 possigmaxCmd1->SetGuidance(" applicable to Beam type source only"); 360 possigmaxCmd1->SetParameterName("Sigmax",fal << 290 possigmaxCmd1->SetParameterName("Sigmax",true,true); 361 possigmaxCmd1->SetDefaultUnit("cm"); 291 possigmaxCmd1->SetDefaultUnit("cm"); 362 // possigmaxCmd1->SetUnitCandidates("micron << 292 possigmaxCmd1->SetUnitCandidates("micron mm cm m km"); 363 293 364 possigmayCmd1 = new G4UIcmdWithADoubleAndUni 294 possigmayCmd1 = new G4UIcmdWithADoubleAndUnit("/gps/pos/sigma_y",this); 365 possigmayCmd1->SetGuidance("Set standard dev 295 possigmayCmd1->SetGuidance("Set standard deviation of beam positional profile in y-dir"); 366 possigmayCmd1->SetGuidance(" applicable to B 296 possigmayCmd1->SetGuidance(" applicable to Beam type source only"); 367 possigmayCmd1->SetParameterName("Sigmay",fal << 297 possigmayCmd1->SetParameterName("Sigmay",true,true); 368 possigmayCmd1->SetDefaultUnit("cm"); 298 possigmayCmd1->SetDefaultUnit("cm"); 369 // possigmayCmd1->SetUnitCandidates("micron << 299 possigmayCmd1->SetUnitCandidates("micron mm cm m km"); 370 300 371 paralpCmd1 = new G4UIcmdWithADoubleAndUnit(" 301 paralpCmd1 = new G4UIcmdWithADoubleAndUnit("/gps/pos/paralp",this); 372 paralpCmd1->SetGuidance("Angle from y-axis o 302 paralpCmd1->SetGuidance("Angle from y-axis of y' in Para"); 373 paralpCmd1->SetParameterName("paralp",false, << 303 paralpCmd1->SetParameterName("paralp",true,true); 374 paralpCmd1->SetDefaultUnit("rad"); 304 paralpCmd1->SetDefaultUnit("rad"); 375 // paralpCmd1->SetUnitCandidates("rad deg"); << 305 paralpCmd1->SetUnitCandidates("rad deg"); 376 306 377 partheCmd1 = new G4UIcmdWithADoubleAndUnit(" 307 partheCmd1 = new G4UIcmdWithADoubleAndUnit("/gps/pos/parthe",this); 378 partheCmd1->SetGuidance("Polar angle through 308 partheCmd1->SetGuidance("Polar angle through centres of z faces"); 379 partheCmd1->SetParameterName("parthe",false, << 309 partheCmd1->SetParameterName("parthe",true,true); 380 partheCmd1->SetDefaultUnit("rad"); 310 partheCmd1->SetDefaultUnit("rad"); 381 // partheCmd1->SetUnitCandidates("rad deg"); << 311 partheCmd1->SetUnitCandidates("rad deg"); 382 312 383 parphiCmd1 = new G4UIcmdWithADoubleAndUnit(" 313 parphiCmd1 = new G4UIcmdWithADoubleAndUnit("/gps/pos/parphi",this); 384 parphiCmd1->SetGuidance("Azimuth angle throu 314 parphiCmd1->SetGuidance("Azimuth angle through centres of z faces"); 385 parphiCmd1->SetParameterName("parphi",false, << 315 parphiCmd1->SetParameterName("parphi",true,true); 386 parphiCmd1->SetDefaultUnit("rad"); 316 parphiCmd1->SetDefaultUnit("rad"); 387 // parphiCmd1->SetUnitCandidates("rad deg"); << 317 parphiCmd1->SetUnitCandidates("rad deg"); 388 318 389 confineCmd1 = new G4UIcmdWithAString("/gps/p 319 confineCmd1 = new G4UIcmdWithAString("/gps/pos/confine",this); 390 confineCmd1->SetGuidance("Confine source to 320 confineCmd1->SetGuidance("Confine source to volume (NULL to unset)."); 391 confineCmd1->SetGuidance(" Usage: confine Vo << 321 confineCmd1->SetGuidance("usage: confine VolName"); 392 confineCmd1->SetParameterName("VolName",fals << 322 confineCmd1->SetParameterName("VolName",true,true); 393 confineCmd1->SetDefaultValue("NULL"); 323 confineCmd1->SetDefaultValue("NULL"); 394 324 >> 325 // old implementations >> 326 typeCmd = new G4UIcmdWithAString("/gps/type",this); >> 327 typeCmd->SetGuidance("Sets source distribution type. (obsolete!)"); >> 328 typeCmd->SetGuidance("Either Point, Beam, Plane, Surface or Volume"); >> 329 typeCmd->SetParameterName("DisType",true,true); >> 330 typeCmd->SetDefaultValue("Point"); >> 331 typeCmd->SetCandidates("Point Beam Plane Surface Volume"); >> 332 >> 333 shapeCmd = new G4UIcmdWithAString("/gps/shape",this); >> 334 shapeCmd->SetGuidance("Sets source shape type.(obsolete!)"); >> 335 shapeCmd->SetParameterName("Shape",true,true); >> 336 shapeCmd->SetDefaultValue("NULL"); >> 337 shapeCmd->SetCandidates("Circle Annulus Ellipse Square Rectangle Sphere Ellipsoid Cylinder Para"); >> 338 >> 339 centreCmd = new G4UIcmdWith3VectorAndUnit("/gps/centre",this); >> 340 centreCmd->SetGuidance("Set centre coordinates of source.(obsolete!)"); >> 341 centreCmd->SetParameterName("X","Y","Z",true,true); >> 342 centreCmd->SetDefaultUnit("cm"); >> 343 centreCmd->SetUnitCandidates("micron mm cm m km"); >> 344 >> 345 posrot1Cmd = new G4UIcmdWith3Vector("/gps/posrot1",this); >> 346 posrot1Cmd->SetGuidance("Set rotation matrix of x'.(obsolete!)"); >> 347 posrot1Cmd->SetGuidance("Posrot1 does not need to be a unit vector."); >> 348 posrot1Cmd->SetParameterName("R1x","R1y","R1z",true,true); >> 349 posrot1Cmd->SetRange("R1x != 0 || R1y != 0 || R1z != 0"); >> 350 >> 351 posrot2Cmd = new G4UIcmdWith3Vector("/gps/posrot2",this); >> 352 posrot2Cmd->SetGuidance("Set rotation matrix of y'.(obsolete!)"); >> 353 posrot2Cmd->SetGuidance("Posrot2 does not need to be a unit vector."); >> 354 posrot2Cmd->SetParameterName("R2x","R2y","R2z",true,true); >> 355 posrot2Cmd->SetRange("R2x != 0 || R2y != 0 || R2z != 0"); >> 356 >> 357 halfxCmd = new G4UIcmdWithADoubleAndUnit("/gps/halfx",this); >> 358 halfxCmd->SetGuidance("Set x half length of source.(obsolete!)"); >> 359 halfxCmd->SetParameterName("Halfx",true,true); >> 360 halfxCmd->SetDefaultUnit("cm"); >> 361 halfxCmd->SetUnitCandidates("micron mm cm m km"); >> 362 >> 363 halfyCmd = new G4UIcmdWithADoubleAndUnit("/gps/halfy",this); >> 364 halfyCmd->SetGuidance("Set y half length of source.(obsolete!)"); >> 365 halfyCmd->SetParameterName("Halfy",true,true); >> 366 halfyCmd->SetDefaultUnit("cm"); >> 367 halfyCmd->SetUnitCandidates("micron mm cm m km"); >> 368 >> 369 halfzCmd = new G4UIcmdWithADoubleAndUnit("/gps/halfz",this); >> 370 halfzCmd->SetGuidance("Set z half length of source.(obsolete!)"); >> 371 halfzCmd->SetParameterName("Halfz",true,true); >> 372 halfzCmd->SetDefaultUnit("cm"); >> 373 halfzCmd->SetUnitCandidates("micron mm cm m km"); >> 374 >> 375 radiusCmd = new G4UIcmdWithADoubleAndUnit("/gps/radius",this); >> 376 radiusCmd->SetGuidance("Set radius of source.(obsolete!)"); >> 377 radiusCmd->SetParameterName("Radius",true,true); >> 378 radiusCmd->SetDefaultUnit("cm"); >> 379 radiusCmd->SetUnitCandidates("micron mm cm m km"); >> 380 >> 381 radius0Cmd = new G4UIcmdWithADoubleAndUnit("/gps/radius0",this); >> 382 radius0Cmd->SetGuidance("Set inner radius of source.(obsolete!)"); >> 383 radius0Cmd->SetParameterName("Radius0",true,true); >> 384 radius0Cmd->SetDefaultUnit("cm"); >> 385 radius0Cmd->SetUnitCandidates("micron mm cm m km"); >> 386 >> 387 possigmarCmd = new G4UIcmdWithADoubleAndUnit("/gps/sigmaposr",this); >> 388 possigmarCmd->SetGuidance("Set standard deviation of beam position in radial(obsolete!)"); >> 389 possigmarCmd->SetParameterName("Sigmar",true,true); >> 390 possigmarCmd->SetDefaultUnit("cm"); >> 391 possigmarCmd->SetUnitCandidates("micron mm cm m km"); >> 392 >> 393 possigmaxCmd = new G4UIcmdWithADoubleAndUnit("/gps/sigmaposx",this); >> 394 possigmaxCmd->SetGuidance("Set standard deviation of beam position in x-dir(obsolete!)"); >> 395 possigmaxCmd->SetParameterName("Sigmax",true,true); >> 396 possigmaxCmd->SetDefaultUnit("cm"); >> 397 possigmaxCmd->SetUnitCandidates("micron mm cm m km"); >> 398 >> 399 possigmayCmd = new G4UIcmdWithADoubleAndUnit("/gps/sigmaposy",this); >> 400 possigmayCmd->SetGuidance("Set standard deviation of beam position in y-dir(obsolete!)"); >> 401 possigmayCmd->SetParameterName("Sigmay",true,true); >> 402 possigmayCmd->SetDefaultUnit("cm"); >> 403 possigmayCmd->SetUnitCandidates("micron mm cm m km"); >> 404 >> 405 paralpCmd = new G4UIcmdWithADoubleAndUnit("/gps/paralp",this); >> 406 paralpCmd->SetGuidance("Angle from y-axis of y' in Para(obsolete!)"); >> 407 paralpCmd->SetParameterName("paralp",true,true); >> 408 paralpCmd->SetDefaultUnit("rad"); >> 409 paralpCmd->SetUnitCandidates("rad deg"); >> 410 >> 411 partheCmd = new G4UIcmdWithADoubleAndUnit("/gps/parthe",this); >> 412 partheCmd->SetGuidance("Polar angle through centres of z faces(obsolete!)"); >> 413 partheCmd->SetParameterName("parthe",true,true); >> 414 partheCmd->SetDefaultUnit("rad"); >> 415 partheCmd->SetUnitCandidates("rad deg"); >> 416 >> 417 parphiCmd = new G4UIcmdWithADoubleAndUnit("/gps/parphi",this); >> 418 parphiCmd->SetGuidance("Azimuth angle through centres of z faces(obsolete!)"); >> 419 parphiCmd->SetParameterName("parphi",true,true); >> 420 parphiCmd->SetDefaultUnit("rad"); >> 421 parphiCmd->SetUnitCandidates("rad deg"); >> 422 >> 423 confineCmd = new G4UIcmdWithAString("/gps/confine",this); >> 424 confineCmd->SetGuidance("Confine source to volume (NULL to unset)(obsolete!) ."); >> 425 confineCmd->SetGuidance("usage: confine VolName"); >> 426 confineCmd->SetParameterName("VolName",true,true); >> 427 confineCmd->SetDefaultValue("NULL"); >> 428 395 // Angular distribution commands 429 // Angular distribution commands 396 // << 397 angularDirectory = new G4UIdirectory("/gps/a 430 angularDirectory = new G4UIdirectory("/gps/ang/"); 398 angularDirectory->SetGuidance("Angular comma 431 angularDirectory->SetGuidance("Angular commands sub-directory"); 399 432 400 angtypeCmd1 = new G4UIcmdWithAString("/gps/a 433 angtypeCmd1 = new G4UIcmdWithAString("/gps/ang/type",this); 401 angtypeCmd1->SetGuidance("Sets angular sourc 434 angtypeCmd1->SetGuidance("Sets angular source distribution type"); 402 angtypeCmd1->SetGuidance(" Possible variable << 435 angtypeCmd1->SetGuidance("Possible variables are: iso, cos, planar, beam1d, beam2d, focused or user"); 403 angtypeCmd1->SetParameterName("AngDis",false << 436 angtypeCmd1->SetParameterName("AngDis",true,true); 404 angtypeCmd1->SetDefaultValue("iso"); 437 angtypeCmd1->SetDefaultValue("iso"); 405 angtypeCmd1->SetCandidates("iso cos planar b 438 angtypeCmd1->SetCandidates("iso cos planar beam1d beam2d focused user"); 406 439 407 angrot1Cmd1 = new G4UIcmdWith3Vector("/gps/a 440 angrot1Cmd1 = new G4UIcmdWith3Vector("/gps/ang/rot1",this); 408 angrot1Cmd1->SetGuidance("Sets the 1st vecto 441 angrot1Cmd1->SetGuidance("Sets the 1st vector for angular distribution rotation matrix"); 409 angrot1Cmd1->SetGuidance(" Need not be a uni << 442 angrot1Cmd1->SetGuidance("Need not be a unit vector"); 410 angrot1Cmd1->SetParameterName("AR1x","AR1y", << 443 angrot1Cmd1->SetParameterName("AR1x","AR1y","AR1z",true,true); 411 angrot1Cmd1->SetRange("AR1x != 0 || AR1y != 444 angrot1Cmd1->SetRange("AR1x != 0 || AR1y != 0 || AR1z != 0"); 412 445 413 angrot2Cmd1 = new G4UIcmdWith3Vector("/gps/a 446 angrot2Cmd1 = new G4UIcmdWith3Vector("/gps/ang/rot2",this); 414 angrot2Cmd1->SetGuidance("Sets the 2nd vecto 447 angrot2Cmd1->SetGuidance("Sets the 2nd vector for angular distribution rotation matrix"); 415 angrot2Cmd1->SetGuidance(" Need not be a uni << 448 angrot2Cmd1->SetGuidance("Need not be a unit vector"); 416 angrot2Cmd1->SetParameterName("AR2x","AR2y", << 449 angrot2Cmd1->SetParameterName("AR2x","AR2y","AR2z",true,true); 417 angrot2Cmd1->SetRange("AR2x != 0 || AR2y != 450 angrot2Cmd1->SetRange("AR2x != 0 || AR2y != 0 || AR2z != 0"); 418 451 419 minthetaCmd1 = new G4UIcmdWithADoubleAndUnit 452 minthetaCmd1 = new G4UIcmdWithADoubleAndUnit("/gps/ang/mintheta",this); 420 minthetaCmd1->SetGuidance("Set minimum theta 453 minthetaCmd1->SetGuidance("Set minimum theta"); 421 minthetaCmd1->SetParameterName("MinTheta",tr << 454 minthetaCmd1->SetParameterName("MinTheta",true,true); 422 minthetaCmd1->SetDefaultValue(0.); 455 minthetaCmd1->SetDefaultValue(0.); 423 minthetaCmd1->SetDefaultUnit("rad"); 456 minthetaCmd1->SetDefaultUnit("rad"); 424 // minthetaCmd1->SetUnitCandidates("rad deg" << 457 minthetaCmd1->SetUnitCandidates("rad deg"); 425 458 426 maxthetaCmd1 = new G4UIcmdWithADoubleAndUnit 459 maxthetaCmd1 = new G4UIcmdWithADoubleAndUnit("/gps/ang/maxtheta",this); 427 maxthetaCmd1->SetGuidance("Set maximum theta 460 maxthetaCmd1->SetGuidance("Set maximum theta"); 428 maxthetaCmd1->SetParameterName("MaxTheta",tr << 461 maxthetaCmd1->SetParameterName("MaxTheta",true,true); 429 maxthetaCmd1->SetDefaultValue(pi); 462 maxthetaCmd1->SetDefaultValue(pi); 430 maxthetaCmd1->SetDefaultUnit("rad"); 463 maxthetaCmd1->SetDefaultUnit("rad"); 431 // maxthetaCmd1->SetUnitCandidates("rad deg" << 464 maxthetaCmd1->SetUnitCandidates("rad deg"); 432 465 433 minphiCmd1 = new G4UIcmdWithADoubleAndUnit(" 466 minphiCmd1 = new G4UIcmdWithADoubleAndUnit("/gps/ang/minphi",this); 434 minphiCmd1->SetGuidance("Set minimum phi"); 467 minphiCmd1->SetGuidance("Set minimum phi"); 435 minphiCmd1->SetParameterName("MinPhi",true,f << 468 minphiCmd1->SetParameterName("MinPhi",true,true); 436 minphiCmd1->SetDefaultValue(0.); << 437 minphiCmd1->SetDefaultUnit("rad"); 469 minphiCmd1->SetDefaultUnit("rad"); 438 // minphiCmd1->SetUnitCandidates("rad deg"); << 470 minphiCmd1->SetUnitCandidates("rad deg"); 439 471 440 maxphiCmd1 = new G4UIcmdWithADoubleAndUnit(" 472 maxphiCmd1 = new G4UIcmdWithADoubleAndUnit("/gps/ang/maxphi",this); 441 maxphiCmd1->SetGuidance("Set maximum phi"); 473 maxphiCmd1->SetGuidance("Set maximum phi"); 442 maxphiCmd1->SetParameterName("MaxPhi",true,f << 474 maxphiCmd1->SetParameterName("MaxPhi",true,true); 443 maxphiCmd1->SetDefaultValue(2.*pi); << 475 maxphiCmd1->SetDefaultValue(pi); 444 maxphiCmd1->SetDefaultUnit("rad"); 476 maxphiCmd1->SetDefaultUnit("rad"); 445 // maxphiCmd1->SetUnitCandidates("rad deg"); << 477 maxphiCmd1->SetUnitCandidates("rad deg"); 446 478 447 angsigmarCmd1 = new G4UIcmdWithADoubleAndUni 479 angsigmarCmd1 = new G4UIcmdWithADoubleAndUnit("/gps/ang/sigma_r",this); 448 angsigmarCmd1->SetGuidance("Set standard dev 480 angsigmarCmd1->SetGuidance("Set standard deviation in direction for 1D beam."); 449 angsigmarCmd1->SetParameterName("Sigmara",fa << 481 angsigmarCmd1->SetParameterName("Sigmara",true,true); 450 angsigmarCmd1->SetDefaultUnit("rad"); 482 angsigmarCmd1->SetDefaultUnit("rad"); 451 // angsigmarCmd1->SetUnitCandidates("rad deg << 483 angsigmarCmd1->SetUnitCandidates("rad deg"); 452 484 453 angsigmaxCmd1 = new G4UIcmdWithADoubleAndUni 485 angsigmaxCmd1 = new G4UIcmdWithADoubleAndUnit("/gps/ang/sigma_x",this); 454 angsigmaxCmd1->SetGuidance("Set standard dev 486 angsigmaxCmd1->SetGuidance("Set standard deviation in direction in x-direc. for 2D beam"); 455 angsigmaxCmd1->SetParameterName("Sigmaxa",fa << 487 angsigmaxCmd1->SetParameterName("Sigmaxa",true,true); 456 angsigmaxCmd1->SetDefaultUnit("rad"); 488 angsigmaxCmd1->SetDefaultUnit("rad"); 457 // angsigmaxCmd1->SetUnitCandidates("rad deg << 489 angsigmaxCmd1->SetUnitCandidates("rad deg"); 458 490 459 angsigmayCmd1 = new G4UIcmdWithADoubleAndUni 491 angsigmayCmd1 = new G4UIcmdWithADoubleAndUnit("/gps/ang/sigma_y",this); 460 angsigmayCmd1->SetGuidance("Set standard dev 492 angsigmayCmd1->SetGuidance("Set standard deviation in direction in y-direc. for 2D beam"); 461 angsigmayCmd1->SetParameterName("Sigmaya",fa << 493 angsigmayCmd1->SetParameterName("Sigmaya",true,true); 462 angsigmayCmd1->SetDefaultUnit("rad"); 494 angsigmayCmd1->SetDefaultUnit("rad"); 463 // angsigmayCmd1->SetUnitCandidates("rad deg << 495 angsigmayCmd1->SetUnitCandidates("rad deg"); 464 496 465 angfocusCmd = new G4UIcmdWith3VectorAndUnit( 497 angfocusCmd = new G4UIcmdWith3VectorAndUnit("/gps/ang/focuspoint",this); 466 angfocusCmd->SetGuidance("Set the focusing p 498 angfocusCmd->SetGuidance("Set the focusing point for the beam"); 467 angfocusCmd->SetParameterName("x","y","z",fa << 499 angfocusCmd->SetParameterName("x","y","z",true,true); 468 angfocusCmd->SetDefaultUnit("cm"); 500 angfocusCmd->SetDefaultUnit("cm"); 469 // angfocusCmd->SetUnitCandidates("micron mm << 501 angfocusCmd->SetUnitCandidates("micron mm cm m km"); 470 502 471 useuserangaxisCmd1 = new G4UIcmdWithABool("/ 503 useuserangaxisCmd1 = new G4UIcmdWithABool("/gps/ang/user_coor",this); 472 useuserangaxisCmd1->SetGuidance("True for us << 504 useuserangaxisCmd1->SetGuidance("true for using user defined angular co-ordinates"); 473 useuserangaxisCmd1->SetGuidance(" Default is << 505 useuserangaxisCmd1->SetGuidance("Default is false"); 474 useuserangaxisCmd1->SetParameterName("useuse 506 useuserangaxisCmd1->SetParameterName("useuserangaxis",true); 475 useuserangaxisCmd1->SetDefaultValue(false); 507 useuserangaxisCmd1->SetDefaultValue(false); 476 508 477 surfnormCmd1 = new G4UIcmdWithABool("/gps/an 509 surfnormCmd1 = new G4UIcmdWithABool("/gps/ang/surfnorm",this); 478 surfnormCmd1->SetGuidance("Makes a user-defi 510 surfnormCmd1->SetGuidance("Makes a user-defined distribution with respect to surface normals rather than x,y,z axes."); 479 surfnormCmd1->SetGuidance(" Default is false << 511 surfnormCmd1->SetGuidance("Default is false"); 480 surfnormCmd1->SetParameterName("surfnorm",tr 512 surfnormCmd1->SetParameterName("surfnorm",true); 481 surfnormCmd1->SetDefaultValue(false); 513 surfnormCmd1->SetDefaultValue(false); 482 514 >> 515 // old ones >> 516 angtypeCmd = new G4UIcmdWithAString("/gps/angtype",this); >> 517 angtypeCmd->SetGuidance("Sets angular source distribution type (obsolete!)"); >> 518 angtypeCmd->SetGuidance("Possible variables are: iso, cos planar beam1d beam2d or user"); >> 519 angtypeCmd->SetParameterName("AngDis",true,true); >> 520 angtypeCmd->SetDefaultValue("iso"); >> 521 angtypeCmd->SetCandidates("iso cos planar beam1d beam2d user"); >> 522 >> 523 angrot1Cmd = new G4UIcmdWith3Vector("/gps/angrot1",this); >> 524 angrot1Cmd->SetGuidance("Sets the x' vector for angular distribution(obsolete!) "); >> 525 angrot1Cmd->SetGuidance("Need not be a unit vector"); >> 526 angrot1Cmd->SetParameterName("AR1x","AR1y","AR1z",true,true); >> 527 angrot1Cmd->SetRange("AR1x != 0 || AR1y != 0 || AR1z != 0"); >> 528 >> 529 angrot2Cmd = new G4UIcmdWith3Vector("/gps/angrot2",this); >> 530 angrot2Cmd->SetGuidance("Sets the y' vector for angular distribution (obsolete!)"); >> 531 angrot2Cmd->SetGuidance("Need not be a unit vector"); >> 532 angrot2Cmd->SetParameterName("AR2x","AR2y","AR2z",true,true); >> 533 angrot2Cmd->SetRange("AR2x != 0 || AR2y != 0 || AR2z != 0"); >> 534 >> 535 minthetaCmd = new G4UIcmdWithADoubleAndUnit("/gps/mintheta",this); >> 536 minthetaCmd->SetGuidance("Set minimum theta (obsolete!)"); >> 537 minthetaCmd->SetParameterName("MinTheta",true,true); >> 538 minthetaCmd->SetDefaultUnit("rad"); >> 539 minthetaCmd->SetUnitCandidates("rad deg"); >> 540 >> 541 maxthetaCmd = new G4UIcmdWithADoubleAndUnit("/gps/maxtheta",this); >> 542 maxthetaCmd->SetGuidance("Set maximum theta (obsolete!)"); >> 543 maxthetaCmd->SetParameterName("MaxTheta",true,true); >> 544 maxthetaCmd->SetDefaultValue(3.1416); >> 545 maxthetaCmd->SetDefaultUnit("rad"); >> 546 maxthetaCmd->SetUnitCandidates("rad deg"); >> 547 >> 548 minphiCmd = new G4UIcmdWithADoubleAndUnit("/gps/minphi",this); >> 549 minphiCmd->SetGuidance("Set minimum phi (obsolete!)"); >> 550 minphiCmd->SetParameterName("MinPhi",true,true); >> 551 minphiCmd->SetDefaultUnit("rad"); >> 552 minphiCmd->SetUnitCandidates("rad deg"); >> 553 >> 554 maxphiCmd = new G4UIcmdWithADoubleAndUnit("/gps/maxphi",this); >> 555 maxphiCmd->SetGuidance("Set maximum phi(obsolete!)"); >> 556 maxphiCmd->SetParameterName("MaxPhi",true,true); >> 557 maxphiCmd->SetDefaultUnit("rad"); >> 558 maxphiCmd->SetUnitCandidates("rad deg"); >> 559 >> 560 angsigmarCmd = new G4UIcmdWithADoubleAndUnit("/gps/sigmaangr",this); >> 561 angsigmarCmd->SetGuidance("Set standard deviation of beam direction in radial(obsolete!)."); >> 562 angsigmarCmd->SetParameterName("Sigmara",true,true); >> 563 angsigmarCmd->SetDefaultUnit("rad"); >> 564 angsigmarCmd->SetUnitCandidates("rad deg"); >> 565 >> 566 angsigmaxCmd = new G4UIcmdWithADoubleAndUnit("/gps/sigmaangx",this); >> 567 angsigmaxCmd->SetGuidance("Set standard deviation of beam direction in x-direc(obsolete!)."); >> 568 angsigmaxCmd->SetParameterName("Sigmaxa",true,true); >> 569 angsigmaxCmd->SetDefaultUnit("rad"); >> 570 angsigmaxCmd->SetUnitCandidates("rad deg"); >> 571 >> 572 angsigmayCmd = new G4UIcmdWithADoubleAndUnit("/gps/sigmaangy",this); >> 573 angsigmayCmd->SetGuidance("Set standard deviation of beam direction in y-direc.(obsolete!)"); >> 574 angsigmayCmd->SetParameterName("Sigmaya",true,true); >> 575 angsigmayCmd->SetDefaultUnit("rad"); >> 576 angsigmayCmd->SetUnitCandidates("rad deg"); >> 577 >> 578 useuserangaxisCmd = new G4UIcmdWithABool("/gps/useuserangaxis",this); >> 579 useuserangaxisCmd->SetGuidance("true for using user defined angular co-ordinates(obsolete!)"); >> 580 useuserangaxisCmd->SetGuidance("Default is false"); >> 581 useuserangaxisCmd->SetParameterName("useuserangaxis",true); >> 582 useuserangaxisCmd->SetDefaultValue(false); >> 583 >> 584 surfnormCmd = new G4UIcmdWithABool("/gps/surfnorm",this); >> 585 surfnormCmd->SetGuidance("Makes a user-defined distribution with respect to surface normals rather than x,y,z axes (obsolete!)."); >> 586 surfnormCmd->SetGuidance("Default is false"); >> 587 surfnormCmd->SetParameterName("surfnorm",true); >> 588 surfnormCmd->SetDefaultValue(false); >> 589 483 // Energy commands 590 // Energy commands 484 // << 591 485 energyDirectory = new G4UIdirectory("/gps/en 592 energyDirectory = new G4UIdirectory("/gps/ene/"); 486 energyDirectory->SetGuidance("Spectral comma 593 energyDirectory->SetGuidance("Spectral commands sub-directory"); 487 594 488 energytypeCmd1 = new G4UIcmdWithAString("/gp 595 energytypeCmd1 = new G4UIcmdWithAString("/gps/ene/type",this); 489 energytypeCmd1->SetGuidance("Sets energy dis 596 energytypeCmd1->SetGuidance("Sets energy distribution type"); 490 energytypeCmd1->SetParameterName("EnergyDis" << 597 energytypeCmd1->SetParameterName("EnergyDis",true,true); 491 energytypeCmd1->SetDefaultValue("Mono"); 598 energytypeCmd1->SetDefaultValue("Mono"); 492 energytypeCmd1->SetCandidates("Mono Lin Pow << 599 energytypeCmd1->SetCandidates("Mono Lin Pow Exp Gauss Brem Bbody Cdg User Arb Epn"); 493 600 494 eminCmd1 = new G4UIcmdWithADoubleAndUnit("/g 601 eminCmd1 = new G4UIcmdWithADoubleAndUnit("/gps/ene/min",this); 495 eminCmd1->SetGuidance("Sets minimum energy") 602 eminCmd1->SetGuidance("Sets minimum energy"); 496 eminCmd1->SetParameterName("emin",false,fals << 603 eminCmd1->SetParameterName("emin",true,true); 497 eminCmd1->SetDefaultUnit("keV"); 604 eminCmd1->SetDefaultUnit("keV"); 498 // eminCmd1->SetUnitCandidates("eV keV MeV G << 605 eminCmd1->SetUnitCandidates("eV keV MeV GeV TeV PeV"); 499 606 500 emaxCmd1 = new G4UIcmdWithADoubleAndUnit("/g 607 emaxCmd1 = new G4UIcmdWithADoubleAndUnit("/gps/ene/max",this); 501 emaxCmd1->SetGuidance("Sets maximum energy") 608 emaxCmd1->SetGuidance("Sets maximum energy"); 502 emaxCmd1->SetParameterName("emax",false,fals << 609 emaxCmd1->SetParameterName("emax",true,true); 503 emaxCmd1->SetDefaultUnit("keV"); 610 emaxCmd1->SetDefaultUnit("keV"); 504 // emaxCmd1->SetUnitCandidates("eV keV MeV G << 611 emaxCmd1->SetUnitCandidates("eV keV MeV GeV TeV PeV"); 505 612 506 monoenergyCmd1 = new G4UIcmdWithADoubleAndUn 613 monoenergyCmd1 = new G4UIcmdWithADoubleAndUnit("/gps/ene/mono",this); 507 monoenergyCmd1->SetGuidance("Sets a monocrom 614 monoenergyCmd1->SetGuidance("Sets a monocromatic energy (same as gps/energy)"); 508 monoenergyCmd1->SetParameterName("monoenergy << 615 monoenergyCmd1->SetParameterName("monoenergy",true,true); 509 monoenergyCmd1->SetDefaultUnit("keV"); 616 monoenergyCmd1->SetDefaultUnit("keV"); 510 // monoenergyCmd1->SetUnitCandidates("eV keV << 617 monoenergyCmd1->SetUnitCandidates("eV keV MeV GeV TeV PeV"); 511 618 512 engsigmaCmd1 = new G4UIcmdWithADoubleAndUnit 619 engsigmaCmd1 = new G4UIcmdWithADoubleAndUnit("/gps/ene/sigma",this); 513 engsigmaCmd1->SetGuidance("Sets the standard 620 engsigmaCmd1->SetGuidance("Sets the standard deviation for Gaussian energy dist."); 514 engsigmaCmd1->SetParameterName("Sigmae",fals << 621 engsigmaCmd1->SetParameterName("Sigmae",true,true); 515 engsigmaCmd1->SetDefaultUnit("keV"); 622 engsigmaCmd1->SetDefaultUnit("keV"); 516 // engsigmaCmd1->SetUnitCandidates("eV keV M << 623 engsigmaCmd1->SetUnitCandidates("eV keV MeV GeV TeV PeV"); 517 624 518 alphaCmd1 = new G4UIcmdWithADouble("/gps/ene 625 alphaCmd1 = new G4UIcmdWithADouble("/gps/ene/alpha",this); 519 alphaCmd1->SetGuidance("Sets Alpha (index) f 626 alphaCmd1->SetGuidance("Sets Alpha (index) for power-law energy dist."); 520 alphaCmd1->SetParameterName("alpha",false,fa << 627 alphaCmd1->SetParameterName("alpha",true,true); 521 628 522 tempCmd1 = new G4UIcmdWithADouble("/gps/ene/ 629 tempCmd1 = new G4UIcmdWithADouble("/gps/ene/temp",this); 523 tempCmd1->SetGuidance("Sets the temperature 630 tempCmd1->SetGuidance("Sets the temperature for Brem and BBody distributions (in Kelvin)"); 524 tempCmd1->SetParameterName("temp",false,fals << 631 tempCmd1->SetParameterName("temp",true,true); 525 632 526 ezeroCmd1 = new G4UIcmdWithADouble("/gps/ene 633 ezeroCmd1 = new G4UIcmdWithADouble("/gps/ene/ezero",this); 527 ezeroCmd1->SetGuidance("Sets E_0 for exponen 634 ezeroCmd1->SetGuidance("Sets E_0 for exponential distribution (in MeV)"); 528 ezeroCmd1->SetParameterName("ezero",false,fa << 635 ezeroCmd1->SetParameterName("ezero",true,true); 529 636 530 gradientCmd1 = new G4UIcmdWithADouble("/gps/ 637 gradientCmd1 = new G4UIcmdWithADouble("/gps/ene/gradient",this); 531 gradientCmd1->SetGuidance("Sets the gradient 638 gradientCmd1->SetGuidance("Sets the gradient for Lin distribution (in 1/MeV)"); 532 gradientCmd1->SetParameterName("gradient",fa << 639 gradientCmd1->SetParameterName("gradient",true,true); 533 640 534 interceptCmd1 = new G4UIcmdWithADouble("/gps 641 interceptCmd1 = new G4UIcmdWithADouble("/gps/ene/intercept",this); 535 interceptCmd1->SetGuidance("Sets the interce 642 interceptCmd1->SetGuidance("Sets the intercept for Lin distributions (in MeV)"); 536 interceptCmd1->SetParameterName("intercept", << 643 interceptCmd1->SetParameterName("intercept",true,true); 537 << 538 arbeintCmd1 = new G4UIcmdWithADouble("/gps/e << 539 arbeintCmd1->SetGuidance("Sets the power-law << 540 arbeintCmd1->SetParameterName("arbeint",fals << 541 644 542 calculateCmd1 = new G4UIcmdWithoutParameter( 645 calculateCmd1 = new G4UIcmdWithoutParameter("/gps/ene/calculate",this); 543 calculateCmd1->SetGuidance("Calculates the d 646 calculateCmd1->SetGuidance("Calculates the distributions for Cdg and BBody"); 544 647 545 energyspecCmd1 = new G4UIcmdWithABool("/gps/ 648 energyspecCmd1 = new G4UIcmdWithABool("/gps/ene/emspec",this); 546 energyspecCmd1->SetGuidance("True for energy 649 energyspecCmd1->SetGuidance("True for energy and false for momentum spectra"); 547 energyspecCmd1->SetParameterName("energyspec 650 energyspecCmd1->SetParameterName("energyspec",true); 548 energyspecCmd1->SetDefaultValue(true); 651 energyspecCmd1->SetDefaultValue(true); 549 652 550 diffspecCmd1 = new G4UIcmdWithABool("/gps/en 653 diffspecCmd1 = new G4UIcmdWithABool("/gps/ene/diffspec",this); 551 diffspecCmd1->SetGuidance("True for differen 654 diffspecCmd1->SetGuidance("True for differential and flase for integral spectra"); 552 diffspecCmd1->SetParameterName("diffspec",tr 655 diffspecCmd1->SetParameterName("diffspec",true); 553 diffspecCmd1->SetDefaultValue(true); 656 diffspecCmd1->SetDefaultValue(true); 554 657 555 applyEnergyWeightCmd1 = new G4UIcmdWithABool << 658 //old ones 556 applyEnergyWeightCmd1->SetGuidance("Apply en << 659 energytypeCmd = new G4UIcmdWithAString("/gps/energytype",this); 557 applyEnergyWeightCmd1->SetGuidance("- Instea << 660 energytypeCmd->SetGuidance("Sets energy distribution type (obsolete!)"); 558 applyEnergyWeightCmd1->SetGuidance(" energy << 661 energytypeCmd->SetParameterName("EnergyDis",true,true); 559 applyEnergyWeightCmd1->SetGuidance(" used fo << 662 energytypeCmd->SetDefaultValue("Mono"); 560 applyEnergyWeightCmd1->SetGuidance("- \"/gps << 663 energytypeCmd->SetCandidates("Mono Lin Pow Exp Gauss Brem Bbody Cdg User Arb Epn"); 561 applyEnergyWeightCmd1->SetGuidance("- If thi << 664 562 applyEnergyWeightCmd1->SetParameterName("fla << 665 eminCmd = new G4UIcmdWithADoubleAndUnit("/gps/emin",this); 563 applyEnergyWeightCmd1->SetDefaultValue(true) << 666 eminCmd->SetGuidance("Sets Emin (obsolete!)"); >> 667 eminCmd->SetParameterName("emin",true,true); >> 668 eminCmd->SetDefaultUnit("keV"); >> 669 eminCmd->SetUnitCandidates("eV keV MeV GeV TeV PeV"); >> 670 >> 671 emaxCmd = new G4UIcmdWithADoubleAndUnit("/gps/emax",this); >> 672 emaxCmd->SetGuidance("Sets Emax (obsolete!)"); >> 673 emaxCmd->SetParameterName("emax",true,true); >> 674 emaxCmd->SetDefaultUnit("keV"); >> 675 emaxCmd->SetUnitCandidates("eV keV MeV GeV TeV PeV"); >> 676 >> 677 monoenergyCmd = new G4UIcmdWithADoubleAndUnit("/gps/monoenergy",this); >> 678 monoenergyCmd->SetGuidance("Sets Monoenergy (obsolete, use gps/energy instead!)"); >> 679 monoenergyCmd->SetParameterName("monoenergy",true,true); >> 680 monoenergyCmd->SetDefaultUnit("keV"); >> 681 monoenergyCmd->SetUnitCandidates("eV keV MeV GeV TeV PeV"); >> 682 >> 683 engsigmaCmd = new G4UIcmdWithADoubleAndUnit("/gps/sigmae",this); >> 684 engsigmaCmd->SetGuidance("Sets the standard deviation for Gaussian energy dist.(obsolete!)"); >> 685 engsigmaCmd->SetParameterName("Sigmae",true,true); >> 686 engsigmaCmd->SetDefaultUnit("keV"); >> 687 engsigmaCmd->SetUnitCandidates("eV keV MeV GeV TeV PeV"); >> 688 >> 689 alphaCmd = new G4UIcmdWithADouble("/gps/alpha",this); >> 690 alphaCmd->SetGuidance("Sets Alpha (index) for power-law energy dist(obsolete!)."); >> 691 alphaCmd->SetParameterName("alpha",true,true); >> 692 >> 693 tempCmd = new G4UIcmdWithADouble("/gps/temp",this); >> 694 tempCmd->SetGuidance("Sets the temperature for Brem and BBody (in Kelvin)(obsolete!)"); >> 695 tempCmd->SetParameterName("temp",true,true); >> 696 >> 697 ezeroCmd = new G4UIcmdWithADouble("/gps/ezero",this); >> 698 ezeroCmd->SetGuidance("Sets ezero exponential distributions (in MeV)(obsolete!)"); >> 699 ezeroCmd->SetParameterName("ezero",true,true); >> 700 >> 701 gradientCmd = new G4UIcmdWithADouble("/gps/gradient",this); >> 702 gradientCmd->SetGuidance("Sets the gradient for Lin distributions (in 1/MeV)(obsolete!)"); >> 703 gradientCmd->SetParameterName("gradient",true,true); >> 704 >> 705 interceptCmd = new G4UIcmdWithADouble("/gps/intercept",this); >> 706 interceptCmd->SetGuidance("Sets the intercept for Lin distributions (in MeV)(obsolete!)"); >> 707 interceptCmd->SetParameterName("intercept",true,true); >> 708 >> 709 calculateCmd = new G4UIcmdWithoutParameter("/gps/calculate",this); >> 710 calculateCmd->SetGuidance("Calculates distributions for Cdg and BBody(obsolete!)"); >> 711 >> 712 energyspecCmd = new G4UIcmdWithABool("/gps/energyspec",this); >> 713 energyspecCmd->SetGuidance("True for energy and false for momentum spectra(obsolete!)"); >> 714 energyspecCmd->SetParameterName("energyspec",true); >> 715 energyspecCmd->SetDefaultValue(true); >> 716 >> 717 diffspecCmd = new G4UIcmdWithABool("/gps/diffspec",this); >> 718 diffspecCmd->SetGuidance("True for differential and flase for integral spectra(obsolete!)"); >> 719 diffspecCmd->SetParameterName("diffspec",true); >> 720 diffspecCmd->SetDefaultValue(true); 564 721 565 // Biasing + histograms in general 722 // Biasing + histograms in general 566 // << 567 histDirectory = new G4UIdirectory("/gps/hist 723 histDirectory = new G4UIdirectory("/gps/hist/"); 568 histDirectory->SetGuidance("Histogram, biasi 724 histDirectory->SetGuidance("Histogram, biasing commands sub-directory"); 569 725 570 histnameCmd1 = new G4UIcmdWithAString("/gps/ 726 histnameCmd1 = new G4UIcmdWithAString("/gps/hist/type",this); 571 histnameCmd1->SetGuidance("Sets histogram ty 727 histnameCmd1->SetGuidance("Sets histogram type"); 572 histnameCmd1->SetParameterName("HistType",fa << 728 histnameCmd1->SetParameterName("HistType",true,true); 573 histnameCmd1->SetDefaultValue("biasx"); 729 histnameCmd1->SetDefaultValue("biasx"); 574 histnameCmd1->SetCandidates("biasx biasy bia 730 histnameCmd1->SetCandidates("biasx biasy biasz biast biasp biase biaspt biaspp theta phi energy arb epn"); 575 731 576 resethistCmd1 = new G4UIcmdWithAString("/gps 732 resethistCmd1 = new G4UIcmdWithAString("/gps/hist/reset",this); 577 resethistCmd1->SetGuidance("Reset (clean) th 733 resethistCmd1->SetGuidance("Reset (clean) the histogram "); 578 resethistCmd1->SetParameterName("HistType",f << 734 resethistCmd1->SetParameterName("HistType",true,true); 579 resethistCmd1->SetDefaultValue("energy"); 735 resethistCmd1->SetDefaultValue("energy"); 580 resethistCmd1->SetCandidates("biasx biasy bi 736 resethistCmd1->SetCandidates("biasx biasy biasz biast biasp biase biaspt biaspp theta phi energy arb epn"); 581 737 582 histpointCmd1 = new G4UIcmdWith3Vector("/gps 738 histpointCmd1 = new G4UIcmdWith3Vector("/gps/hist/point",this); 583 histpointCmd1->SetGuidance("Allows user to d 739 histpointCmd1->SetGuidance("Allows user to define a histogram"); 584 histpointCmd1->SetGuidance(" Enter: Ehi Weig << 740 histpointCmd1->SetGuidance("Enter: Ehi Weight"); 585 histpointCmd1->SetParameterName("Ehi","Weigh 741 histpointCmd1->SetParameterName("Ehi","Weight","Junk",true,true); 586 histpointCmd1->SetRange("Ehi >= 0. && Weight 742 histpointCmd1->SetRange("Ehi >= 0. && Weight >= 0."); 587 743 588 histfileCmd1 = new G4UIcmdWithAString("/gps/ << 589 histfileCmd1->SetGuidance("Imports the arb e << 590 histfileCmd1->SetParameterName("HistFile",fa << 591 << 592 arbintCmd1 = new G4UIcmdWithAString("/gps/hi 744 arbintCmd1 = new G4UIcmdWithAString("/gps/hist/inter",this); 593 arbintCmd1->SetGuidance("Sets the interpolat 745 arbintCmd1->SetGuidance("Sets the interpolation method for arbitrary distribution."); 594 arbintCmd1->SetGuidance("Spline interpolatio << 746 arbintCmd1->SetParameterName("int",true,true); 595 arbintCmd1->SetParameterName("int",false,fal << 596 arbintCmd1->SetDefaultValue("Lin"); 747 arbintCmd1->SetDefaultValue("Lin"); 597 arbintCmd1->SetCandidates("Lin Log Exp Splin 748 arbintCmd1->SetCandidates("Lin Log Exp Spline"); >> 749 >> 750 // old ones >> 751 histnameCmd = new G4UIcmdWithAString("/gps/histname",this); >> 752 histnameCmd->SetGuidance("Sets histogram type (obsolete!)"); >> 753 histnameCmd->SetParameterName("HistType",true,true); >> 754 histnameCmd->SetDefaultValue("biasx"); >> 755 histnameCmd->SetCandidates("biasx biasy biasz biast biasp biase biaspt biaspp theta phi energy arb epn"); >> 756 >> 757 // re-set the histograms >> 758 resethistCmd = new G4UIcmdWithAString("/gps/resethist",this); >> 759 resethistCmd->SetGuidance("Re-Set the histogram (obsolete!)"); >> 760 resethistCmd->SetParameterName("HistType",true,true); >> 761 resethistCmd->SetDefaultValue("energy"); >> 762 resethistCmd->SetCandidates("biasx biasy biasz biast biasp biase biaspt biaspp theta phi energy arb epn"); >> 763 >> 764 histpointCmd = new G4UIcmdWith3Vector("/gps/histpoint",this); >> 765 histpointCmd->SetGuidance("Allows user to define a histogram (obsolete!)"); >> 766 histpointCmd->SetGuidance("Enter: Ehi Weight"); >> 767 histpointCmd->SetParameterName("Ehi","Weight","Junk",true,true); >> 768 histpointCmd->SetRange("Ehi >= 0. && Weight >= 0."); >> 769 >> 770 arbintCmd = new G4UIcmdWithAString("/gps/arbint",this); >> 771 arbintCmd->SetGuidance("Sets Arbitrary Interpolation type.(obsolete!) "); >> 772 arbintCmd->SetParameterName("int",true,true); >> 773 arbintCmd->SetDefaultValue("NULL"); >> 774 arbintCmd->SetCandidates("Lin Log Exp Spline"); >> 775 598 } 776 } 599 777 600 G4GeneralParticleSourceMessenger::~G4GeneralPa 778 G4GeneralParticleSourceMessenger::~G4GeneralParticleSourceMessenger() 601 { 779 { 602 delete positionDirectory; 780 delete positionDirectory; >> 781 delete typeCmd; >> 782 delete shapeCmd; >> 783 delete centreCmd; >> 784 delete posrot1Cmd; >> 785 delete posrot2Cmd; >> 786 delete halfxCmd; >> 787 delete halfyCmd; >> 788 delete halfzCmd; >> 789 delete radiusCmd; >> 790 delete radius0Cmd; >> 791 delete possigmarCmd; >> 792 delete possigmaxCmd; >> 793 delete possigmayCmd; >> 794 delete paralpCmd; >> 795 delete partheCmd; >> 796 delete parphiCmd; >> 797 delete confineCmd; 603 delete typeCmd1; 798 delete typeCmd1; 604 delete shapeCmd1; 799 delete shapeCmd1; 605 delete centreCmd1; 800 delete centreCmd1; 606 delete posrot1Cmd1; 801 delete posrot1Cmd1; 607 delete posrot2Cmd1; 802 delete posrot2Cmd1; 608 delete halfxCmd1; 803 delete halfxCmd1; 609 delete halfyCmd1; 804 delete halfyCmd1; 610 delete halfzCmd1; 805 delete halfzCmd1; 611 delete radiusCmd1; 806 delete radiusCmd1; 612 delete radius0Cmd1; 807 delete radius0Cmd1; 613 delete possigmarCmd1; 808 delete possigmarCmd1; 614 delete possigmaxCmd1; 809 delete possigmaxCmd1; 615 delete possigmayCmd1; 810 delete possigmayCmd1; 616 delete paralpCmd1; 811 delete paralpCmd1; 617 delete partheCmd1; 812 delete partheCmd1; 618 delete parphiCmd1; 813 delete parphiCmd1; 619 delete confineCmd1; 814 delete confineCmd1; 620 815 621 delete angularDirectory; 816 delete angularDirectory; >> 817 delete angtypeCmd; >> 818 delete angrot1Cmd; >> 819 delete angrot2Cmd; >> 820 delete minthetaCmd; >> 821 delete maxthetaCmd; >> 822 delete minphiCmd; >> 823 delete maxphiCmd; >> 824 delete angsigmarCmd; >> 825 delete angsigmaxCmd; >> 826 delete angsigmayCmd; >> 827 delete useuserangaxisCmd; >> 828 delete surfnormCmd; 622 delete angtypeCmd1; 829 delete angtypeCmd1; 623 delete angrot1Cmd1; 830 delete angrot1Cmd1; 624 delete angrot2Cmd1; 831 delete angrot2Cmd1; 625 delete minthetaCmd1; 832 delete minthetaCmd1; 626 delete maxthetaCmd1; 833 delete maxthetaCmd1; 627 delete minphiCmd1; 834 delete minphiCmd1; 628 delete maxphiCmd1; 835 delete maxphiCmd1; 629 delete angsigmarCmd1; 836 delete angsigmarCmd1; 630 delete angsigmaxCmd1; 837 delete angsigmaxCmd1; 631 delete angsigmayCmd1; << 632 delete angfocusCmd; 838 delete angfocusCmd; 633 delete useuserangaxisCmd1; 839 delete useuserangaxisCmd1; 634 delete surfnormCmd1; 840 delete surfnormCmd1; 635 841 636 delete energyDirectory; 842 delete energyDirectory; >> 843 delete energytypeCmd; >> 844 delete eminCmd; >> 845 delete emaxCmd; >> 846 delete monoenergyCmd; >> 847 delete engsigmaCmd; >> 848 delete alphaCmd; >> 849 delete tempCmd; >> 850 delete ezeroCmd; >> 851 delete gradientCmd; >> 852 delete interceptCmd; >> 853 delete calculateCmd; >> 854 delete energyspecCmd; >> 855 delete diffspecCmd; 637 delete energytypeCmd1; 856 delete energytypeCmd1; 638 delete eminCmd1; 857 delete eminCmd1; 639 delete emaxCmd1; 858 delete emaxCmd1; 640 delete monoenergyCmd1; 859 delete monoenergyCmd1; 641 delete engsigmaCmd1; 860 delete engsigmaCmd1; 642 delete alphaCmd1; 861 delete alphaCmd1; 643 delete tempCmd1; 862 delete tempCmd1; 644 delete ezeroCmd1; 863 delete ezeroCmd1; 645 delete gradientCmd1; 864 delete gradientCmd1; 646 delete interceptCmd1; 865 delete interceptCmd1; 647 delete arbeintCmd1; << 648 delete calculateCmd1; 866 delete calculateCmd1; 649 delete energyspecCmd1; 867 delete energyspecCmd1; 650 delete diffspecCmd1; 868 delete diffspecCmd1; 651 delete applyEnergyWeightCmd1; << 652 869 653 delete histDirectory; 870 delete histDirectory; >> 871 delete histnameCmd; >> 872 delete resethistCmd; >> 873 delete histpointCmd; >> 874 delete arbintCmd; 654 delete histnameCmd1; 875 delete histnameCmd1; 655 delete resethistCmd1; 876 delete resethistCmd1; 656 delete histpointCmd1; 877 delete histpointCmd1; 657 delete histfileCmd1; << 658 delete arbintCmd1; 878 delete arbintCmd1; 659 879 660 delete verbosityCmd; 880 delete verbosityCmd; 661 delete volChkCmd; << 662 << 663 delete ionCmd; 881 delete ionCmd; 664 delete ionLvlCmd; << 665 delete particleCmd; 882 delete particleCmd; 666 delete timeCmd; 883 delete timeCmd; 667 delete polCmd; 884 delete polCmd; 668 delete numberCmd; 885 delete numberCmd; 669 delete positionCmd; 886 delete positionCmd; 670 delete directionCmd; 887 delete directionCmd; 671 delete energyCmd; 888 delete energyCmd; 672 delete listCmd; 889 delete listCmd; 673 890 674 delete sourceDirectory; 891 delete sourceDirectory; 675 delete addsourceCmd; 892 delete addsourceCmd; 676 delete listsourceCmd; 893 delete listsourceCmd; 677 delete clearsourceCmd; 894 delete clearsourceCmd; 678 delete getsourceCmd; 895 delete getsourceCmd; 679 delete setsourceCmd; 896 delete setsourceCmd; 680 delete setintensityCmd; 897 delete setintensityCmd; 681 delete deletesourceCmd; 898 delete deletesourceCmd; 682 delete multiplevertexCmd; 899 delete multiplevertexCmd; 683 delete flatsamplingCmd; << 684 900 685 delete gpsDirectory; 901 delete gpsDirectory; 686 theInstance = nullptr; << 902 687 } 903 } 688 904 689 #define CHECKPG() { if (fParticleGun==nullptr) << 690 G4ExceptionDescription m << 691 msg << "Command "<< comm << 692 msg << command->GetComma << 693 msg << " used but no par << 694 msg <<" Add at least a s << 695 G4Exception("G4GeneralPa << 696 FatalExcepti << 697 } } << 698 << 699 void G4GeneralParticleSourceMessenger::SetNewV 905 void G4GeneralParticleSourceMessenger::SetNewValue(G4UIcommand *command, G4String newValues) 700 { 906 { 701 // if(command == typeCmd) << 907 if(command == typeCmd) 702 // { << 703 // CHECKPG(); fParticleGun->GetPosDist()- << 704 // G4cout << " G4GeneralParticleSourceMes << 705 // << " The command is obsolete an << 706 // << " Please try to use the new << 707 // } << 708 // else if(command == shapeCmd) << 709 // { << 710 // CHECKPG(); fParticleGun->GetPosDist()- << 711 // G4cout << " G4GeneralParticleSourceMes << 712 // << " The command is obsolete an << 713 // << " Please try to use the new << 714 // } << 715 // else if(command == centreCmd) << 716 // { << 717 // CHECKPG(); fParticleGun->GetPosDist()- << 718 // G4cout << " G4GeneralParticleSourceMes << 719 // << " The command is obsolete an << 720 // << " Please try to use the new << 721 // } << 722 // else if(command == posrot1Cmd) << 723 // { << 724 // CHECKPG(); fParticleGun->GetPosDist()- << 725 // G4cout << " G4GeneralParticleSourceMes << 726 // << " The command is obsolete an << 727 // << " Please try to use the new << 728 // } << 729 // else if(command == posrot2Cmd) << 730 // { << 731 // CHECKPG(); fParticleGun->GetPosDist()- << 732 // G4cout << " G4GeneralParticleSourceMes << 733 // << " The command is obsolete an << 734 // << " Please try to use the new << 735 // } << 736 // else if(command == halfxCmd) << 737 // { << 738 // CHECKPG(); fParticleGun->GetPosDist()- << 739 // G4cout << " G4GeneralParticleSourceMes << 740 // << " The command is obsolete an << 741 // << " Please try to use the new << 742 // } << 743 // else if(command == halfyCmd) << 744 // { << 745 // CHECKPG(); fParticleGun->GetPosDist()- << 746 // G4cout << " G4GeneralParticleSourceMes << 747 // << " The command is obsolete an << 748 // << " Please try to use the new << 749 // } << 750 // else if(command == halfzCmd) << 751 // { << 752 // CHECKPG(); fParticleGun->GetPosDist()- << 753 // G4cout << " G4GeneralParticleSourceMes << 754 // << " The command is obsolete an << 755 // << " Please try to use the new << 756 // } << 757 // else if(command == radiusCmd) << 758 // { << 759 // CHECKPG(); fParticleGun->GetPosDist()- << 760 // G4cout << " G4GeneralParticleSourceMes << 761 // << " The command is obsolete an << 762 // << " Please try to use the new << 763 // } << 764 // else if(command == radius0Cmd) << 765 // { << 766 // CHECKPG(); fParticleGun->GetPosDist()- << 767 // G4cout << " G4GeneralParticleSourceMes << 768 // << " The command is obsolete an << 769 // << " Please try to use the new << 770 // } << 771 // else if(command == possigmarCmd) << 772 // { << 773 // CHECKPG(); fParticleGun->GetPosDist()- << 774 // G4cout << " G4GeneralParticleSourceMes << 775 // << " The command is obsolete an << 776 // << " Please try to use the new << 777 // } << 778 // else if(command == possigmaxCmd) << 779 // { << 780 // CHECKPG(); fParticleGun->GetPosDist()- << 781 // G4cout << " G4GeneralParticleSourceMes << 782 // << " The command is obsolete an << 783 // << " Please try to use the new << 784 // } << 785 // else if(command == possigmayCmd) << 786 // { << 787 // CHECKPG(); fParticleGun->GetPosDist()- << 788 // G4cout << " G4GeneralParticleSourceMes << 789 // << " The command is obsolete an << 790 // << " Please try to use the new << 791 // } << 792 // else if(command == paralpCmd) << 793 // { << 794 // CHECKPG(); fParticleGun->GetPosDist()- << 795 // G4cout << " G4GeneralParticleSourceMes << 796 // << " The command is obsolete an << 797 // << " Please try to use the new << 798 // } << 799 // else if(command == partheCmd) << 800 // { << 801 // CHECKPG(); fParticleGun->GetPosDist()- << 802 // G4cout << " G4GeneralParticleSourceMes << 803 // << " The command is obsolete an << 804 // << " Please try to use the new << 805 // } << 806 // else if(command == parphiCmd) << 807 // { << 808 // CHECKPG(); fParticleGun->GetPosDist()- << 809 // G4cout << " G4GeneralParticleSourceMes << 810 // << " The command is obsolete an << 811 // << " Please try to use the new << 812 // } << 813 // else if(command == confineCmd) << 814 // { << 815 // CHECKPG(); fParticleGun->GetPosDist()- << 816 // G4cout << " G4GeneralParticleSourceMes << 817 // << " The command is obsolete an << 818 // << " Please try to use the new << 819 // } << 820 // else if(command == angtypeCmd) << 821 // { << 822 // CHECKPG(); fParticleGun->GetAngDist()- << 823 // G4cout << " G4GeneralParticleSourceMes << 824 // << " The command is obsolete an << 825 // << " Please try to use the new << 826 // } << 827 // else if(command == angrot1Cmd) << 828 // { << 829 // CHECKPG(); << 830 // G4String a = "angref1"; << 831 // fParticleGun->GetAngDist()->DefineAngR << 832 // G4cout << " G4GeneralParticleSourceMes << 833 // << " The command is obsolete an << 834 // << " Please try to use the new << 835 // } << 836 // else if(command == angrot2Cmd) << 837 // { << 838 // CHECKPG(); << 839 // G4String a = "angref2"; << 840 // fParticleGun->GetAngDist()->DefineAngR << 841 // G4cout << " G4GeneralParticleSourceMes << 842 // << " The command is obsolete an << 843 // << " Please try to use the new << 844 // } << 845 // else if(command == minthetaCmd) << 846 // { << 847 // CHECKPG(); fParticleGun->GetAngDist()- << 848 // G4cout << " G4GeneralParticleSourceMes << 849 // << " The command is obsolete an << 850 // << " Please try to use the new << 851 // } << 852 // else if(command == minphiCmd) << 853 // { << 854 // CHECKPG(); fParticleGun->GetAngDist()- << 855 // G4cout << " G4GeneralParticleSourceMes << 856 // << " The command is obsolete an << 857 // << " Please try to use the new << 858 // } << 859 // else if(command == maxthetaCmd) << 860 // { << 861 // CHECKPG(); fParticleGun->GetAngDist()- << 862 // G4cout << " G4GeneralParticleSourceMes << 863 // << " The command is obsolete an << 864 // << " Please try to use the new << 865 // } << 866 // else if(command == maxphiCmd) << 867 // { << 868 // CHECKPG(); fParticleGun->GetAngDist()- << 869 // G4cout << " G4GeneralParticleSourceMes << 870 // << " The command is obsolete an << 871 // << " Please try to use the new << 872 // } << 873 // else if(command == angsigmarCmd) << 874 // { << 875 // CHECKPG(); fParticleGun->GetAngDist()- << 876 // G4cout << " G4GeneralParticleSourceMes << 877 // << " The command is obsolete an << 878 // << " Please try to use the new << 879 // } << 880 // else if(command == angsigmaxCmd) << 881 // { << 882 // CHECKPG(); fParticleGun->GetAngDist()- << 883 // G4cout << " G4GeneralParticleSourceMes << 884 // << " The command is obsolete an << 885 // << " Please try to use the new << 886 // } << 887 // else if(command == angsigmayCmd) << 888 // { << 889 // CHECKPG(); fParticleGun->GetAngDist()- << 890 // G4cout << " G4GeneralParticleSourceMes << 891 // << " The command is obsolete an << 892 // << " Please try to use the new << 893 // } << 894 // else if(command == useuserangaxisCmd) << 895 // { << 896 // CHECKPG(); fParticleGun->GetAngDist()- << 897 // G4cout << " G4GeneralParticleSourceMes << 898 // << " The command is obsolete an << 899 // << " Please try to use the new << 900 // } << 901 // else if(command == surfnormCmd) << 902 // { << 903 // CHECKPG(); fParticleGun->GetAngDist()- << 904 // G4cout << " G4GeneralParticleSourceMes << 905 // << " The command is obsolete an << 906 // << " Please try to use the new << 907 // } << 908 // else if(command == energytypeCmd) << 909 // { << 910 // CHECKPG(); fParticleGun->GetEneDist()- << 911 // G4cout << " G4GeneralParticleSourceMes << 912 // << " The command is obsolete an << 913 // << " Please try to use the new << 914 // } << 915 // else if(command == eminCmd) << 916 // { << 917 // CHECKPG(); fParticleGun->GetEneDist()- << 918 // G4cout << " G4GeneralParticleSourceMes << 919 // << " The command is obsolete an << 920 // << " Please try to use the new << 921 // } << 922 // else if(command == emaxCmd) << 923 // { << 924 // CHECKPG(); fParticleGun->GetEneDist()- << 925 // G4cout << " G4GeneralParticleSourceMes << 926 // << " The command is obsolete an << 927 // << " Please try to use the new << 928 // } << 929 // else if(command == monoenergyCmd) << 930 // { << 931 // CHECKPG(); fParticleGun->GetEneDist()- << 932 // G4cout << " G4GeneralParticleSourceMes << 933 // << " The command is obsolete an << 934 // << " Please try to use the new << 935 // } << 936 // else if(command == engsigmaCmd) << 937 // { << 938 // CHECKPG(); fParticleGun->GetEneDist()- << 939 // G4cout << " G4GeneralParticleSourceMes << 940 // << " The command is obsolete an << 941 // << " Please try to use the new << 942 // } << 943 // else if(command == alphaCmd) << 944 // { << 945 // CHECKPG(); fParticleGun->GetEneDist()- << 946 // G4cout << " G4GeneralParticleSourceMes << 947 // << " The command is obsolete an << 948 // << " Please try to use the new << 949 // } << 950 // else if(command == tempCmd) << 951 // { << 952 // CHECKPG(); fParticleGun->GetEneDist()- << 953 // G4cout << " G4GeneralParticleSourceMes << 954 // << " The command is obsolete an << 955 // << " Please try to use the new << 956 // } << 957 // else if(command == ezeroCmd) << 958 // { << 959 // CHECKPG(); fParticleGun->GetEneDist()- << 960 // G4cout << " G4GeneralParticleSourceMes << 961 // << " The command is obsolete an << 962 // << " Please try to use the new << 963 // } << 964 // else if(command == gradientCmd) << 965 // { << 966 // CHECKPG(); fParticleGun->GetEneDist()- << 967 // G4cout << " G4GeneralParticleSourceMes << 968 // << " The command is obsolete an << 969 // << " Please try to use the new << 970 // } << 971 // else if(command == interceptCmd) << 972 // { << 973 // CHECKPG(); fParticleGun->GetEneDist()- << 974 // G4cout << " G4GeneralParticleSourceMes << 975 // << " The command is obsolete an << 976 // << " Please try to use the new << 977 // } << 978 // else if(command == calculateCmd) << 979 // { << 980 // CHECKPG(); fParticleGun->GetEneDist()- << 981 // G4cout << " G4GeneralParticleSourceMes << 982 // << " The command is obsolete an << 983 // << " Please try to use the new << 984 // } << 985 // else if(command == energyspecCmd) << 986 // { << 987 // CHECKPG(); fParticleGun->GetEneDist()- << 988 // G4cout << " G4GeneralParticleSourceMes << 989 // << " The command is obsolete an << 990 // << " Please try to use the new << 991 // } << 992 // else if(command == diffspecCmd) << 993 // { << 994 // CHECKPG(); fParticleGun->GetEneDist()- << 995 // G4cout << " G4GeneralParticleSourceMes << 996 // << " The command is obsolete an << 997 // << " Please try to use the new << 998 // } << 999 // else if(command == histnameCmd) << 1000 // { << 1001 // histtype = newValues; << 1002 // G4cout << " G4GeneralParticleSourceMe << 1003 // << " The command is obsolete a << 1004 // << " Please try to use the new << 1005 // } << 1006 // else << 1007 // if(command == histpointCmd) << 1008 // { << 1009 // CHECKPG(); << 1010 // if(histtype == "biasx") << 1011 // fParticleGun->GetBiasRndm()->SetXBi << 1012 // if(histtype == "biasy") << 1013 // fParticleGun->GetBiasRndm()->SetYBi << 1014 // if(histtype == "biasz") << 1015 // fParticleGun->GetBiasRndm()->SetZBi << 1016 // if(histtype == "biast") << 1017 // fParticleGun->GetBiasRndm()->SetThe << 1018 // if(histtype == "biasp") << 1019 // fParticleGun->GetBiasRndm()->SetPhi << 1020 // if(histtype == "biase") << 1021 // fParticleGun->GetBiasRndm()->SetEne << 1022 // if(histtype == "theta") << 1023 // fParticleGun->GetAngDist()->UserDef << 1024 // if(histtype == "phi") << 1025 // fParticleGun->GetAngDist()->UserDef << 1026 // if(histtype == "energy") << 1027 // fParticleGun->GetEneDist()->UserEne << 1028 // if(histtype == "arb") << 1029 // fParticleGun->GetEneDist()->ArbEner << 1030 // if(histtype == "epn") << 1031 // fParticleGun->GetEneDist()->EpnEner << 1032 // G4cout << " G4GeneralParticleSourceMe << 1033 // } << 1034 // else if(command == resethistCmd) << 1035 // { << 1036 // CHECKPG(); << 1037 // if(newValues == "theta" || newValues << 1038 // fParticleGun->GetAngDist()->ReSetHi << 1039 // } else if (newValues == "energy" || n << 1040 // fParticleGun->GetEneDist()->ReSetHi << 1041 // } else { << 1042 // fParticleGun->GetBiasRndm()->ReSetH << 1043 // } << 1044 // G4cout << " G4GeneralParticleSourceMe << 1045 // << " The command is obsolete a << 1046 // << " Please try to use the new << 1047 // } << 1048 // else if(command == arbintCmd) << 1049 // { << 1050 // CHECKPG(); << 1051 // fParticleGun->GetEneDist()->ArbInterp << 1052 // G4cout << " G4GeneralParticleSourceMe << 1053 // << " The command is obsolete a << 1054 // << " Please try to use the new << 1055 // } << 1056 // else << 1057 if( command==directionCmd ) << 1058 { 908 { 1059 CHECKPG(); << 909 fParticleGun->GetPosDist()->SetPosDisType(newValues); 1060 fParticleGun->GetAngDist()->SetAngDistT << 910 G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl 1061 fParticleGun->GetAngDist()->SetParticle << 911 << " The command is obsolete and will be removed soon." << G4endl >> 912 << " Please try to use the new structured commands!" << G4endl; 1062 } 913 } 1063 else if( command==energyCmd ) << 914 else if(command == shapeCmd) 1064 { 915 { 1065 CHECKPG(); << 916 fParticleGun->GetPosDist()->SetPosDisShape(newValues); 1066 fParticleGun->GetEneDist()->SetEnergyDi << 917 G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl 1067 fParticleGun->GetEneDist()->SetMonoEner << 918 << " The command is obsolete and will be removed soon." << G4endl >> 919 << " Please try to use the new structured commands!" << G4endl; 1068 } 920 } 1069 else if( command==positionCmd ) << 921 else if(command == centreCmd) 1070 { 922 { 1071 CHECKPG(); << 923 fParticleGun->GetPosDist()->SetCentreCoords(centreCmd->GetNew3VectorValue(newValues)); 1072 fParticleGun->GetPosDist()->SetPosDisTy << 924 G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl 1073 fParticleGun->GetPosDist()->SetCentreCo << 925 << " The command is obsolete and will be removed soon." << G4endl >> 926 << " Please try to use the new structured commands!" << G4endl; 1074 } 927 } 1075 else if(command == verbosityCmd) << 928 else if(command == posrot1Cmd) 1076 { 929 { 1077 fGPS->SetVerbosity(verbosityCmd->GetNew << 930 fParticleGun->GetPosDist()->SetPosRot1(posrot1Cmd->GetNew3VectorValue(newValues)); 1078 // CHECKPG(); << 931 G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl 1079 // fParticleGun->SetVerbosity(verbosity << 932 << " The command is obsolete and will be removed soon." << G4endl >> 933 << " Please try to use the new structured commands!" << G4endl; 1080 } 934 } 1081 else if( command==volChkCmd ) << 935 else if(command == posrot2Cmd) 1082 { 936 { 1083 fGPS->CheckInside(volChkCmd->GetNewBool << 937 fParticleGun->GetPosDist()->SetPosRot2(posrot2Cmd->GetNew3VectorValue(newValues)); >> 938 G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl >> 939 << " The command is obsolete and will be removed soon." << G4endl >> 940 << " Please try to use the new structured commands!" << G4endl; 1084 } 941 } 1085 else if( command==particleCmd ) << 942 else if(command == halfxCmd) 1086 { 943 { 1087 if (newValues =="ion") << 944 fParticleGun->GetPosDist()->SetHalfX(halfxCmd->GetNewDoubleValue(newValues)); 1088 { << 945 G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl 1089 fShootIon = true; << 946 << " The command is obsolete and will be removed soon." << G4endl 1090 } << 947 << " Please try to use the new structured commands!" << G4endl; 1091 else << 1092 { << 1093 fShootIon = false; << 1094 G4ParticleDefinition* pd = particleTa << 1095 if(pd != nullptr) << 1096 { << 1097 CHECKPG(); << 1098 fParticleGun->SetParticleDefinition << 1099 } << 1100 } << 1101 } 948 } 1102 else if( command==timeCmd ) << 949 else if(command == halfyCmd) 1103 { 950 { 1104 CHECKPG(); << 951 fParticleGun->GetPosDist()->SetHalfY(halfyCmd->GetNewDoubleValue(newValues)); 1105 fParticleGun->SetParticleTime(timeCmd-> << 952 G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl >> 953 << " The command is obsolete and will be removed soon." << G4endl >> 954 << " Please try to use the new structured commands!" << G4endl; 1106 } 955 } 1107 else if( command==polCmd ) << 956 else if(command == halfzCmd) 1108 { 957 { 1109 CHECKPG(); << 958 fParticleGun->GetPosDist()->SetHalfZ(halfzCmd->GetNewDoubleValue(newValues)); 1110 fParticleGun->SetParticlePolarization(p << 959 G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl >> 960 << " The command is obsolete and will be removed soon." << G4endl >> 961 << " Please try to use the new structured commands!" << G4endl; 1111 } 962 } 1112 else if( command==numberCmd ) << 963 else if(command == radiusCmd) 1113 { 964 { 1114 CHECKPG(); << 965 fParticleGun->GetPosDist()->SetRadius(radiusCmd->GetNewDoubleValue(newValues)); 1115 fParticleGun->SetNumberOfParticles(numb << 966 G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl >> 967 << " The command is obsolete and will be removed soon." << G4endl >> 968 << " Please try to use the new structured commands!" << G4endl; 1116 } 969 } 1117 else if( command==ionCmd ) << 970 else if(command == radius0Cmd) >> 971 { >> 972 fParticleGun->GetPosDist()->SetRadius0(radius0Cmd->GetNewDoubleValue(newValues)); >> 973 G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl >> 974 << " The command is obsolete and will be removed soon." << G4endl >> 975 << " Please try to use the new structured commands!" << G4endl; >> 976 } >> 977 else if(command == possigmarCmd) >> 978 { >> 979 fParticleGun->GetPosDist()->SetBeamSigmaInR(possigmarCmd->GetNewDoubleValue(newValues)); >> 980 G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl >> 981 << " The command is obsolete and will be removed soon." << G4endl >> 982 << " Please try to use the new structured commands!" << G4endl; >> 983 } >> 984 else if(command == possigmaxCmd) >> 985 { >> 986 fParticleGun->GetPosDist()->SetBeamSigmaInX(possigmaxCmd->GetNewDoubleValue(newValues)); >> 987 G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl >> 988 << " The command is obsolete and will be removed soon." << G4endl >> 989 << " Please try to use the new structured commands!" << G4endl; >> 990 } >> 991 else if(command == possigmayCmd) >> 992 { >> 993 fParticleGun->GetPosDist()->SetBeamSigmaInY(possigmayCmd->GetNewDoubleValue(newValues)); >> 994 G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl >> 995 << " The command is obsolete and will be removed soon." << G4endl >> 996 << " Please try to use the new structured commands!" << G4endl; >> 997 } >> 998 else if(command == paralpCmd) >> 999 { >> 1000 fParticleGun->GetPosDist()->SetParAlpha(paralpCmd->GetNewDoubleValue(newValues)); >> 1001 G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl >> 1002 << " The command is obsolete and will be removed soon." << G4endl >> 1003 << " Please try to use the new structured commands!" << G4endl; >> 1004 } >> 1005 else if(command == partheCmd) >> 1006 { >> 1007 fParticleGun->GetPosDist()->SetParTheta(partheCmd->GetNewDoubleValue(newValues)); >> 1008 G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl >> 1009 << " The command is obsolete and will be removed soon." << G4endl >> 1010 << " Please try to use the new structured commands!" << G4endl; >> 1011 } >> 1012 else if(command == parphiCmd) >> 1013 { >> 1014 fParticleGun->GetPosDist()->SetParPhi(parphiCmd->GetNewDoubleValue(newValues)); >> 1015 G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl >> 1016 << " The command is obsolete and will be removed soon." << G4endl >> 1017 << " Please try to use the new structured commands!" << G4endl; >> 1018 } >> 1019 else if(command == confineCmd) >> 1020 { >> 1021 fParticleGun->GetPosDist()->ConfineSourceToVolume(newValues); >> 1022 G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl >> 1023 << " The command is obsolete and will be removed soon." << G4endl >> 1024 << " Please try to use the new structured commands!" << G4endl; >> 1025 } >> 1026 else if(command == angtypeCmd) >> 1027 { >> 1028 fParticleGun->GetAngDist()->SetAngDistType(newValues); >> 1029 G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl >> 1030 << " The command is obsolete and will be removed soon." << G4endl >> 1031 << " Please try to use the new structured commands!" << G4endl; >> 1032 } >> 1033 else if(command == angrot1Cmd) >> 1034 { >> 1035 G4String a = "angref1"; >> 1036 fParticleGun->GetAngDist()->DefineAngRefAxes(a,angrot1Cmd->GetNew3VectorValue(newValues)); >> 1037 G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl >> 1038 << " The command is obsolete and will be removed soon." << G4endl >> 1039 << " Please try to use the new structured commands!" << G4endl; >> 1040 } >> 1041 else if(command == angrot2Cmd) >> 1042 { >> 1043 G4String a = "angref2"; >> 1044 fParticleGun->GetAngDist()->DefineAngRefAxes(a,angrot2Cmd->GetNew3VectorValue(newValues)); >> 1045 G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl >> 1046 << " The command is obsolete and will be removed soon." << G4endl >> 1047 << " Please try to use the new structured commands!" << G4endl; >> 1048 } >> 1049 else if(command == minthetaCmd) >> 1050 { >> 1051 fParticleGun->GetAngDist()->SetMinTheta(minthetaCmd->GetNewDoubleValue(newValues)); >> 1052 G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl >> 1053 << " The command is obsolete and will be removed soon." << G4endl >> 1054 << " Please try to use the new structured commands!" << G4endl; >> 1055 } >> 1056 else if(command == minphiCmd) >> 1057 { >> 1058 fParticleGun->GetAngDist()->SetMinPhi(minphiCmd->GetNewDoubleValue(newValues)); >> 1059 G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl >> 1060 << " The command is obsolete and will be removed soon." << G4endl >> 1061 << " Please try to use the new structured commands!" << G4endl; >> 1062 } >> 1063 else if(command == maxthetaCmd) >> 1064 { >> 1065 fParticleGun->GetAngDist()->SetMaxTheta(maxthetaCmd->GetNewDoubleValue(newValues)); >> 1066 G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl >> 1067 << " The command is obsolete and will be removed soon." << G4endl >> 1068 << " Please try to use the new structured commands!" << G4endl; >> 1069 } >> 1070 else if(command == maxphiCmd) >> 1071 { >> 1072 fParticleGun->GetAngDist()->SetMaxPhi(maxphiCmd->GetNewDoubleValue(newValues)); >> 1073 G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl >> 1074 << " The command is obsolete and will be removed soon." << G4endl >> 1075 << " Please try to use the new structured commands!" << G4endl; >> 1076 } >> 1077 else if(command == angsigmarCmd) >> 1078 { >> 1079 fParticleGun->GetAngDist()->SetBeamSigmaInAngR(angsigmarCmd->GetNewDoubleValue(newValues)); >> 1080 G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl >> 1081 << " The command is obsolete and will be removed soon." << G4endl >> 1082 << " Please try to use the new structured commands!" << G4endl; >> 1083 } >> 1084 else if(command == angsigmaxCmd) >> 1085 { >> 1086 fParticleGun->GetAngDist()->SetBeamSigmaInAngX(angsigmaxCmd->GetNewDoubleValue(newValues)); >> 1087 G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl >> 1088 << " The command is obsolete and will be removed soon." << G4endl >> 1089 << " Please try to use the new structured commands!" << G4endl; >> 1090 } >> 1091 else if(command == angsigmayCmd) >> 1092 { >> 1093 fParticleGun->GetAngDist()->SetBeamSigmaInAngY(angsigmayCmd->GetNewDoubleValue(newValues)); >> 1094 G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl >> 1095 << " The command is obsolete and will be removed soon." << G4endl >> 1096 << " Please try to use the new structured commands!" << G4endl; >> 1097 } >> 1098 else if(command == useuserangaxisCmd) >> 1099 { >> 1100 fParticleGun->GetAngDist()->SetUseUserAngAxis(useuserangaxisCmd->GetNewBoolValue(newValues)); >> 1101 G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl >> 1102 << " The command is obsolete and will be removed soon." << G4endl >> 1103 << " Please try to use the new structured commands!" << G4endl; >> 1104 } >> 1105 else if(command == surfnormCmd) >> 1106 { >> 1107 fParticleGun->GetAngDist()->SetUserWRTSurface(surfnormCmd->GetNewBoolValue(newValues)); >> 1108 G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl >> 1109 << " The command is obsolete and will be removed soon." << G4endl >> 1110 << " Please try to use the new structured commands!" << G4endl; >> 1111 } >> 1112 else if(command == energytypeCmd) >> 1113 { >> 1114 fParticleGun->GetEneDist()->SetEnergyDisType(newValues); >> 1115 G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl >> 1116 << " The command is obsolete and will be removed soon." << G4endl >> 1117 << " Please try to use the new structured commands!" << G4endl; >> 1118 } >> 1119 else if(command == eminCmd) >> 1120 { >> 1121 fParticleGun->GetEneDist()->SetEmin(eminCmd->GetNewDoubleValue(newValues)); >> 1122 G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl >> 1123 << " The command is obsolete and will be removed soon." << G4endl >> 1124 << " Please try to use the new structured commands!" << G4endl; >> 1125 } >> 1126 else if(command == emaxCmd) >> 1127 { >> 1128 fParticleGun->GetEneDist()->SetEmax(emaxCmd->GetNewDoubleValue(newValues)); >> 1129 G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl >> 1130 << " The command is obsolete and will be removed soon." << G4endl >> 1131 << " Please try to use the new structured commands!" << G4endl; >> 1132 } >> 1133 else if(command == monoenergyCmd) 1118 { 1134 { 1119 IonCommand(newValues); << 1135 fParticleGun->GetEneDist()->SetMonoEnergy(monoenergyCmd->GetNewDoubleValue(newValues)); >> 1136 G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl >> 1137 << " The command is obsolete and will be removed soon." << G4endl >> 1138 << " Please try to use the new structured commands!" << G4endl; 1120 } 1139 } 1121 else if( command==ionLvlCmd ) << 1140 else if(command == engsigmaCmd) 1122 { 1141 { 1123 IonLvlCommand(newValues); << 1142 fParticleGun->GetEneDist()->SetBeamSigmaInE(engsigmaCmd->GetNewDoubleValue(newValues)); >> 1143 G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl >> 1144 << " The command is obsolete and will be removed soon." << G4endl >> 1145 << " Please try to use the new structured commands!" << G4endl; 1124 } 1146 } 1125 else if( command==listCmd ) << 1147 else if(command == alphaCmd) >> 1148 { >> 1149 fParticleGun->GetEneDist()->SetAlpha(alphaCmd->GetNewDoubleValue(newValues)); >> 1150 G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl >> 1151 << " The command is obsolete and will be removed soon." << G4endl >> 1152 << " Please try to use the new structured commands!" << G4endl; >> 1153 } >> 1154 else if(command == tempCmd) >> 1155 { >> 1156 fParticleGun->GetEneDist()->SetTemp(tempCmd->GetNewDoubleValue(newValues)); >> 1157 G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl >> 1158 << " The command is obsolete and will be removed soon." << G4endl >> 1159 << " Please try to use the new structured commands!" << G4endl; >> 1160 } >> 1161 else if(command == ezeroCmd) >> 1162 { >> 1163 fParticleGun->GetEneDist()->SetEzero(ezeroCmd->GetNewDoubleValue(newValues)); >> 1164 G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl >> 1165 << " The command is obsolete and will be removed soon." << G4endl >> 1166 << " Please try to use the new structured commands!" << G4endl; >> 1167 } >> 1168 else if(command == gradientCmd) >> 1169 { >> 1170 fParticleGun->GetEneDist()->SetGradient(gradientCmd->GetNewDoubleValue(newValues)); >> 1171 G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl >> 1172 << " The command is obsolete and will be removed soon." << G4endl >> 1173 << " Please try to use the new structured commands!" << G4endl; >> 1174 } >> 1175 else if(command == interceptCmd) >> 1176 { >> 1177 fParticleGun->GetEneDist()->SetInterCept(interceptCmd->GetNewDoubleValue(newValues)); >> 1178 G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl >> 1179 << " The command is obsolete and will be removed soon." << G4endl >> 1180 << " Please try to use the new structured commands!" << G4endl; >> 1181 } >> 1182 else if(command == calculateCmd) >> 1183 { >> 1184 fParticleGun->GetEneDist()->Calculate(); >> 1185 G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl >> 1186 << " The command is obsolete and will be removed soon." << G4endl >> 1187 << " Please try to use the new structured commands!" << G4endl; >> 1188 } >> 1189 else if(command == energyspecCmd) >> 1190 { >> 1191 fParticleGun->GetEneDist()->InputEnergySpectra(energyspecCmd->GetNewBoolValue(newValues)); >> 1192 G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl >> 1193 << " The command is obsolete and will be removed soon." << G4endl >> 1194 << " Please try to use the new structured commands!" << G4endl; >> 1195 } >> 1196 else if(command == diffspecCmd) >> 1197 { >> 1198 fParticleGun->GetEneDist()->InputDifferentialSpectra(diffspecCmd->GetNewBoolValue(newValues)); >> 1199 G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl >> 1200 << " The command is obsolete and will be removed soon." << G4endl >> 1201 << " Please try to use the new structured commands!" << G4endl; >> 1202 } >> 1203 else if(command == histnameCmd) >> 1204 { >> 1205 histtype = newValues; >> 1206 G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl >> 1207 << " The command is obsolete and will be removed soon." << G4endl >> 1208 << " Please try to use the new structured commands!" << G4endl; >> 1209 } >> 1210 else if(command == histpointCmd) >> 1211 { >> 1212 if(histtype == "biasx") >> 1213 fParticleGun->GetBiasRndm()->SetXBias(histpointCmd->GetNew3VectorValue(newValues)); >> 1214 if(histtype == "biasy") >> 1215 fParticleGun->GetBiasRndm()->SetYBias(histpointCmd->GetNew3VectorValue(newValues)); >> 1216 if(histtype == "biasz") >> 1217 fParticleGun->GetBiasRndm()->SetZBias(histpointCmd->GetNew3VectorValue(newValues)); >> 1218 if(histtype == "biast") >> 1219 fParticleGun->GetBiasRndm()->SetThetaBias(histpointCmd->GetNew3VectorValue(newValues)); >> 1220 if(histtype == "biasp") >> 1221 fParticleGun->GetBiasRndm()->SetPhiBias(histpointCmd->GetNew3VectorValue(newValues)); >> 1222 if(histtype == "biase") >> 1223 fParticleGun->GetBiasRndm()->SetEnergyBias(histpointCmd->GetNew3VectorValue(newValues)); >> 1224 if(histtype == "theta") >> 1225 fParticleGun->GetAngDist()->UserDefAngTheta(histpointCmd->GetNew3VectorValue(newValues)); >> 1226 if(histtype == "phi") >> 1227 fParticleGun->GetAngDist()->UserDefAngPhi(histpointCmd->GetNew3VectorValue(newValues)); >> 1228 if(histtype == "energy") >> 1229 fParticleGun->GetEneDist()->UserEnergyHisto(histpointCmd->GetNew3VectorValue(newValues)); >> 1230 if(histtype == "arb") >> 1231 fParticleGun->GetEneDist()->ArbEnergyHisto(histpointCmd->GetNew3VectorValue(newValues)); >> 1232 if(histtype == "epn") >> 1233 fParticleGun->GetEneDist()->EpnEnergyHisto(histpointCmd->GetNew3VectorValue(newValues)); >> 1234 G4cout << " G4GeneralParticleSourceMessenger - Warning: The command is obsolete and will be removed soon. Please try to use the new structured commands!" << G4endl; >> 1235 } >> 1236 else if(command == resethistCmd) >> 1237 { >> 1238 if(newValues == "theta" || newValues == "phi") { >> 1239 fParticleGun->GetAngDist()->ReSetHist(newValues); >> 1240 } else if (newValues == "energy" || newValues == "arb" || newValues == "epn") { >> 1241 fParticleGun->GetEneDist()->ReSetHist(newValues); >> 1242 } else { >> 1243 fParticleGun->GetBiasRndm()->ReSetHist(newValues); >> 1244 } >> 1245 G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl >> 1246 << " The command is obsolete and will be removed soon." << G4endl >> 1247 << " Please try to use the new structured commands!" << G4endl; >> 1248 } >> 1249 else if(command == arbintCmd) >> 1250 { >> 1251 fParticleGun->GetEneDist()->ArbInterpolate(newValues); >> 1252 G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl >> 1253 << " The command is obsolete and will be removed soon." << G4endl >> 1254 << " Please try to use the new structured commands!" << G4endl; >> 1255 } >> 1256 else if( command==directionCmd ) 1126 { 1257 { 1127 particleTable->DumpTable(); << 1258 fParticleGun->GetAngDist()->SetAngDistType("planar"); >> 1259 fParticleGun->GetAngDist()->SetParticleMomentumDirection(directionCmd->GetNew3VectorValue(newValues)); 1128 } 1260 } 1129 else if( command==addsourceCmd ) << 1261 else if( command==energyCmd ) >> 1262 { >> 1263 fParticleGun->GetEneDist()->SetEnergyDisType("Mono"); >> 1264 fParticleGun->GetEneDist()->SetMonoEnergy(energyCmd->GetNewDoubleValue(newValues)); >> 1265 } >> 1266 else if( command==positionCmd ) >> 1267 { >> 1268 fParticleGun->GetPosDist()->SetPosDisType("Point"); >> 1269 fParticleGun->GetPosDist()->SetCentreCoords(positionCmd->GetNew3VectorValue(newValues)); >> 1270 } >> 1271 else if(command == verbosityCmd) >> 1272 { >> 1273 fParticleGun->SetVerbosity(verbosityCmd->GetNewIntValue(newValues)); >> 1274 } >> 1275 else if( command==particleCmd ) 1130 { 1276 { >> 1277 if (newValues =="ion") { >> 1278 fShootIon = true; >> 1279 } else { >> 1280 fShootIon = false; >> 1281 G4ParticleDefinition* pd = particleTable->FindParticle(newValues); >> 1282 if(pd != NULL) >> 1283 { fParticleGun->SetParticleDefinition( pd ); } >> 1284 } >> 1285 } >> 1286 else if( command==timeCmd ) >> 1287 { fParticleGun->SetParticleTime(timeCmd->GetNewDoubleValue(newValues)); } >> 1288 else if( command==polCmd ) >> 1289 { fParticleGun->SetParticlePolarization(polCmd->GetNew3VectorValue(newValues)); } >> 1290 else if( command==numberCmd ) >> 1291 { fParticleGun->SetNumberOfParticles(numberCmd->GetNewIntValue(newValues)); } >> 1292 else if( command==ionCmd ) >> 1293 { IonCommand(newValues); } >> 1294 else if( command==listCmd ){ >> 1295 particleTable->DumpTable(); >> 1296 } >> 1297 else if( command==addsourceCmd ) >> 1298 { 1131 fGPS->AddaSource(addsourceCmd->GetNewDo 1299 fGPS->AddaSource(addsourceCmd->GetNewDoubleValue(newValues)); 1132 } 1300 } 1133 else if( command==listsourceCmd ) 1301 else if( command==listsourceCmd ) 1134 { 1302 { 1135 fGPS->ListSource(); 1303 fGPS->ListSource(); 1136 } 1304 } 1137 else if( command==clearsourceCmd ) 1305 else if( command==clearsourceCmd ) 1138 { 1306 { 1139 fGPS->ClearAll(); 1307 fGPS->ClearAll(); 1140 fParticleGun = nullptr; << 1141 } 1308 } 1142 else if( command==getsourceCmd ) 1309 else if( command==getsourceCmd ) 1143 { 1310 { 1144 G4cout << " Current source index:" << f 1311 G4cout << " Current source index:" << fGPS->GetCurrentSourceIndex() 1145 << " ; Intensity:" << fGPS->GetC << 1312 << " ; Intensity:" << fGPS->GetCurrentSourceIntensity() << G4endl; 1146 } 1313 } 1147 else if( command==setsourceCmd ) 1314 else if( command==setsourceCmd ) 1148 { 1315 { 1149 // NOTE: This will also sets fParticleG << 1150 // Not very clean, the GPS::SetCu << 1151 // SetParticleSource( G4ParticleS << 1152 // The point is that GPS has no p << 1153 // TODO: Can we add this API? << 1154 const G4int sn = setsourceCmd->GetNewIn << 1155 if ( sn >= fGPS->GetNumberofSource() ) << 1156 { << 1157 G4ExceptionDescription msg; << 1158 msg << "Using command " << setsourceC << 1159 << setsourceCmd->GetCommandName() << 1160 msg << " is invalid " << fGPS->GetNum << 1161 << " source(s) are defined."; << 1162 G4Exception("G4GeneralParticleSourceM << 1163 "G4GPS005", FatalExceptio << 1164 } << 1165 fGPS->SetCurrentSourceto(setsourceCmd-> 1316 fGPS->SetCurrentSourceto(setsourceCmd->GetNewIntValue(newValues)); 1166 } 1317 } 1167 else if( command==setintensityCmd ) 1318 else if( command==setintensityCmd ) 1168 { 1319 { 1169 fGPS->SetCurrentSourceIntensity(setinte 1320 fGPS->SetCurrentSourceIntensity(setintensityCmd->GetNewDoubleValue(newValues)); 1170 } 1321 } 1171 else if( command==deletesourceCmd ) 1322 else if( command==deletesourceCmd ) 1172 { 1323 { 1173 fGPS->DeleteaSource(deletesourceCmd->Ge 1324 fGPS->DeleteaSource(deletesourceCmd->GetNewIntValue(newValues)); 1174 } 1325 } 1175 else if(command == multiplevertexCmd) 1326 else if(command == multiplevertexCmd) 1176 { 1327 { 1177 fGPS->SetMultipleVertex(multiplevertexC 1328 fGPS->SetMultipleVertex(multiplevertexCmd->GetNewBoolValue(newValues)); 1178 } 1329 } 1179 else if(command == flatsamplingCmd) << 1180 { << 1181 fGPS->SetFlatSampling(flatsamplingCmd-> << 1182 } << 1183 // 1330 // 1184 // new implementations 1331 // new implementations 1185 // 1332 // >> 1333 // 1186 else if(command == typeCmd1) 1334 else if(command == typeCmd1) 1187 { 1335 { 1188 CHECKPG(); << 1189 fParticleGun->GetPosDist()->SetPosDisTy 1336 fParticleGun->GetPosDist()->SetPosDisType(newValues); 1190 } 1337 } 1191 else if(command == shapeCmd1) 1338 else if(command == shapeCmd1) 1192 { 1339 { 1193 CHECKPG(); << 1194 fParticleGun->GetPosDist()->SetPosDisSh 1340 fParticleGun->GetPosDist()->SetPosDisShape(newValues); 1195 } 1341 } 1196 else if(command == centreCmd1) 1342 else if(command == centreCmd1) 1197 { 1343 { 1198 CHECKPG(); << 1199 fParticleGun->GetPosDist()->SetCentreCo 1344 fParticleGun->GetPosDist()->SetCentreCoords(centreCmd1->GetNew3VectorValue(newValues)); 1200 } 1345 } 1201 else if(command == posrot1Cmd1) 1346 else if(command == posrot1Cmd1) 1202 { 1347 { 1203 CHECKPG(); << 1204 fParticleGun->GetPosDist()->SetPosRot1( 1348 fParticleGun->GetPosDist()->SetPosRot1(posrot1Cmd1->GetNew3VectorValue(newValues)); 1205 } 1349 } 1206 else if(command == posrot2Cmd1) 1350 else if(command == posrot2Cmd1) 1207 { 1351 { 1208 CHECKPG(); << 1209 fParticleGun->GetPosDist()->SetPosRot2( 1352 fParticleGun->GetPosDist()->SetPosRot2(posrot2Cmd1->GetNew3VectorValue(newValues)); 1210 } 1353 } 1211 else if(command == halfxCmd1) 1354 else if(command == halfxCmd1) 1212 { 1355 { 1213 CHECKPG(); << 1214 fParticleGun->GetPosDist()->SetHalfX(ha 1356 fParticleGun->GetPosDist()->SetHalfX(halfxCmd1->GetNewDoubleValue(newValues)); 1215 } 1357 } 1216 else if(command == halfyCmd1) 1358 else if(command == halfyCmd1) 1217 { 1359 { 1218 CHECKPG(); << 1219 fParticleGun->GetPosDist()->SetHalfY(ha 1360 fParticleGun->GetPosDist()->SetHalfY(halfyCmd1->GetNewDoubleValue(newValues)); 1220 } 1361 } 1221 else if(command == halfzCmd1) 1362 else if(command == halfzCmd1) 1222 { 1363 { 1223 CHECKPG(); << 1224 fParticleGun->GetPosDist()->SetHalfZ(ha 1364 fParticleGun->GetPosDist()->SetHalfZ(halfzCmd1->GetNewDoubleValue(newValues)); 1225 } 1365 } 1226 else if(command == radiusCmd1) 1366 else if(command == radiusCmd1) 1227 { 1367 { 1228 CHECKPG(); << 1229 fParticleGun->GetPosDist()->SetRadius(r 1368 fParticleGun->GetPosDist()->SetRadius(radiusCmd1->GetNewDoubleValue(newValues)); 1230 } 1369 } 1231 else if(command == radius0Cmd1) 1370 else if(command == radius0Cmd1) 1232 { 1371 { 1233 CHECKPG(); << 1234 fParticleGun->GetPosDist()->SetRadius0( 1372 fParticleGun->GetPosDist()->SetRadius0(radius0Cmd1->GetNewDoubleValue(newValues)); 1235 } 1373 } 1236 else if(command == possigmarCmd1) 1374 else if(command == possigmarCmd1) 1237 { 1375 { 1238 CHECKPG(); << 1239 fParticleGun->GetPosDist()->SetBeamSigm 1376 fParticleGun->GetPosDist()->SetBeamSigmaInR(possigmarCmd1->GetNewDoubleValue(newValues)); 1240 } 1377 } 1241 else if(command == possigmaxCmd1) 1378 else if(command == possigmaxCmd1) 1242 { 1379 { 1243 CHECKPG(); << 1244 fParticleGun->GetPosDist()->SetBeamSigm 1380 fParticleGun->GetPosDist()->SetBeamSigmaInX(possigmaxCmd1->GetNewDoubleValue(newValues)); 1245 } 1381 } 1246 else if(command == possigmayCmd1) 1382 else if(command == possigmayCmd1) 1247 { 1383 { 1248 CHECKPG(); << 1249 fParticleGun->GetPosDist()->SetBeamSigm 1384 fParticleGun->GetPosDist()->SetBeamSigmaInY(possigmayCmd1->GetNewDoubleValue(newValues)); 1250 } 1385 } 1251 else if(command == paralpCmd1) 1386 else if(command == paralpCmd1) 1252 { 1387 { 1253 CHECKPG(); << 1254 fParticleGun->GetPosDist()->SetParAlpha 1388 fParticleGun->GetPosDist()->SetParAlpha(paralpCmd1->GetNewDoubleValue(newValues)); 1255 } 1389 } 1256 else if(command == partheCmd1) 1390 else if(command == partheCmd1) 1257 { 1391 { 1258 CHECKPG(); << 1259 fParticleGun->GetPosDist()->SetParTheta 1392 fParticleGun->GetPosDist()->SetParTheta(partheCmd1->GetNewDoubleValue(newValues)); 1260 } 1393 } 1261 else if(command == parphiCmd1) 1394 else if(command == parphiCmd1) 1262 { 1395 { 1263 CHECKPG(); << 1264 fParticleGun->GetPosDist()->SetParPhi(p 1396 fParticleGun->GetPosDist()->SetParPhi(parphiCmd1->GetNewDoubleValue(newValues)); 1265 } 1397 } 1266 else if(command == confineCmd1) 1398 else if(command == confineCmd1) 1267 { 1399 { 1268 CHECKPG(); << 1269 fParticleGun->GetPosDist()->ConfineSour 1400 fParticleGun->GetPosDist()->ConfineSourceToVolume(newValues); 1270 } 1401 } 1271 else if(command == angtypeCmd1) 1402 else if(command == angtypeCmd1) 1272 { 1403 { 1273 CHECKPG(); << 1274 fParticleGun->GetAngDist()->SetAngDistT 1404 fParticleGun->GetAngDist()->SetAngDistType(newValues); 1275 } 1405 } 1276 else if(command == angrot1Cmd1) 1406 else if(command == angrot1Cmd1) 1277 { 1407 { 1278 CHECKPG(); << 1279 G4String a = "angref1"; 1408 G4String a = "angref1"; 1280 fParticleGun->GetAngDist()->DefineAngRe 1409 fParticleGun->GetAngDist()->DefineAngRefAxes(a,angrot1Cmd1->GetNew3VectorValue(newValues)); 1281 } 1410 } 1282 else if(command == angrot2Cmd1) 1411 else if(command == angrot2Cmd1) 1283 { 1412 { 1284 CHECKPG(); << 1285 G4String a = "angref2"; 1413 G4String a = "angref2"; 1286 fParticleGun->GetAngDist()->DefineAngRe 1414 fParticleGun->GetAngDist()->DefineAngRefAxes(a,angrot2Cmd1->GetNew3VectorValue(newValues)); 1287 } 1415 } 1288 else if(command == minthetaCmd1) 1416 else if(command == minthetaCmd1) 1289 { 1417 { 1290 CHECKPG(); << 1291 fParticleGun->GetAngDist()->SetMinTheta 1418 fParticleGun->GetAngDist()->SetMinTheta(minthetaCmd1->GetNewDoubleValue(newValues)); 1292 } 1419 } 1293 else if(command == minphiCmd1) 1420 else if(command == minphiCmd1) 1294 { 1421 { 1295 CHECKPG(); << 1296 fParticleGun->GetAngDist()->SetMinPhi(m 1422 fParticleGun->GetAngDist()->SetMinPhi(minphiCmd1->GetNewDoubleValue(newValues)); 1297 } 1423 } 1298 else if(command == maxthetaCmd1) 1424 else if(command == maxthetaCmd1) 1299 { 1425 { 1300 CHECKPG(); << 1301 fParticleGun->GetAngDist()->SetMaxTheta 1426 fParticleGun->GetAngDist()->SetMaxTheta(maxthetaCmd1->GetNewDoubleValue(newValues)); 1302 } 1427 } 1303 else if(command == maxphiCmd1) 1428 else if(command == maxphiCmd1) 1304 { 1429 { 1305 CHECKPG(); << 1306 fParticleGun->GetAngDist()->SetMaxPhi(m 1430 fParticleGun->GetAngDist()->SetMaxPhi(maxphiCmd1->GetNewDoubleValue(newValues)); 1307 } 1431 } 1308 else if(command == angsigmarCmd1) 1432 else if(command == angsigmarCmd1) 1309 { 1433 { 1310 CHECKPG(); << 1311 fParticleGun->GetAngDist()->SetBeamSigm 1434 fParticleGun->GetAngDist()->SetBeamSigmaInAngR(angsigmarCmd1->GetNewDoubleValue(newValues)); 1312 } 1435 } 1313 else if(command == angsigmaxCmd1) 1436 else if(command == angsigmaxCmd1) 1314 { 1437 { 1315 CHECKPG(); << 1316 fParticleGun->GetAngDist()->SetBeamSigm 1438 fParticleGun->GetAngDist()->SetBeamSigmaInAngX(angsigmaxCmd1->GetNewDoubleValue(newValues)); 1317 } 1439 } 1318 else if(command == angsigmayCmd1) 1440 else if(command == angsigmayCmd1) 1319 { 1441 { 1320 CHECKPG(); << 1321 fParticleGun->GetAngDist()->SetBeamSigm 1442 fParticleGun->GetAngDist()->SetBeamSigmaInAngY(angsigmayCmd1->GetNewDoubleValue(newValues)); 1322 } 1443 } 1323 else if(command == angfocusCmd) 1444 else if(command == angfocusCmd) 1324 { 1445 { 1325 CHECKPG(); << 1326 fParticleGun->GetAngDist()->SetFocusPoi 1446 fParticleGun->GetAngDist()->SetFocusPoint(angfocusCmd->GetNew3VectorValue(newValues)); 1327 } 1447 } 1328 else if(command == useuserangaxisCmd1) 1448 else if(command == useuserangaxisCmd1) 1329 { 1449 { 1330 CHECKPG(); << 1331 fParticleGun->GetAngDist()->SetUseUserA 1450 fParticleGun->GetAngDist()->SetUseUserAngAxis(useuserangaxisCmd1->GetNewBoolValue(newValues)); 1332 } 1451 } 1333 else if(command == surfnormCmd1) 1452 else if(command == surfnormCmd1) 1334 { 1453 { 1335 CHECKPG(); << 1336 fParticleGun->GetAngDist()->SetUserWRTS 1454 fParticleGun->GetAngDist()->SetUserWRTSurface(surfnormCmd1->GetNewBoolValue(newValues)); 1337 } 1455 } 1338 else if(command == energytypeCmd1) 1456 else if(command == energytypeCmd1) 1339 { 1457 { 1340 CHECKPG(); << 1458 fParticleGun->GetEneDist()->SetEnergyDisType(newValues); 1341 if(newValues=="LW") << 1342 { << 1343 fParticleGun->GetEneDist()->SetEnergy << 1344 fParticleGun->GetEneDist()->SetGradie << 1345 fParticleGun->GetEneDist()->SetInterC << 1346 fParticleGun->GetEneDist()->ApplyEner << 1347 } << 1348 else << 1349 { << 1350 fParticleGun->GetEneDist()->SetEnergy << 1351 fParticleGun->GetEneDist()->ApplyEner << 1352 } << 1353 } 1459 } 1354 else if(command == eminCmd1) 1460 else if(command == eminCmd1) 1355 { 1461 { 1356 CHECKPG(); << 1357 fParticleGun->GetEneDist()->SetEmin(emi 1462 fParticleGun->GetEneDist()->SetEmin(eminCmd1->GetNewDoubleValue(newValues)); 1358 } 1463 } 1359 else if(command == emaxCmd1) 1464 else if(command == emaxCmd1) 1360 { 1465 { 1361 CHECKPG(); << 1362 fParticleGun->GetEneDist()->SetEmax(ema 1466 fParticleGun->GetEneDist()->SetEmax(emaxCmd1->GetNewDoubleValue(newValues)); 1363 } 1467 } 1364 else if(command == monoenergyCmd1) 1468 else if(command == monoenergyCmd1) 1365 { 1469 { 1366 CHECKPG(); << 1367 fParticleGun->GetEneDist()->SetMonoEner 1470 fParticleGun->GetEneDist()->SetMonoEnergy(monoenergyCmd1->GetNewDoubleValue(newValues)); 1368 } 1471 } 1369 else if(command == engsigmaCmd1) 1472 else if(command == engsigmaCmd1) 1370 { 1473 { 1371 CHECKPG(); << 1372 fParticleGun->GetEneDist()->SetBeamSigm 1474 fParticleGun->GetEneDist()->SetBeamSigmaInE(engsigmaCmd1->GetNewDoubleValue(newValues)); 1373 } 1475 } 1374 else if(command == alphaCmd1) 1476 else if(command == alphaCmd1) 1375 { 1477 { 1376 CHECKPG(); << 1377 fParticleGun->GetEneDist()->SetAlpha(al 1478 fParticleGun->GetEneDist()->SetAlpha(alphaCmd1->GetNewDoubleValue(newValues)); 1378 } 1479 } 1379 else if(command == tempCmd1) 1480 else if(command == tempCmd1) 1380 { 1481 { 1381 CHECKPG(); << 1382 fParticleGun->GetEneDist()->SetTemp(tem 1482 fParticleGun->GetEneDist()->SetTemp(tempCmd1->GetNewDoubleValue(newValues)); 1383 } 1483 } 1384 else if(command == ezeroCmd1) 1484 else if(command == ezeroCmd1) 1385 { 1485 { 1386 CHECKPG(); << 1387 fParticleGun->GetEneDist()->SetEzero(ez 1486 fParticleGun->GetEneDist()->SetEzero(ezeroCmd1->GetNewDoubleValue(newValues)); 1388 } 1487 } 1389 else if(command == gradientCmd1) 1488 else if(command == gradientCmd1) 1390 { 1489 { 1391 CHECKPG(); << 1392 fParticleGun->GetEneDist()->SetGradient 1490 fParticleGun->GetEneDist()->SetGradient(gradientCmd1->GetNewDoubleValue(newValues)); 1393 } 1491 } 1394 else if(command == interceptCmd1) 1492 else if(command == interceptCmd1) 1395 { 1493 { 1396 CHECKPG(); << 1397 fParticleGun->GetEneDist()->SetInterCep 1494 fParticleGun->GetEneDist()->SetInterCept(interceptCmd1->GetNewDoubleValue(newValues)); 1398 } 1495 } 1399 else if(command == arbeintCmd1) << 1400 { << 1401 CHECKPG(); << 1402 fParticleGun->GetEneDist()->SetBiasAlph << 1403 } << 1404 else if(command == calculateCmd1) 1496 else if(command == calculateCmd1) 1405 { 1497 { 1406 CHECKPG(); << 1407 fParticleGun->GetEneDist()->Calculate() 1498 fParticleGun->GetEneDist()->Calculate(); 1408 } 1499 } 1409 else if(command == energyspecCmd1) 1500 else if(command == energyspecCmd1) 1410 { 1501 { 1411 CHECKPG(); << 1412 fParticleGun->GetEneDist()->InputEnergy 1502 fParticleGun->GetEneDist()->InputEnergySpectra(energyspecCmd1->GetNewBoolValue(newValues)); 1413 } 1503 } 1414 else if(command == diffspecCmd1) 1504 else if(command == diffspecCmd1) 1415 { 1505 { 1416 CHECKPG(); << 1417 fParticleGun->GetEneDist()->InputDiffer 1506 fParticleGun->GetEneDist()->InputDifferentialSpectra(diffspecCmd1->GetNewBoolValue(newValues)); 1418 } 1507 } 1419 else if(command == applyEnergyWeightCmd1) << 1420 { << 1421 CHECKPG(); << 1422 const auto& eDisType = fParticleGun->Ge << 1423 if(eDisType != "Lin") << 1424 { << 1425 G4ExceptionDescription ed; << 1426 ed << "Energy distribution is defined << 1427 command->CommandFailed(ed); << 1428 return; << 1429 } << 1430 fParticleGun->GetEneDist()->ApplyEnergy << 1431 } << 1432 else if(command == histnameCmd1) 1508 else if(command == histnameCmd1) 1433 { 1509 { 1434 histtype = newValues; 1510 histtype = newValues; 1435 } 1511 } 1436 else if(command == histfileCmd1) << 1437 { << 1438 histtype = "arb"; << 1439 CHECKPG(); << 1440 fParticleGun->GetEneDist()->ArbEnergyHi << 1441 } << 1442 else if(command == histpointCmd1) 1512 else if(command == histpointCmd1) 1443 { 1513 { 1444 CHECKPG(); << 1445 if(histtype == "biasx") 1514 if(histtype == "biasx") 1446 fParticleGun->GetBiasRndm()->SetXBias << 1515 fParticleGun->GetBiasRndm()->SetXBias(histpointCmd1->GetNew3VectorValue(newValues)); 1447 if(histtype == "biasy") 1516 if(histtype == "biasy") 1448 fParticleGun->GetBiasRndm()->SetYBias << 1517 fParticleGun->GetBiasRndm()->SetYBias(histpointCmd1->GetNew3VectorValue(newValues)); 1449 if(histtype == "biasz") 1518 if(histtype == "biasz") 1450 fParticleGun->GetBiasRndm()->SetZBias << 1519 fParticleGun->GetBiasRndm()->SetZBias(histpointCmd1->GetNew3VectorValue(newValues)); 1451 if(histtype == "biast") 1520 if(histtype == "biast") 1452 fParticleGun->GetBiasRndm()->SetTheta << 1521 fParticleGun->GetBiasRndm()->SetThetaBias(histpointCmd1->GetNew3VectorValue(newValues)); 1453 if(histtype == "biasp") 1522 if(histtype == "biasp") 1454 fParticleGun->GetBiasRndm()->SetPhiBi << 1523 fParticleGun->GetBiasRndm()->SetPhiBias(histpointCmd1->GetNew3VectorValue(newValues)); 1455 if(histtype == "biaspt") 1524 if(histtype == "biaspt") 1456 fParticleGun->GetBiasRndm()->SetPosTh << 1525 fParticleGun->GetBiasRndm()->SetPosThetaBias(histpointCmd1->GetNew3VectorValue(newValues)); 1457 if(histtype == "biaspp") 1526 if(histtype == "biaspp") 1458 fParticleGun->GetBiasRndm()->SetPosPh << 1527 fParticleGun->GetBiasRndm()->SetPosPhiBias(histpointCmd1->GetNew3VectorValue(newValues)); 1459 if(histtype == "biase") 1528 if(histtype == "biase") 1460 fParticleGun->GetBiasRndm()->SetEnerg << 1529 fParticleGun->GetBiasRndm()->SetEnergyBias(histpointCmd1->GetNew3VectorValue(newValues)); 1461 if(histtype == "theta") 1530 if(histtype == "theta") 1462 fParticleGun->GetAngDist()->UserDefAn << 1531 fParticleGun->GetAngDist()->UserDefAngTheta(histpointCmd1->GetNew3VectorValue(newValues)); 1463 if(histtype == "phi") 1532 if(histtype == "phi") 1464 fParticleGun->GetAngDist()->UserDefAn << 1533 fParticleGun->GetAngDist()->UserDefAngPhi(histpointCmd1->GetNew3VectorValue(newValues)); 1465 if(histtype == "energy") 1534 if(histtype == "energy") 1466 fParticleGun->GetEneDist()->UserEnerg << 1535 fParticleGun->GetEneDist()->UserEnergyHisto(histpointCmd1->GetNew3VectorValue(newValues)); 1467 if(histtype == "arb") 1536 if(histtype == "arb") 1468 fParticleGun->GetEneDist()->ArbEnergy << 1537 fParticleGun->GetEneDist()->ArbEnergyHisto(histpointCmd1->GetNew3VectorValue(newValues)); 1469 if(histtype == "epn") 1538 if(histtype == "epn") 1470 fParticleGun->GetEneDist()->EpnEnergy << 1539 fParticleGun->GetEneDist()->EpnEnergyHisto(histpointCmd1->GetNew3VectorValue(newValues)); 1471 } 1540 } 1472 else if(command == resethistCmd1) 1541 else if(command == resethistCmd1) 1473 { 1542 { 1474 CHECKPG(); << 1543 if(newValues == "theta" || newValues == "phi") { 1475 if(newValues == "theta" || newValues == << 1544 fParticleGun->GetAngDist()->ReSetHist(newValues); 1476 { << 1545 } else if (newValues == "energy" || newValues == "arb" || newValues == "epn") { 1477 fParticleGun->GetAngDist()->ReSetHist << 1546 fParticleGun->GetEneDist()->ReSetHist(newValues); 1478 } << 1547 } else { 1479 else if (newValues == "energy" || newVa << 1548 fParticleGun->GetBiasRndm()->ReSetHist(newValues); 1480 { << 1481 fParticleGun->GetEneDist()->ReSetHist << 1482 } << 1483 else << 1484 { << 1485 fParticleGun->GetBiasRndm()->ReSetHis << 1486 } 1549 } 1487 } 1550 } 1488 else if(command == arbintCmd1) 1551 else if(command == arbintCmd1) 1489 { 1552 { 1490 CHECKPG(); fParticleGun->GetEneDist()-> << 1553 fParticleGun->GetEneDist()->ArbInterpolate(newValues); 1491 } 1554 } 1492 else 1555 else 1493 { 1556 { 1494 G4cout << "Error entering command" << G 1557 G4cout << "Error entering command" << G4endl; 1495 } 1558 } 1496 } 1559 } 1497 1560 1498 G4String G4GeneralParticleSourceMessenger::Ge << 1561 G4String G4GeneralParticleSourceMessenger::GetCurrentValue(G4UIcommand *) 1499 { 1562 { 1500 G4String cv; 1563 G4String cv; 1501 1564 1502 if( command==volChkCmd ) << 1503 { cv = volChkCmd->ConvertToString(fParticle << 1504 else << 1505 { << 1506 // if( command==directionCmd ) 1565 // if( command==directionCmd ) 1507 // { cv = directionCmd->ConvertToString(fP 1566 // { cv = directionCmd->ConvertToString(fParticleGun->GetParticleMomentumDirection()); } 1508 // else if( command==energyCmd ) 1567 // else if( command==energyCmd ) 1509 // { cv = energyCmd->ConvertToString(fPart 1568 // { cv = energyCmd->ConvertToString(fParticleGun->GetParticleEnergy(),"GeV"); } 1510 // else if( command==positionCmd ) 1569 // else if( command==positionCmd ) 1511 // { cv = positionCmd->ConvertToString(fPa 1570 // { cv = positionCmd->ConvertToString(fParticleGun->GetParticlePosition(),"cm"); } 1512 // else if( command==timeCmd ) 1571 // else if( command==timeCmd ) 1513 // { cv = timeCmd->ConvertToString(fPartic 1572 // { cv = timeCmd->ConvertToString(fParticleGun->GetParticleTime(),"ns"); } 1514 // else if( command==polCmd ) 1573 // else if( command==polCmd ) 1515 // { cv = polCmd->ConvertToString(fParticl 1574 // { cv = polCmd->ConvertToString(fParticleGun->GetParticlePolarization()); } 1516 // else if( command==numberCmd ) 1575 // else if( command==numberCmd ) 1517 // { cv = numberCmd->ConvertToString(fPart 1576 // { cv = numberCmd->ConvertToString(fParticleGun->GetNumberOfParticles()); } 1518 1577 1519 cv = "Not implemented yet"; 1578 cv = "Not implemented yet"; 1520 } << 1521 1579 1522 return cv; 1580 return cv; 1523 } 1581 } 1524 1582 1525 void G4GeneralParticleSourceMessenger::IonCom << 1583 void G4GeneralParticleSourceMessenger::IonCommand(G4String newValues) 1526 { 1584 { >> 1585 fShootIon = true; >> 1586 1527 if (fShootIon) 1587 if (fShootIon) 1528 { 1588 { 1529 G4Tokenizer next( newValues ); 1589 G4Tokenizer next( newValues ); 1530 // check argument 1590 // check argument 1531 fAtomicNumber = StoI(next()); 1591 fAtomicNumber = StoI(next()); 1532 fAtomicMass = StoI(next()); 1592 fAtomicMass = StoI(next()); 1533 G4String sQ = next(); 1593 G4String sQ = next(); 1534 if (sQ.empty()) << 1594 if (sQ.isNull()) 1535 { 1595 { 1536 fIonCharge = fAtomicNumber; << 1596 fIonCharge = fAtomicNumber; 1537 } 1597 } 1538 else 1598 else 1539 { 1599 { 1540 fIonCharge = StoI(sQ); << 1600 fIonCharge = StoI(sQ); 1541 sQ = next(); << 1601 sQ = next(); 1542 if (sQ.empty()) << 1602 if (sQ.isNull()) 1543 { 1603 { 1544 fIonExciteEnergy = 0.0; << 1604 fIonExciteEnergy = 0.0; 1545 } 1605 } 1546 else 1606 else 1547 { 1607 { 1548 fIonExciteEnergy = StoD(sQ) * keV; << 1608 fIonExciteEnergy = StoD(sQ) * keV; 1549 } 1609 } 1550 } 1610 } 1551 G4ParticleDefinition* ion = G4IonTable::G << 1611 G4ParticleDefinition* ion; 1552 ->GetIon(fAtomicNumber, fAtomicMass, << 1612 ion = particleTable->GetIon( fAtomicNumber, fAtomicMass, fIonExciteEnergy); 1553 if (ion==nullptr) << 1613 if (ion==0) 1554 { << 1555 G4ExceptionDescription ed; << 1556 ed << "Ion with Z=" << fAtomicNumber; << 1557 ed << " A=" << fAtomicMass << " is not << 1558 ionCmd->CommandFailed(ed); << 1559 } << 1560 else << 1561 { 1614 { 1562 fParticleGun->SetParticleDefinition(ion << 1615 G4cout << "Ion with Z=" << fAtomicNumber; 1563 fParticleGun->SetParticleCharge(fIonCha << 1616 G4cout << " A=" << fAtomicMass << "is not be defined" << G4endl; 1564 } << 1565 } << 1566 else << 1567 { << 1568 G4ExceptionDescription ed; << 1569 ed << "Set /gps/particle to ion before us << 1570 ionCmd->CommandFailed(ed); << 1571 } << 1572 } << 1573 << 1574 void G4GeneralParticleSourceMessenger::IonLvl << 1575 { << 1576 if (fShootIon) << 1577 { << 1578 G4Tokenizer next(newValues); << 1579 // check argument << 1580 fAtomicNumberL = StoI(next()); << 1581 fAtomicMassL = StoI(next()); << 1582 G4String sQ = next(); << 1583 if (sQ.empty()) << 1584 { << 1585 fIonChargeL = fAtomicNumberL; << 1586 } << 1587 else << 1588 { << 1589 fIonChargeL = StoI(sQ); << 1590 sQ = next(); << 1591 if (sQ.empty()) << 1592 { << 1593 fIonEnergyLevel = 0; << 1594 } << 1595 else << 1596 { << 1597 fIonEnergyLevel = StoI(sQ); << 1598 } << 1599 } << 1600 << 1601 G4ParticleDefinition* ion = G4IonTable::G << 1602 ->GetIon(fAtomicNumberL, fAtomicMassL << 1603 if (ion == nullptr) << 1604 { << 1605 G4ExceptionDescription ed; << 1606 ed << "Ion with Z=" << fAtomicNumberL; << 1607 ed << " A=" << fAtomicMassL << " is not << 1608 ionLvlCmd->CommandFailed(ed); << 1609 } 1617 } 1610 else 1618 else 1611 { 1619 { 1612 fParticleGun->SetParticleDefinition(ion 1620 fParticleGun->SetParticleDefinition(ion); 1613 fParticleGun->SetParticleCharge(fIonCha << 1621 fParticleGun->SetParticleCharge(fIonCharge*eplus); 1614 } 1622 } 1615 << 1616 } 1623 } 1617 else 1624 else 1618 { 1625 { 1619 G4ExceptionDescription ed; << 1626 G4cout << "Set /gps/particle to ion before using /gps/ion command"; 1620 ed << "Set /gps/particle to ion before us << 1627 G4cout << G4endl; 1621 ionLvlCmd->CommandFailed(ed); << 1622 } 1628 } 1623 } 1629 } 1624 1630