-
Notifications
You must be signed in to change notification settings - Fork 305
/
G4GeneralParticleSourceMessenger.cc
1605 lines (1499 loc) · 64.9 KB
/
G4GeneralParticleSourceMessenger.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// G4GeneralParticleSourceMessenger class implementation
//
// Author: Fan Lei, QinetiQ ltd.
// Customer: ESA/ESTEC
// Revisions: Andrew Green, Andrea Dotti
// --------------------------------------------------------------------
#include "G4GeneralParticleSourceMessenger.hh"
#include "G4PhysicalConstants.hh"
#include "G4SystemOfUnits.hh"
#include "G4Geantino.hh"
#include "G4ThreeVector.hh"
#include "G4ParticleTable.hh"
#include "G4IonTable.hh"
#include "G4UIdirectory.hh"
#include "G4UIcmdWithoutParameter.hh"
#include "G4UIcmdWithAString.hh"
#include "G4UIcmdWithADoubleAndUnit.hh"
#include "G4UIcmdWith3Vector.hh"
#include "G4UIcmdWith3VectorAndUnit.hh"
#include "G4UIcmdWithAnInteger.hh"
#include "G4UIcmdWithADouble.hh"
#include "G4UIcmdWithABool.hh"
#include "G4ios.hh"
#include "G4Tokenizer.hh"
#include "G4SingleParticleSource.hh"
#include "G4GeneralParticleSource.hh"
#include "G4AutoLock.hh"
namespace
{
G4Mutex creationM = G4MUTEX_INITIALIZER;
G4GeneralParticleSourceMessenger* theInstance = nullptr;
}
G4GeneralParticleSourceMessenger*
G4GeneralParticleSourceMessenger::GetInstance(G4GeneralParticleSource* psc)
{
G4AutoLock l(&creationM);
if ( theInstance == nullptr )
theInstance = new G4GeneralParticleSourceMessenger(psc);
return theInstance;
}
void G4GeneralParticleSourceMessenger::Destroy()
{
G4AutoLock l(&creationM);
if ( theInstance != nullptr )
{
delete theInstance;
theInstance = nullptr;
}
}
// --------------------------------------------------------------------
//
G4GeneralParticleSourceMessenger::
G4GeneralParticleSourceMessenger(G4GeneralParticleSource* fPtclGun)
: fGPS(fPtclGun)
{
// A.Dotti - 10th October 2014
// This messenger is special: it is instantiated in a user action but (e.g.
// in a thread).
// The UI commands it defines should be executed by the *master* thread
// because they operate on shared resources and we want the UI commands to
// take effect BEFORE the threads do some work (so all data are properly
// initialized).
// To achieve this behavior we set to true a base class protected
// data member. Since it makes no sense to have more than one instance
// of the messenger, we check that we actually have only one.
// Note that the logic of implementing, in a given worker thread only one
// messenger is deleted/fated to the creator
commandsShouldBeInMaster = true;
particleTable = G4ParticleTable::GetParticleTable();
histtype = "biasx";
// UI Commands only for master
//
G4bool broadcast = false;
gpsDirectory = new G4UIdirectory("/gps/",broadcast);
gpsDirectory->SetGuidance("General Particle Source control commands.");
// Now the commands for multiple sources
//
sourceDirectory = new G4UIdirectory("/gps/source/");
sourceDirectory->SetGuidance("Multiple source control sub-directory");
addsourceCmd = new G4UIcmdWithADouble("/gps/source/add",this);
addsourceCmd->SetGuidance("Add a new source definition to the particle gun");
addsourceCmd->SetGuidance(" with the specified intensity");
addsourceCmd->SetParameterName("addsource",false,false);
addsourceCmd->SetRange("addsource > 0.");
listsourceCmd = new G4UIcmdWithoutParameter("/gps/source/list",this);
listsourceCmd->SetGuidance("List the defined particle sources");
clearsourceCmd = new G4UIcmdWithoutParameter("/gps/source/clear",this);
clearsourceCmd->SetGuidance("Remove all the defined particle sources");
getsourceCmd = new G4UIcmdWithoutParameter("/gps/source/show",this);
getsourceCmd->SetGuidance("Show the current source index and intensity");
setsourceCmd = new G4UIcmdWithAnInteger("/gps/source/set",this);
setsourceCmd->SetGuidance("Set the indexed source as the current one");
setsourceCmd->SetGuidance(" so one can change its source definition");
setsourceCmd->SetParameterName("setsource",false,false);
setsourceCmd->SetRange("setsource >= 0");
deletesourceCmd = new G4UIcmdWithAnInteger("/gps/source/delete",this);
deletesourceCmd->SetGuidance("Delete the indexed source from the list");
deletesourceCmd->SetParameterName("deletesource",false,false);
deletesourceCmd->SetRange("deletesource > 0");
setintensityCmd = new G4UIcmdWithADouble("/gps/source/intensity",this);
setintensityCmd->SetGuidance("Reset the current source to the specified intensity");
setintensityCmd->SetParameterName("setintensity",false,false);
setintensityCmd->SetRange("setintensity > 0.");
multiplevertexCmd = new G4UIcmdWithABool("/gps/source/multiplevertex",this);
multiplevertexCmd->SetGuidance("True for simultaneous generation multiple vertex");
multiplevertexCmd->SetGuidance(" Default is false");
multiplevertexCmd->SetParameterName("multiplevertex",true);
multiplevertexCmd->SetDefaultValue(false);
flatsamplingCmd = new G4UIcmdWithABool("/gps/source/flatsampling",this);
flatsamplingCmd->SetGuidance("True for applying flat (biased) sampling among the sources");
flatsamplingCmd->SetGuidance("Default is false");
flatsamplingCmd->SetParameterName("flatsampling",true);
flatsamplingCmd->SetDefaultValue(false);
// Below we reproduce commands awailable in G4Particle Gun
//
listCmd = new G4UIcmdWithoutParameter("/gps/List",this);
listCmd->SetGuidance("List available particles.");
listCmd->SetGuidance(" Invoke G4ParticleTable.");
particleCmd = new G4UIcmdWithAString("/gps/particle",this);
particleCmd->SetGuidance("Set particle to be generated.");
particleCmd->SetGuidance(" (geantino is default)");
particleCmd->SetGuidance(" (ion can be specified for shooting ions)");
particleCmd->SetParameterName("particleName",true);
particleCmd->SetDefaultValue("geantino");
G4String candidateList;
G4int nPtcl = particleTable->entries();
for(G4int i=0; i<nPtcl; ++i)
{
candidateList += particleTable->GetParticleName(i);
candidateList += " ";
}
candidateList += "ion ";
particleCmd->SetCandidates(candidateList);
directionCmd = new G4UIcmdWith3Vector("/gps/direction",this);
directionCmd->SetGuidance("Set momentum direction.");
directionCmd->SetGuidance(" Direction needs not to be a unit vector.");
directionCmd->SetGuidance(" Angular distribution type is set to planar.");
directionCmd->SetParameterName("Px","Py","Pz",false,false);
directionCmd->SetRange("Px != 0 || Py != 0 || Pz != 0");
energyCmd = new G4UIcmdWithADoubleAndUnit("/gps/energy",this);
energyCmd->SetGuidance("Set kinetic energy.");
energyCmd->SetParameterName("Energy",false,false);
energyCmd->SetDefaultUnit("GeV");
//energyCmd->SetUnitCategory("Energy");
//energyCmd->SetUnitCandidates("eV keV MeV GeV TeV");
positionCmd = new G4UIcmdWith3VectorAndUnit("/gps/position",this);
positionCmd->SetGuidance("Set starting position of the particle for a Point like source.");
positionCmd->SetGuidance(" Same effect as the two /gps/pos/type Point /gps/pos/centre commands.");
positionCmd->SetParameterName("X","Y","Z",false,false);
positionCmd->SetDefaultUnit("cm");
//positionCmd->SetUnitCategory("Length");
//positionCmd->SetUnitCandidates("microm mm cm m km");
ionCmd = new G4UIcommand("/gps/ion",this);
ionCmd->SetGuidance("Set properties of ion to be generated.");
ionCmd->SetGuidance("[usage] /gps/ion Z A Q E");
ionCmd->SetGuidance(" Z:(int) AtomicNumber");
ionCmd->SetGuidance(" A:(int) AtomicMass");
ionCmd->SetGuidance(" Q:(int) Charge of Ion (in unit of e)");
ionCmd->SetGuidance(" E:(double) Excitation energy (in keV)");
G4UIparameter* param;
param = new G4UIparameter("Z",'i',false);
param->SetDefaultValue("1");
ionCmd->SetParameter(param);
param = new G4UIparameter("A",'i',false);
param->SetDefaultValue("1");
ionCmd->SetParameter(param);
param = new G4UIparameter("Q",'i',true);
param->SetDefaultValue("0");
ionCmd->SetParameter(param);
param = new G4UIparameter("E",'d',true);
param->SetDefaultValue("0.0");
ionCmd->SetParameter(param);
ionLvlCmd = new G4UIcommand("/gps/ionLvl",this);
ionLvlCmd->SetGuidance("Set properties of ion to be generated.");
ionLvlCmd->SetGuidance("[usage] /gps/ion Z A Q Lvl");
ionLvlCmd->SetGuidance(" Z:(int) AtomicNumber");
ionLvlCmd->SetGuidance(" A:(int) AtomicMass");
ionLvlCmd->SetGuidance(" Q:(int) Charge of Ion (in unit of e)");
ionLvlCmd->SetGuidance(" Lvl:(int) Number of metastable state excitation level (0-9)");
G4UIparameter* paramL;
paramL = new G4UIparameter("Z",'i',false);
paramL->SetDefaultValue("1");
ionLvlCmd->SetParameter(paramL);
paramL = new G4UIparameter("A",'i',false);
paramL->SetDefaultValue("1");
ionLvlCmd->SetParameter(paramL);
paramL = new G4UIparameter("Q",'i',true);
paramL->SetDefaultValue("0");
ionLvlCmd->SetParameter(paramL);
paramL = new G4UIparameter("Lvl",'i',true);
paramL->SetDefaultValue("0.0");
ionLvlCmd->SetParameter(paramL);
timeCmd = new G4UIcmdWithADoubleAndUnit("/gps/time",this);
timeCmd->SetGuidance("Set initial time of the particle.");
timeCmd->SetParameterName("t0",false,false);
timeCmd->SetDefaultUnit("ns");
//timeCmd->SetUnitCategory("Time");
//timeCmd->SetUnitCandidates("ns ms s");
polCmd = new G4UIcmdWith3Vector("/gps/polarization",this);
polCmd->SetGuidance("Set polarization.");
polCmd->SetParameterName("Px","Py","Pz",false,false);
polCmd->SetRange("Px>=-1.&&Px<=1.&&Py>=-1.&&Py<=1.&&Pz>=-1.&&Pz<=1.");
numberCmd = new G4UIcmdWithAnInteger("/gps/number",this);
numberCmd->SetGuidance("Set number of particles to be generated per vertex.");
numberCmd->SetParameterName("N",false,false);
numberCmd->SetRange("N>0");
// Verbosity
//
verbosityCmd = new G4UIcmdWithAnInteger("/gps/verbose",this);
verbosityCmd->SetGuidance("Set Verbose level for GPS");
verbosityCmd->SetGuidance(" 0 : Silent");
verbosityCmd->SetGuidance(" 1 : Limited information");
verbosityCmd->SetGuidance(" 2 : Detailed information");
verbosityCmd->SetParameterName("level",false);
verbosityCmd->SetRange("level>=0 && level <=2");
// Now extended commands
// Positional ones:
//
positionDirectory = new G4UIdirectory("/gps/pos/");
positionDirectory->SetGuidance("Positional commands sub-directory");
typeCmd1 = new G4UIcmdWithAString("/gps/pos/type",this);
typeCmd1->SetGuidance("Sets source distribution type.");
typeCmd1->SetGuidance("Either Point, Beam, Plane, Surface or Volume");
typeCmd1->SetParameterName("DisType",false,false);
typeCmd1->SetDefaultValue("Point");
typeCmd1->SetCandidates("Point Beam Plane Surface Volume");
shapeCmd1 = new G4UIcmdWithAString("/gps/pos/shape",this);
shapeCmd1->SetGuidance("Sets source shape for Plan, Surface or Volume type source.");
shapeCmd1->SetParameterName("Shape",false,false);
shapeCmd1->SetDefaultValue("NULL");
shapeCmd1->SetCandidates("Circle Annulus Ellipse Square Rectangle Sphere Ellipsoid Cylinder EllipticCylinder Para");
centreCmd1 = new G4UIcmdWith3VectorAndUnit("/gps/pos/centre",this);
centreCmd1->SetGuidance("Set centre coordinates of source.");
centreCmd1->SetParameterName("X","Y","Z",false,false);
centreCmd1->SetDefaultUnit("cm");
// centreCmd1->SetUnitCandidates("micron mm cm m km");
posrot1Cmd1 = new G4UIcmdWith3Vector("/gps/pos/rot1",this);
posrot1Cmd1->SetGuidance("Set the 1st vector defining the rotation matrix'.");
posrot1Cmd1->SetGuidance("It does not need to be a unit vector.");
posrot1Cmd1->SetParameterName("R1x","R1y","R1z",false,false);
posrot1Cmd1->SetRange("R1x != 0 || R1y != 0 || R1z != 0");
posrot2Cmd1 = new G4UIcmdWith3Vector("/gps/pos/rot2",this);
posrot2Cmd1->SetGuidance("Set the 2nd vector defining the rotation matrix'.");
posrot2Cmd1->SetGuidance("It does not need to be a unit vector.");
posrot2Cmd1->SetParameterName("R2x","R2y","R2z",false,false);
posrot2Cmd1->SetRange("R2x != 0 || R2y != 0 || R2z != 0");
halfxCmd1 = new G4UIcmdWithADoubleAndUnit("/gps/pos/halfx",this);
halfxCmd1->SetGuidance("Set x half length of source.");
halfxCmd1->SetParameterName("Halfx",false,false);
halfxCmd1->SetDefaultUnit("cm");
// halfxCmd1->SetUnitCandidates("micron mm cm m km");
halfyCmd1 = new G4UIcmdWithADoubleAndUnit("/gps/pos/halfy",this);
halfyCmd1->SetGuidance("Set y half length of source.");
halfyCmd1->SetParameterName("Halfy",false,false);
halfyCmd1->SetDefaultUnit("cm");
// halfyCmd1->SetUnitCandidates("micron mm cm m km");
halfzCmd1 = new G4UIcmdWithADoubleAndUnit("/gps/pos/halfz",this);
halfzCmd1->SetGuidance("Set z half length of source.");
halfzCmd1->SetParameterName("Halfz",false,false);
halfzCmd1->SetDefaultUnit("cm");
// halfzCmd1->SetUnitCandidates("micron mm cm m km");
radiusCmd1 = new G4UIcmdWithADoubleAndUnit("/gps/pos/radius",this);
radiusCmd1->SetGuidance("Set radius of source.");
radiusCmd1->SetParameterName("Radius",false,false);
radiusCmd1->SetDefaultUnit("cm");
// radiusCmd1->SetUnitCandidates("micron mm cm m km");
radius0Cmd1 = new G4UIcmdWithADoubleAndUnit("/gps/pos/inner_radius",this);
radius0Cmd1->SetGuidance("Set inner radius of source when required.");
radius0Cmd1->SetParameterName("Radius0",false,false);
radius0Cmd1->SetDefaultUnit("cm");
// radius0Cmd1->SetUnitCandidates("micron mm cm m km");
possigmarCmd1 = new G4UIcmdWithADoubleAndUnit("/gps/pos/sigma_r",this);
possigmarCmd1->SetGuidance("Set standard deviation in radial of the beam positional profile");
possigmarCmd1->SetGuidance(" applicable to Beam type source only");
possigmarCmd1->SetParameterName("Sigmar",false,false);
possigmarCmd1->SetDefaultUnit("cm");
// possigmarCmd1->SetUnitCandidates("micron mm cm m km");
possigmaxCmd1 = new G4UIcmdWithADoubleAndUnit("/gps/pos/sigma_x",this);
possigmaxCmd1->SetGuidance("Set standard deviation of beam positional profile in x-dir");
possigmaxCmd1->SetGuidance(" applicable to Beam type source only");
possigmaxCmd1->SetParameterName("Sigmax",false,false);
possigmaxCmd1->SetDefaultUnit("cm");
// possigmaxCmd1->SetUnitCandidates("micron mm cm m km");
possigmayCmd1 = new G4UIcmdWithADoubleAndUnit("/gps/pos/sigma_y",this);
possigmayCmd1->SetGuidance("Set standard deviation of beam positional profile in y-dir");
possigmayCmd1->SetGuidance(" applicable to Beam type source only");
possigmayCmd1->SetParameterName("Sigmay",false,false);
possigmayCmd1->SetDefaultUnit("cm");
// possigmayCmd1->SetUnitCandidates("micron mm cm m km");
paralpCmd1 = new G4UIcmdWithADoubleAndUnit("/gps/pos/paralp",this);
paralpCmd1->SetGuidance("Angle from y-axis of y' in Para");
paralpCmd1->SetParameterName("paralp",false,false);
paralpCmd1->SetDefaultUnit("rad");
// paralpCmd1->SetUnitCandidates("rad deg");
partheCmd1 = new G4UIcmdWithADoubleAndUnit("/gps/pos/parthe",this);
partheCmd1->SetGuidance("Polar angle through centres of z faces");
partheCmd1->SetParameterName("parthe",false,false);
partheCmd1->SetDefaultUnit("rad");
// partheCmd1->SetUnitCandidates("rad deg");
parphiCmd1 = new G4UIcmdWithADoubleAndUnit("/gps/pos/parphi",this);
parphiCmd1->SetGuidance("Azimuth angle through centres of z faces");
parphiCmd1->SetParameterName("parphi",false,false);
parphiCmd1->SetDefaultUnit("rad");
// parphiCmd1->SetUnitCandidates("rad deg");
confineCmd1 = new G4UIcmdWithAString("/gps/pos/confine",this);
confineCmd1->SetGuidance("Confine source to volume (NULL to unset).");
confineCmd1->SetGuidance(" Usage: confine VolName");
confineCmd1->SetParameterName("VolName",false,false);
confineCmd1->SetDefaultValue("NULL");
// Angular distribution commands
//
angularDirectory = new G4UIdirectory("/gps/ang/");
angularDirectory->SetGuidance("Angular commands sub-directory");
angtypeCmd1 = new G4UIcmdWithAString("/gps/ang/type",this);
angtypeCmd1->SetGuidance("Sets angular source distribution type");
angtypeCmd1->SetGuidance(" Possible variables are: iso, cos, planar, beam1d, beam2d, focused or user");
angtypeCmd1->SetParameterName("AngDis",false,false);
angtypeCmd1->SetDefaultValue("iso");
angtypeCmd1->SetCandidates("iso cos planar beam1d beam2d focused user");
angrot1Cmd1 = new G4UIcmdWith3Vector("/gps/ang/rot1",this);
angrot1Cmd1->SetGuidance("Sets the 1st vector for angular distribution rotation matrix");
angrot1Cmd1->SetGuidance(" Need not be a unit vector");
angrot1Cmd1->SetParameterName("AR1x","AR1y","AR1z",false,false);
angrot1Cmd1->SetRange("AR1x != 0 || AR1y != 0 || AR1z != 0");
angrot2Cmd1 = new G4UIcmdWith3Vector("/gps/ang/rot2",this);
angrot2Cmd1->SetGuidance("Sets the 2nd vector for angular distribution rotation matrix");
angrot2Cmd1->SetGuidance(" Need not be a unit vector");
angrot2Cmd1->SetParameterName("AR2x","AR2y","AR2z",false,false);
angrot2Cmd1->SetRange("AR2x != 0 || AR2y != 0 || AR2z != 0");
minthetaCmd1 = new G4UIcmdWithADoubleAndUnit("/gps/ang/mintheta",this);
minthetaCmd1->SetGuidance("Set minimum theta");
minthetaCmd1->SetParameterName("MinTheta",false,false);
minthetaCmd1->SetDefaultValue(0.);
minthetaCmd1->SetDefaultUnit("rad");
// minthetaCmd1->SetUnitCandidates("rad deg");
maxthetaCmd1 = new G4UIcmdWithADoubleAndUnit("/gps/ang/maxtheta",this);
maxthetaCmd1->SetGuidance("Set maximum theta");
maxthetaCmd1->SetParameterName("MaxTheta",false,false);
maxthetaCmd1->SetDefaultValue(pi);
maxthetaCmd1->SetDefaultUnit("rad");
// maxthetaCmd1->SetUnitCandidates("rad deg");
minphiCmd1 = new G4UIcmdWithADoubleAndUnit("/gps/ang/minphi",this);
minphiCmd1->SetGuidance("Set minimum phi");
minphiCmd1->SetParameterName("MinPhi",false,false);
minphiCmd1->SetDefaultUnit("rad");
// minphiCmd1->SetUnitCandidates("rad deg");
maxphiCmd1 = new G4UIcmdWithADoubleAndUnit("/gps/ang/maxphi",this);
maxphiCmd1->SetGuidance("Set maximum phi");
maxphiCmd1->SetParameterName("MaxPhi",false,false);
maxphiCmd1->SetDefaultValue(pi);
maxphiCmd1->SetDefaultUnit("rad");
// maxphiCmd1->SetUnitCandidates("rad deg");
angsigmarCmd1 = new G4UIcmdWithADoubleAndUnit("/gps/ang/sigma_r",this);
angsigmarCmd1->SetGuidance("Set standard deviation in direction for 1D beam.");
angsigmarCmd1->SetParameterName("Sigmara",false,false);
angsigmarCmd1->SetDefaultUnit("rad");
// angsigmarCmd1->SetUnitCandidates("rad deg");
angsigmaxCmd1 = new G4UIcmdWithADoubleAndUnit("/gps/ang/sigma_x",this);
angsigmaxCmd1->SetGuidance("Set standard deviation in direction in x-direc. for 2D beam");
angsigmaxCmd1->SetParameterName("Sigmaxa",false,false);
angsigmaxCmd1->SetDefaultUnit("rad");
// angsigmaxCmd1->SetUnitCandidates("rad deg");
angsigmayCmd1 = new G4UIcmdWithADoubleAndUnit("/gps/ang/sigma_y",this);
angsigmayCmd1->SetGuidance("Set standard deviation in direction in y-direc. for 2D beam");
angsigmayCmd1->SetParameterName("Sigmaya",false,false);
angsigmayCmd1->SetDefaultUnit("rad");
// angsigmayCmd1->SetUnitCandidates("rad deg");
angfocusCmd = new G4UIcmdWith3VectorAndUnit("/gps/ang/focuspoint",this);
angfocusCmd->SetGuidance("Set the focusing point for the beam");
angfocusCmd->SetParameterName("x","y","z",false,false);
angfocusCmd->SetDefaultUnit("cm");
// angfocusCmd->SetUnitCandidates("micron mm cm m km");
useuserangaxisCmd1 = new G4UIcmdWithABool("/gps/ang/user_coor",this);
useuserangaxisCmd1->SetGuidance("True for using user defined angular co-ordinates");
useuserangaxisCmd1->SetGuidance(" Default is false");
useuserangaxisCmd1->SetParameterName("useuserangaxis",true);
useuserangaxisCmd1->SetDefaultValue(false);
surfnormCmd1 = new G4UIcmdWithABool("/gps/ang/surfnorm",this);
surfnormCmd1->SetGuidance("Makes a user-defined distribution with respect to surface normals rather than x,y,z axes.");
surfnormCmd1->SetGuidance(" Default is false");
surfnormCmd1->SetParameterName("surfnorm",true);
surfnormCmd1->SetDefaultValue(false);
// Energy commands
//
energyDirectory = new G4UIdirectory("/gps/ene/");
energyDirectory->SetGuidance("Spectral commands sub-directory");
energytypeCmd1 = new G4UIcmdWithAString("/gps/ene/type",this);
energytypeCmd1->SetGuidance("Sets energy distribution type");
energytypeCmd1->SetParameterName("EnergyDis",false,false);
energytypeCmd1->SetDefaultValue("Mono");
energytypeCmd1->SetCandidates("Mono Lin Pow Exp CPow Gauss Brem Bbody Cdg User Arb Epn LW");
eminCmd1 = new G4UIcmdWithADoubleAndUnit("/gps/ene/min",this);
eminCmd1->SetGuidance("Sets minimum energy");
eminCmd1->SetParameterName("emin",false,false);
eminCmd1->SetDefaultUnit("keV");
// eminCmd1->SetUnitCandidates("eV keV MeV GeV TeV PeV");
emaxCmd1 = new G4UIcmdWithADoubleAndUnit("/gps/ene/max",this);
emaxCmd1->SetGuidance("Sets maximum energy");
emaxCmd1->SetParameterName("emax",false,false);
emaxCmd1->SetDefaultUnit("keV");
// emaxCmd1->SetUnitCandidates("eV keV MeV GeV TeV PeV");
monoenergyCmd1 = new G4UIcmdWithADoubleAndUnit("/gps/ene/mono",this);
monoenergyCmd1->SetGuidance("Sets a monocromatic energy (same as gps/energy)");
monoenergyCmd1->SetParameterName("monoenergy",false,false);
monoenergyCmd1->SetDefaultUnit("keV");
// monoenergyCmd1->SetUnitCandidates("eV keV MeV GeV TeV PeV");
engsigmaCmd1 = new G4UIcmdWithADoubleAndUnit("/gps/ene/sigma",this);
engsigmaCmd1->SetGuidance("Sets the standard deviation for Gaussian energy dist.");
engsigmaCmd1->SetParameterName("Sigmae",false,false);
engsigmaCmd1->SetDefaultUnit("keV");
// engsigmaCmd1->SetUnitCandidates("eV keV MeV GeV TeV PeV");
alphaCmd1 = new G4UIcmdWithADouble("/gps/ene/alpha",this);
alphaCmd1->SetGuidance("Sets Alpha (index) for power-law energy dist.");
alphaCmd1->SetParameterName("alpha",false,false);
tempCmd1 = new G4UIcmdWithADouble("/gps/ene/temp",this);
tempCmd1->SetGuidance("Sets the temperature for Brem and BBody distributions (in Kelvin)");
tempCmd1->SetParameterName("temp",false,false);
ezeroCmd1 = new G4UIcmdWithADouble("/gps/ene/ezero",this);
ezeroCmd1->SetGuidance("Sets E_0 for exponential distribution (in MeV)");
ezeroCmd1->SetParameterName("ezero",false,false);
gradientCmd1 = new G4UIcmdWithADouble("/gps/ene/gradient",this);
gradientCmd1->SetGuidance("Sets the gradient for Lin distribution (in 1/MeV)");
gradientCmd1->SetParameterName("gradient",false,false);
interceptCmd1 = new G4UIcmdWithADouble("/gps/ene/intercept",this);
interceptCmd1->SetGuidance("Sets the intercept for Lin distributions (in MeV)");
interceptCmd1->SetParameterName("intercept",false,false);
arbeintCmd1 = new G4UIcmdWithADouble("/gps/ene/biasAlpha",this);
arbeintCmd1->SetGuidance("Sets the power-law index for the energy sampling distri. )");
arbeintCmd1->SetParameterName("arbeint",false,false);
calculateCmd1 = new G4UIcmdWithoutParameter("/gps/ene/calculate",this);
calculateCmd1->SetGuidance("Calculates the distributions for Cdg and BBody");
energyspecCmd1 = new G4UIcmdWithABool("/gps/ene/emspec",this);
energyspecCmd1->SetGuidance("True for energy and false for momentum spectra");
energyspecCmd1->SetParameterName("energyspec",true);
energyspecCmd1->SetDefaultValue(true);
diffspecCmd1 = new G4UIcmdWithABool("/gps/ene/diffspec",this);
diffspecCmd1->SetGuidance("True for differential and flase for integral spectra");
diffspecCmd1->SetParameterName("diffspec",true);
diffspecCmd1->SetDefaultValue(true);
applyEnergyWeightCmd1 = new G4UIcmdWithABool("/gps/ene/applyEneWeight",this);
applyEnergyWeightCmd1->SetGuidance("Apply energy weight.");
applyEnergyWeightCmd1->SetGuidance("- Instead of using the Arb type histogram for sampling the energy spectrum,");
applyEnergyWeightCmd1->SetGuidance(" energy is sampled by Linear distribution, and the Arb type histogram is");
applyEnergyWeightCmd1->SetGuidance(" used for the weight of the generated particle.");
applyEnergyWeightCmd1->SetGuidance("- \"/gps/ene/type LW\" automatically applies this command.");
applyEnergyWeightCmd1->SetGuidance("- If this command has to be explicitly used, \"/gps/ene/type\" distribution mush be Lin.");
applyEnergyWeightCmd1->SetParameterName("flag",true);
applyEnergyWeightCmd1->SetDefaultValue(true);
// Biasing + histograms in general
//
histDirectory = new G4UIdirectory("/gps/hist/");
histDirectory->SetGuidance("Histogram, biasing commands sub-directory");
histnameCmd1 = new G4UIcmdWithAString("/gps/hist/type",this);
histnameCmd1->SetGuidance("Sets histogram type");
histnameCmd1->SetParameterName("HistType",false,false);
histnameCmd1->SetDefaultValue("biasx");
histnameCmd1->SetCandidates("biasx biasy biasz biast biasp biase biaspt biaspp theta phi energy arb epn");
resethistCmd1 = new G4UIcmdWithAString("/gps/hist/reset",this);
resethistCmd1->SetGuidance("Reset (clean) the histogram ");
resethistCmd1->SetParameterName("HistType",false,false);
resethistCmd1->SetDefaultValue("energy");
resethistCmd1->SetCandidates("biasx biasy biasz biast biasp biase biaspt biaspp theta phi energy arb epn");
histpointCmd1 = new G4UIcmdWith3Vector("/gps/hist/point",this);
histpointCmd1->SetGuidance("Allows user to define a histogram");
histpointCmd1->SetGuidance(" Enter: Ehi Weight");
histpointCmd1->SetParameterName("Ehi","Weight","Junk",true,true);
histpointCmd1->SetRange("Ehi >= 0. && Weight >= 0.");
histfileCmd1 = new G4UIcmdWithAString("/gps/hist/file",this);
histfileCmd1->SetGuidance("Imports the arb energy hist in an ASCII file");
histfileCmd1->SetParameterName("HistFile",false,false);
arbintCmd1 = new G4UIcmdWithAString("/gps/hist/inter",this);
arbintCmd1->SetGuidance("Sets the interpolation method for arbitrary distribution.");
arbintCmd1->SetGuidance("Spline interpolation may not be applicable for some distributions.");
arbintCmd1->SetParameterName("int",false,false);
arbintCmd1->SetDefaultValue("Lin");
arbintCmd1->SetCandidates("Lin Log Exp Spline");
}
G4GeneralParticleSourceMessenger::~G4GeneralParticleSourceMessenger()
{
delete positionDirectory;
delete typeCmd1;
delete shapeCmd1;
delete centreCmd1;
delete posrot1Cmd1;
delete posrot2Cmd1;
delete halfxCmd1;
delete halfyCmd1;
delete halfzCmd1;
delete radiusCmd1;
delete radius0Cmd1;
delete possigmarCmd1;
delete possigmaxCmd1;
delete possigmayCmd1;
delete paralpCmd1;
delete partheCmd1;
delete parphiCmd1;
delete confineCmd1;
delete angularDirectory;
delete angtypeCmd1;
delete angrot1Cmd1;
delete angrot2Cmd1;
delete minthetaCmd1;
delete maxthetaCmd1;
delete minphiCmd1;
delete maxphiCmd1;
delete angsigmarCmd1;
delete angsigmaxCmd1;
delete angsigmayCmd1;
delete angfocusCmd;
delete useuserangaxisCmd1;
delete surfnormCmd1;
delete energyDirectory;
delete energytypeCmd1;
delete eminCmd1;
delete emaxCmd1;
delete monoenergyCmd1;
delete engsigmaCmd1;
delete alphaCmd1;
delete tempCmd1;
delete ezeroCmd1;
delete gradientCmd1;
delete interceptCmd1;
delete arbeintCmd1;
delete calculateCmd1;
delete energyspecCmd1;
delete diffspecCmd1;
delete applyEnergyWeightCmd1;
delete histDirectory;
delete histnameCmd1;
delete resethistCmd1;
delete histpointCmd1;
delete histfileCmd1;
delete arbintCmd1;
delete verbosityCmd;
delete ionCmd;
delete ionLvlCmd;
delete particleCmd;
delete timeCmd;
delete polCmd;
delete numberCmd;
delete positionCmd;
delete directionCmd;
delete energyCmd;
delete listCmd;
delete sourceDirectory;
delete addsourceCmd;
delete listsourceCmd;
delete clearsourceCmd;
delete getsourceCmd;
delete setsourceCmd;
delete setintensityCmd;
delete deletesourceCmd;
delete multiplevertexCmd;
delete flatsamplingCmd;
delete gpsDirectory;
theInstance = nullptr;
}
#define CHECKPG() { if (fParticleGun==nullptr) { \
G4ExceptionDescription msg; \
msg << "Command "<< command->GetCommandPath()<<"/";\
msg << command->GetCommandName(); \
msg << " used but no particle sources are set.";\
msg <<" Add at least a source with: /gps/source/add.";\
G4Exception("G4GeneralParticleSourceMessenger::SetNewValue","G4GPS003",\
FatalException,msg); return;\
} }
void G4GeneralParticleSourceMessenger::SetNewValue(G4UIcommand *command, G4String newValues)
{
// if(command == typeCmd)
// {
// CHECKPG(); fParticleGun->GetPosDist()->SetPosDisType(newValues);
// G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl
// << " The command is obsolete and will be removed soon." << G4endl
// << " Please try to use the new structured commands!" << G4endl;
// }
// else if(command == shapeCmd)
// {
// CHECKPG(); fParticleGun->GetPosDist()->SetPosDisShape(newValues);
// G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl
// << " The command is obsolete and will be removed soon." << G4endl
// << " Please try to use the new structured commands!" << G4endl;
// }
// else if(command == centreCmd)
// {
// CHECKPG(); fParticleGun->GetPosDist()->SetCentreCoords(centreCmd->GetNew3VectorValue(newValues));
// G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl
// << " The command is obsolete and will be removed soon." << G4endl
// << " Please try to use the new structured commands!" << G4endl;
// }
// else if(command == posrot1Cmd)
// {
// CHECKPG(); fParticleGun->GetPosDist()->SetPosRot1(posrot1Cmd->GetNew3VectorValue(newValues));
// G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl
// << " The command is obsolete and will be removed soon." << G4endl
// << " Please try to use the new structured commands!" << G4endl;
// }
// else if(command == posrot2Cmd)
// {
// CHECKPG(); fParticleGun->GetPosDist()->SetPosRot2(posrot2Cmd->GetNew3VectorValue(newValues));
// G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl
// << " The command is obsolete and will be removed soon." << G4endl
// << " Please try to use the new structured commands!" << G4endl;
// }
// else if(command == halfxCmd)
// {
// CHECKPG(); fParticleGun->GetPosDist()->SetHalfX(halfxCmd->GetNewDoubleValue(newValues));
// G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl
// << " The command is obsolete and will be removed soon." << G4endl
// << " Please try to use the new structured commands!" << G4endl;
// }
// else if(command == halfyCmd)
// {
// CHECKPG(); fParticleGun->GetPosDist()->SetHalfY(halfyCmd->GetNewDoubleValue(newValues));
// G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl
// << " The command is obsolete and will be removed soon." << G4endl
// << " Please try to use the new structured commands!" << G4endl;
// }
// else if(command == halfzCmd)
// {
// CHECKPG(); fParticleGun->GetPosDist()->SetHalfZ(halfzCmd->GetNewDoubleValue(newValues));
// G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl
// << " The command is obsolete and will be removed soon." << G4endl
// << " Please try to use the new structured commands!" << G4endl;
// }
// else if(command == radiusCmd)
// {
// CHECKPG(); fParticleGun->GetPosDist()->SetRadius(radiusCmd->GetNewDoubleValue(newValues));
// G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl
// << " The command is obsolete and will be removed soon." << G4endl
// << " Please try to use the new structured commands!" << G4endl;
// }
// else if(command == radius0Cmd)
// {
// CHECKPG(); fParticleGun->GetPosDist()->SetRadius0(radius0Cmd->GetNewDoubleValue(newValues));
// G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl
// << " The command is obsolete and will be removed soon." << G4endl
// << " Please try to use the new structured commands!" << G4endl;
// }
// else if(command == possigmarCmd)
// {
// CHECKPG(); fParticleGun->GetPosDist()->SetBeamSigmaInR(possigmarCmd->GetNewDoubleValue(newValues));
// G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl
// << " The command is obsolete and will be removed soon." << G4endl
// << " Please try to use the new structured commands!" << G4endl;
// }
// else if(command == possigmaxCmd)
// {
// CHECKPG(); fParticleGun->GetPosDist()->SetBeamSigmaInX(possigmaxCmd->GetNewDoubleValue(newValues));
// G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl
// << " The command is obsolete and will be removed soon." << G4endl
// << " Please try to use the new structured commands!" << G4endl;
// }
// else if(command == possigmayCmd)
// {
// CHECKPG(); fParticleGun->GetPosDist()->SetBeamSigmaInY(possigmayCmd->GetNewDoubleValue(newValues));
// G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl
// << " The command is obsolete and will be removed soon." << G4endl
// << " Please try to use the new structured commands!" << G4endl;
// }
// else if(command == paralpCmd)
// {
// CHECKPG(); fParticleGun->GetPosDist()->SetParAlpha(paralpCmd->GetNewDoubleValue(newValues));
// G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl
// << " The command is obsolete and will be removed soon." << G4endl
// << " Please try to use the new structured commands!" << G4endl;
// }
// else if(command == partheCmd)
// {
// CHECKPG(); fParticleGun->GetPosDist()->SetParTheta(partheCmd->GetNewDoubleValue(newValues));
// G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl
// << " The command is obsolete and will be removed soon." << G4endl
// << " Please try to use the new structured commands!" << G4endl;
// }
// else if(command == parphiCmd)
// {
// CHECKPG(); fParticleGun->GetPosDist()->SetParPhi(parphiCmd->GetNewDoubleValue(newValues));
// G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl
// << " The command is obsolete and will be removed soon." << G4endl
// << " Please try to use the new structured commands!" << G4endl;
// }
// else if(command == confineCmd)
// {
// CHECKPG(); fParticleGun->GetPosDist()->ConfineSourceToVolume(newValues);
// G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl
// << " The command is obsolete and will be removed soon." << G4endl
// << " Please try to use the new structured commands!" << G4endl;
// }
// else if(command == angtypeCmd)
// {
// CHECKPG(); fParticleGun->GetAngDist()->SetAngDistType(newValues);
// G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl
// << " The command is obsolete and will be removed soon." << G4endl
// << " Please try to use the new structured commands!" << G4endl;
// }
// else if(command == angrot1Cmd)
// {
// CHECKPG();
// G4String a = "angref1";
// fParticleGun->GetAngDist()->DefineAngRefAxes(a,angrot1Cmd->GetNew3VectorValue(newValues));
// G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl
// << " The command is obsolete and will be removed soon." << G4endl
// << " Please try to use the new structured commands!" << G4endl;
// }
// else if(command == angrot2Cmd)
// {
// CHECKPG();
// G4String a = "angref2";
// fParticleGun->GetAngDist()->DefineAngRefAxes(a,angrot2Cmd->GetNew3VectorValue(newValues));
// G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl
// << " The command is obsolete and will be removed soon." << G4endl
// << " Please try to use the new structured commands!" << G4endl;
// }
// else if(command == minthetaCmd)
// {
// CHECKPG(); fParticleGun->GetAngDist()->SetMinTheta(minthetaCmd->GetNewDoubleValue(newValues));
// G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl
// << " The command is obsolete and will be removed soon." << G4endl
// << " Please try to use the new structured commands!" << G4endl;
// }
// else if(command == minphiCmd)
// {
// CHECKPG(); fParticleGun->GetAngDist()->SetMinPhi(minphiCmd->GetNewDoubleValue(newValues));
// G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl
// << " The command is obsolete and will be removed soon." << G4endl
// << " Please try to use the new structured commands!" << G4endl;
// }
// else if(command == maxthetaCmd)
// {
// CHECKPG(); fParticleGun->GetAngDist()->SetMaxTheta(maxthetaCmd->GetNewDoubleValue(newValues));
// G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl
// << " The command is obsolete and will be removed soon." << G4endl
// << " Please try to use the new structured commands!" << G4endl;
// }
// else if(command == maxphiCmd)
// {
// CHECKPG(); fParticleGun->GetAngDist()->SetMaxPhi(maxphiCmd->GetNewDoubleValue(newValues));
// G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl
// << " The command is obsolete and will be removed soon." << G4endl
// << " Please try to use the new structured commands!" << G4endl;
// }
// else if(command == angsigmarCmd)
// {
// CHECKPG(); fParticleGun->GetAngDist()->SetBeamSigmaInAngR(angsigmarCmd->GetNewDoubleValue(newValues));
// G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl
// << " The command is obsolete and will be removed soon." << G4endl
// << " Please try to use the new structured commands!" << G4endl;
// }
// else if(command == angsigmaxCmd)
// {
// CHECKPG(); fParticleGun->GetAngDist()->SetBeamSigmaInAngX(angsigmaxCmd->GetNewDoubleValue(newValues));
// G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl
// << " The command is obsolete and will be removed soon." << G4endl
// << " Please try to use the new structured commands!" << G4endl;
// }
// else if(command == angsigmayCmd)
// {
// CHECKPG(); fParticleGun->GetAngDist()->SetBeamSigmaInAngY(angsigmayCmd->GetNewDoubleValue(newValues));
// G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl
// << " The command is obsolete and will be removed soon." << G4endl
// << " Please try to use the new structured commands!" << G4endl;
// }
// else if(command == useuserangaxisCmd)
// {
// CHECKPG(); fParticleGun->GetAngDist()->SetUseUserAngAxis(useuserangaxisCmd->GetNewBoolValue(newValues));
// G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl
// << " The command is obsolete and will be removed soon." << G4endl
// << " Please try to use the new structured commands!" << G4endl;
// }
// else if(command == surfnormCmd)
// {
// CHECKPG(); fParticleGun->GetAngDist()->SetUserWRTSurface(surfnormCmd->GetNewBoolValue(newValues));
// G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl
// << " The command is obsolete and will be removed soon." << G4endl
// << " Please try to use the new structured commands!" << G4endl;
// }
// else if(command == energytypeCmd)
// {
// CHECKPG(); fParticleGun->GetEneDist()->SetEnergyDisType(newValues);
// G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl
// << " The command is obsolete and will be removed soon." << G4endl
// << " Please try to use the new structured commands!" << G4endl;
// }
// else if(command == eminCmd)
// {
// CHECKPG(); fParticleGun->GetEneDist()->SetEmin(eminCmd->GetNewDoubleValue(newValues));
// G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl
// << " The command is obsolete and will be removed soon." << G4endl
// << " Please try to use the new structured commands!" << G4endl;
// }
// else if(command == emaxCmd)
// {
// CHECKPG(); fParticleGun->GetEneDist()->SetEmax(emaxCmd->GetNewDoubleValue(newValues));
// G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl
// << " The command is obsolete and will be removed soon." << G4endl
// << " Please try to use the new structured commands!" << G4endl;
// }
// else if(command == monoenergyCmd)
// {
// CHECKPG(); fParticleGun->GetEneDist()->SetMonoEnergy(monoenergyCmd->GetNewDoubleValue(newValues));
// G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl
// << " The command is obsolete and will be removed soon." << G4endl
// << " Please try to use the new structured commands!" << G4endl;
// }
// else if(command == engsigmaCmd)
// {
// CHECKPG(); fParticleGun->GetEneDist()->SetBeamSigmaInE(engsigmaCmd->GetNewDoubleValue(newValues));
// G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl
// << " The command is obsolete and will be removed soon." << G4endl
// << " Please try to use the new structured commands!" << G4endl;
// }
// else if(command == alphaCmd)
// {
// CHECKPG(); fParticleGun->GetEneDist()->SetAlpha(alphaCmd->GetNewDoubleValue(newValues));
// G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl
// << " The command is obsolete and will be removed soon." << G4endl
// << " Please try to use the new structured commands!" << G4endl;
// }
// else if(command == tempCmd)
// {
// CHECKPG(); fParticleGun->GetEneDist()->SetTemp(tempCmd->GetNewDoubleValue(newValues));
// G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl
// << " The command is obsolete and will be removed soon." << G4endl
// << " Please try to use the new structured commands!" << G4endl;
// }
// else if(command == ezeroCmd)
// {
// CHECKPG(); fParticleGun->GetEneDist()->SetEzero(ezeroCmd->GetNewDoubleValue(newValues));
// G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl
// << " The command is obsolete and will be removed soon." << G4endl
// << " Please try to use the new structured commands!" << G4endl;
// }
// else if(command == gradientCmd)
// {
// CHECKPG(); fParticleGun->GetEneDist()->SetGradient(gradientCmd->GetNewDoubleValue(newValues));
// G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl
// << " The command is obsolete and will be removed soon." << G4endl
// << " Please try to use the new structured commands!" << G4endl;
// }
// else if(command == interceptCmd)
// {
// CHECKPG(); fParticleGun->GetEneDist()->SetInterCept(interceptCmd->GetNewDoubleValue(newValues));
// G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl
// << " The command is obsolete and will be removed soon." << G4endl
// << " Please try to use the new structured commands!" << G4endl;
// }
// else if(command == calculateCmd)
// {
// CHECKPG(); fParticleGun->GetEneDist()->Calculate();
// G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl
// << " The command is obsolete and will be removed soon." << G4endl
// << " Please try to use the new structured commands!" << G4endl;
// }
// else if(command == energyspecCmd)
// {
// CHECKPG(); fParticleGun->GetEneDist()->InputEnergySpectra(energyspecCmd->GetNewBoolValue(newValues));
// G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl
// << " The command is obsolete and will be removed soon." << G4endl
// << " Please try to use the new structured commands!" << G4endl;
// }
// else if(command == diffspecCmd)
// {
// CHECKPG(); fParticleGun->GetEneDist()->InputDifferentialSpectra(diffspecCmd->GetNewBoolValue(newValues));
// G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl
// << " The command is obsolete and will be removed soon." << G4endl
// << " Please try to use the new structured commands!" << G4endl;
// }
// else if(command == histnameCmd)
// {
// histtype = newValues;
// G4cout << " G4GeneralParticleSourceMessenger - Warning:" << G4endl
// << " The command is obsolete and will be removed soon." << G4endl
// << " Please try to use the new structured commands!" << G4endl;
// }
// else
// if(command == histpointCmd)
// {
// CHECKPG();