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