156{
162
163 if( command == listCmd )
164 {
165
166 type = -1;
167 if (newValue == "all")
168 {
169 currentProcessTypeName = newValue;
170 }
171 else
172 {
173 type = GetProcessType(newValue);
174 if (type <0)
175 {
177 }
178 else
179 {
180 currentProcessTypeName = newValue;
181 }
182 }
184 idx = 0;
185 for (auto itr=procNameVector->cbegin(); itr!=procNameVector->cend(); ++itr)
186 {
187 ++idx;
189 if ( (type <0) || ( ((*tmpVector)(0)->GetProcessType()) == type) )
190 {
191 if ( counter%4 != 0)
G4cout <<
",";
192 G4cout << std::setw(19) << *itr;
193 if ((counter++)%4 == 3)
194 {
196 }
197 }
198 delete tmpVector;
199 }
201 }
202 else if( command==procVerboseCmd )
203 {
204
206
207
209
210 const char* temp = (const char*)(tmpS);
211 std::istringstream is((char*)temp);
213 is >>level;
214
215
216 currentProcessTypeName =
G4String(next());
217 if (currentProcessTypeName.
isNull()) currentProcessTypeName =
"all";
218 G4bool isProcName =
false;
220 type = -1;
221
222 if (currentProcessTypeName == "all")
223 {
224 isAll = true;
225 }
226 else
227 {
228 type = GetProcessType(currentProcessTypeName);
229 if (type<0)
230 {
231 isProcName = true;
232 currentProcessName = currentProcessTypeName;
233 currentProcessTypeName = "";
234 }
235 }
236 idx = 0;
237 for (auto itr=procNameVector->cbegin(); itr!=procNameVector->cend(); ++itr)
238 {
239 ++idx;
242 if ( isAll ||
245 {
247 }
248 delete tmpVector;
249 }
250 }
251 else if( command==verboseCmd )
252 {
253
255 }
256 else
257 {
259
260
261 currentProcessName =
G4String(next());
262 G4bool isProcName =
false;
263 for (auto itr=procNameVector->cbegin(); itr!=procNameVector->cend(); ++itr)
264 {
265 if ( (*itr) == currentProcessName )
266 {
267 isProcName = true;
268 break;
269 }
270 }
271 if (!isProcName)
272 {
273 type = GetProcessType(currentProcessName);
274 if (type <0 )
275 {
276
277 ed << " illegal process (or type) name ["
278 << currentProcessName << "]";
280 currentProcessName = "";
281 return;
282 }
283 }
284
285
286 currentParticleName =
G4String(next());
287 G4bool isParticleFound =
false;
289 if ( currentParticleName == "all" )
290 {
291 isParticleFound = true;
292 }
293 else
294 {
297 if (isParticleFound)
298 {
301 }
302 }
303
304 if ( !isParticleFound )
305 {
306
307 ed << " illegal particle name [" << currentParticleName << "]";
309 currentParticleName = "";
310 return;
311 }
312
313 if( command==dumpCmd )
314 {
315
317 if (isProcName)
318 {
319 tmpVector = theProcessTable->
FindProcesses(currentProcessName);
320 }
321 else
322 {
324 }
325 for (std::size_t i=0; i<tmpVector->
length(); ++i)
326 {
327 theProcessTable->
DumpInfo( (*tmpVector)(i), currentParticle );
328 }
329 delete tmpVector;
330 }
331 else if ( (command==activateCmd) || (command==inactivateCmd))
332 {
333
334 G4bool fActive = (command==activateCmd);
335 if (isProcName)
336 {
337 if ( currentParticle == nullptr )
338 {
340 fActive);
341 }
342 else
343 {
345 currentParticle,
346 fActive);
347 }
348 }
349 else
350 {
351 if ( currentParticle == nullptr )
352 {
354 fActive);
355 }
356 else
357 {
359 currentParticle,
360 fActive);
361 }
362 }
364 }
365 }
366}
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