156{
161
162 if( command == listCmd )
163 {
164
165 type = -1;
166 if (newValue == "all")
167 {
168 currentProcessTypeName = newValue;
169 }
170 else
171 {
172 type = GetProcessType(newValue);
173 if (type <0)
174 {
176 }
177 else
178 {
179 currentProcessTypeName = newValue;
180 }
181 }
183 for (auto itr=procNameVector->cbegin(); itr!=procNameVector->cend(); ++itr)
184 {
186 if ( (type <0) || ( ((*tmpVector)(0)->GetProcessType()) == type) )
187 {
188 if ( counter%4 != 0)
G4cout <<
",";
189 G4cout << std::setw(19) << *itr;
190 if ((counter++)%4 == 3)
191 {
193 }
194 }
195 delete tmpVector;
196 }
198 }
199 else if( command==procVerboseCmd )
200 {
201
203
204
206
207 const char* temp = (const char*)(tmpS);
208 std::istringstream is((char*)temp);
210 is >>level;
211
212
213 currentProcessTypeName =
G4String(next());
214 if (currentProcessTypeName.empty()) currentProcessTypeName = "all";
215 G4bool isProcName =
false;
217 type = -1;
218
219 if (currentProcessTypeName == "all")
220 {
221 isAll = true;
222 }
223 else
224 {
225 type = GetProcessType(currentProcessTypeName);
226 if (type<0)
227 {
228 isProcName = true;
229 currentProcessName = currentProcessTypeName;
230 currentProcessTypeName = "";
231 }
232 }
233 for (auto itr=procNameVector->cbegin(); itr!=procNameVector->cend(); ++itr)
234 {
237 if ( isAll ||
240 {
242 }
243 delete tmpVector;
244 }
245 }
246 else if( command==verboseCmd )
247 {
248
250 }
251 else
252 {
254
255
256 currentProcessName =
G4String(next());
257 G4bool isProcName =
false;
258 for (auto itr=procNameVector->cbegin(); itr!=procNameVector->cend(); ++itr)
259 {
260 if ( (*itr) == currentProcessName )
261 {
262 isProcName = true;
263 break;
264 }
265 }
266 if (!isProcName)
267 {
268 type = GetProcessType(currentProcessName);
269 if (type <0 )
270 {
271
272 ed << " illegal process (or type) name ["
273 << currentProcessName << "]";
275 currentProcessName = "";
276 return;
277 }
278 }
279
280
281 currentParticleName =
G4String(next());
282 G4bool isParticleFound =
false;
284 if ( currentParticleName == "all" )
285 {
286 isParticleFound = true;
287 }
288 else
289 {
292 if (isParticleFound)
293 {
296 }
297 }
298
299 if ( !isParticleFound )
300 {
301
302 ed << " illegal particle name [" << currentParticleName << "]";
304 currentParticleName = "";
305 return;
306 }
307
308 if( command==dumpCmd )
309 {
310
312 if (isProcName)
313 {
314 tmpVector = theProcessTable->
FindProcesses(currentProcessName);
315 }
316 else
317 {
319 }
321 {
322 theProcessTable->
DumpInfo( (*tmpVector)(i), currentParticle );
323 }
324 delete tmpVector;
325 }
326 else if ( (command==activateCmd) || (command==inactivateCmd))
327 {
328
329 G4bool fActive = (command==activateCmd);
330 if (isProcName)
331 {
332 if ( currentParticle == nullptr )
333 {
335 fActive);
336 }
337 else
338 {
340 currentParticle,
341 fActive);
342 }
343 }
344 else
345 {
346 if ( currentParticle == nullptr )
347 {
349 fActive);
350 }
351 else
352 {
354 currentParticle,
355 fActive);
356 }
357 }
359 }
360 }
361}
std::ostringstream G4ExceptionDescription
G4GLOB_DLL std::ostream G4cout
G4bool contains(const G4ParticleDefinition *particle) const
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
static G4ParticleTable * GetParticleTable()
void DumpInfo(G4VProcess *process, const G4ParticleDefinition *particle=nullptr)
G4ProcNameVector * GetNameList()
void SetProcessActivation(const G4String &processName, G4bool fActive)
G4ProcessVector * FindProcesses()
void SetVerboseLevel(G4int value)
std::vector< G4String > G4ProcNameVector
std::size_t length() const
static G4int GetNewIntValue(const char *paramString)
void CommandFailed(G4int errCode, G4ExceptionDescription &ed)
G4int ApplyCommand(const char *aCommand)
static G4UImanager * GetUIpointer()
void SetVerboseLevel(G4int value)
G4ProcessType GetProcessType() const
const G4String & GetProcessName() const