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