22 G4UIparameter* parameter;
24 particleTable = G4ParticleTable::GetParticleTable();
26 generatorDirectory =
new G4UIdirectory(
"/generator/");
27 generatorDirectory->SetGuidance(
"BESIII event gnerator");
29 gennamCmd =
new G4UIcmdWithAString(
"/generator/name",
this);
30 gennamCmd->SetGuidance(
"Select your event gerator: genbes or tester");
31 gennamCmd->SetGuidance(
"The default generator is tester");
32 gennamCmd->SetParameterName(
"name",
true);
33 gennamCmd->SetDefaultValue(
"tester");
34 gennamCmd->SetCandidates(
"tester cosmic genbes");
36 genbesCmd =
new G4UIcmdWithAString(
"/generator/genbes",
this);
37 genbesCmd->SetGuidance(
"The BES data file");
38 genbesCmd->SetGuidance(
"directory/filename");
39 genbesCmd->SetParameterName(
"name",
false);
41 testerCmd =
new G4UIcommand(
"/generator/tester",
this);
42 testerCmd->SetGuidance(
"The BES TESTER generator");
43 testerCmd->SetGuidance(
"NP PID Cosmin Cosmax phimin phimax p delp");
45 cosmicCmd =
new G4UIcommand(
"/generator/cosmic",
this);
46 cosmicCmd->SetGuidance(
"The cosmic generator");
47 cosmicCmd->SetGuidance(
"PID x y z");
49 parameter =
new G4UIparameter(
"np",
'i',omittable =
true);
50 parameter->SetGuidance(
"Number of particles in an event");
51 parameter->SetParameterRange(
"np > 0");
52 parameter->SetDefaultValue(1);
53 testerCmd->SetParameter(parameter);
55 parameter =
new G4UIparameter(
"pname",
's',omittable =
true);
56 parameter->SetGuidance(
"Particle name in Geant4");
57 parameter->SetDefaultValue(
"pi-");
58 G4String candidatelist;
59 G4int nPtable = particleTable->entries();
60 for(G4int i=0;i<nPtable;i++)
62 candidatelist += particleTable->GetParticleName(i);
65 parameter->SetParameterCandidates(candidatelist);
66 testerCmd->SetParameter(parameter);
68 parameter =
new G4UIparameter(
"cosmin",
'd',omittable =
true);
69 parameter->SetGuidance(
"Minimum cos(theta)");
70 parameter->SetParameterRange(
"cosmin >= -1. && cosmin <= 1.");
71 parameter->SetDefaultValue(-0.8);
72 testerCmd->SetParameter(parameter);
74 parameter =
new G4UIparameter(
"cosmax",
'd',omittable =
true);
75 parameter->SetGuidance(
"Maximum cos(theta)");
76 parameter->SetParameterRange(
"cosmax >= -1. && cosmax <= 1.");
77 parameter->SetDefaultValue(0.8);
78 testerCmd->SetParameter(parameter);
80 parameter =
new G4UIparameter(
"phimin",
'd',omittable =
true);
81 parameter->SetGuidance(
"Minimum azimuthal angle in degree");
82 parameter->SetParameterRange(
"phimin >= 0. && phimin <= 360.");
83 parameter->SetDefaultValue(0.);
84 testerCmd->SetParameter(parameter);
86 parameter =
new G4UIparameter(
"phimax",
'd',omittable =
true);
87 parameter->SetGuidance(
"Maximum azimuthal angle in degree");
88 parameter->SetParameterRange(
"phimax >= 0. && phimax <= 360.");
89 parameter->SetDefaultValue(360.);
90 testerCmd->SetParameter(parameter);
92 parameter =
new G4UIparameter(
"pp",
'd',omittable =
true);
93 parameter->SetGuidance(
"Particle Momentum in GeV");
94 parameter->SetParameterRange(
"pp>=0.");
95 parameter->SetDefaultValue(1.0);
96 testerCmd->SetParameter(parameter);
98 parameter =
new G4UIparameter(
"dp",
'd',omittable =
true);
99 parameter->SetGuidance(
"Particle Momentum range in GeV");
100 parameter->SetParameterRange(
"dp>=0.");
101 parameter->SetDefaultValue(0.0);
102 testerCmd->SetParameter(parameter);
104 parameter =
new G4UIparameter(
"x",
'd',omittable =
true);
105 parameter->SetGuidance(
"Particle x position");
106 parameter->SetParameterRange(
"x >= -10000 && x <= 10000");
107 parameter->SetDefaultValue(0.);
108 testerCmd->SetParameter(parameter);
110 parameter =
new G4UIparameter(
"y",
'd',omittable =
true);
111 parameter->SetGuidance(
"Particle y position");
112 parameter->SetParameterRange(
"y >= -10000 && y <= 10000");
113 parameter->SetDefaultValue(0.);
114 testerCmd->SetParameter(parameter);
116 parameter =
new G4UIparameter(
"z",
'd',omittable =
true);
117 parameter->SetGuidance(
"Particle z position");
118 parameter->SetParameterRange(
"z >= -10000 && z <= 10000");
119 parameter->SetDefaultValue(0.);
120 testerCmd->SetParameter(parameter);
122 parameter =
new G4UIparameter(
"pname",
's',omittable =
true);
123 parameter->SetGuidance(
"Particle name in Geant4");
124 parameter->SetDefaultValue(
"mu-");
125 cosmicCmd->SetParameter(parameter);
127 parameter =
new G4UIparameter(
"x",
'd',omittable =
true);
128 parameter->SetGuidance(
"Particle x position");
129 parameter->SetParameterRange(
"x >= -10000 && x <= 10000");
130 parameter->SetDefaultValue(0.);
131 cosmicCmd->SetParameter(parameter);
133 parameter =
new G4UIparameter(
"y",
'd',omittable =
true);
134 parameter->SetGuidance(
"Particle y position");
135 parameter->SetParameterRange(
"y >= -10000 && y <= 10000");
136 parameter->SetDefaultValue(0.);
137 cosmicCmd->SetParameter(parameter);
139 parameter =
new G4UIparameter(
"z",
'd',omittable =
true);
140 parameter->SetGuidance(
"Particle z position");
141 parameter->SetParameterRange(
"z >= -10000 && z <= 10000");
142 parameter->SetDefaultValue(0.);
143 cosmicCmd->SetParameter(parameter);