53 : theProcessTable(pTable)
57 thisDirectory->SetGuidance(
"Process Table control commands.");
61 listCmd->SetGuidance(
"List up process names");
62 listCmd->SetGuidance(
" list [type] ");
63 listCmd->SetGuidance(
" type: process type [all:for all processes]");
64 listCmd->SetParameterName(
"type",
true);
65 listCmd->SetDefaultValue(
"all");
66 SetNumberOfProcessType();
69 for (
G4int idx = 0; idx < NumberOfProcessType ; ++idx )
73 listCmd->SetCandidates((
const char*)(candidates));
77 verboseCmd->SetGuidance(
"Set Verbose Level for Process Table");
78 verboseCmd->SetGuidance(
" verbose [level]");
79 verboseCmd->SetGuidance(
" level: verbose level");
80 verboseCmd->SetParameterName(
"verbose",
true);
81 verboseCmd->SetDefaultValue(1);
82 verboseCmd->SetRange(
"verbose >=0");
86 procVerboseCmd =
new G4UIcommand(
"/process/setVerbose",
this);
87 procVerboseCmd->SetGuidance(
"Set verbose level for processes");
88 procVerboseCmd->SetGuidance(
" setVerbose level [type or name] ");
89 procVerboseCmd->SetGuidance(
" level: verbose level ");
90 procVerboseCmd->SetGuidance(
" name : process name ");
91 procVerboseCmd->SetGuidance(
" type : process type ");
92 procVerboseCmd->SetGuidance(
" [all] for all processes ");
94 procVerboseCmd->SetParameter(param);
97 procVerboseCmd->SetParameter(param);
102 dumpCmd->SetGuidance(
"Dump process information");
103 dumpCmd->SetGuidance(
" dump name [particle]");
104 dumpCmd->SetGuidance(
" name: process name or type name");
105 dumpCmd->SetGuidance(
" particle: particle name [all: for all particles]");
107 dumpCmd->SetParameter(param);
110 dumpCmd->SetParameter(param);
114 activateCmd =
new G4UIcommand(
"/process/activate",
this);
115 activateCmd->SetGuidance(
"Activate processes ");
116 activateCmd->SetGuidance(
" Activate name [particle]");
117 activateCmd->SetGuidance(
" name: process name or type name");
118 activateCmd->SetGuidance(
" particle: particle name [all: for all particles]");
120 activateCmd->SetParameter(param);
123 activateCmd->SetParameter(param);
127 inactivateCmd =
new G4UIcommand(
"/process/inactivate",
this);
128 inactivateCmd->SetGuidance(
"Inactivate process ");
129 inactivateCmd->SetGuidance(
"Inactivate processes ");
130 inactivateCmd->SetGuidance(
" Inactivate name [particle]");
131 inactivateCmd->SetGuidance(
" name: process name or type name");
132 inactivateCmd->SetGuidance(
" particle: particle name [all: for all particles]");
134 inactivateCmd->SetParameter(param);
137 inactivateCmd->SetParameter(param);
158 = theProcessTable->GetNameList();
162 if( command == listCmd )
166 if (newValue ==
"all")
168 currentProcessTypeName = std::move(newValue);
172 type = GetProcessType(newValue);
179 currentProcessTypeName = std::move(newValue);
183 for (
auto itr=procNameVector->cbegin(); itr!=procNameVector->cend(); ++itr)
186 if ( (type <0) || ( ((*tmpVector)(0)->GetProcessType()) == type) )
188 if ( counter%4 != 0)
G4cout <<
",";
189 G4cout << std::setw(19) << *itr;
190 if ((counter++)%4 == 3)
199 else if( command==procVerboseCmd )
207 const char* temp = (
const char*)(tmpS);
208 std::istringstream is((
char*)temp);
213 currentProcessTypeName =
G4String(next());
214 if (currentProcessTypeName.empty()) currentProcessTypeName =
"all";
215 G4bool isProcName =
false;
219 if (currentProcessTypeName ==
"all")
225 type = GetProcessType(currentProcessTypeName);
229 currentProcessName = currentProcessTypeName;
230 currentProcessTypeName =
"";
233 for (
auto itr=procNameVector->cbegin(); itr!=procNameVector->cend(); ++itr)
246 else if( command==verboseCmd )
249 theProcessTable->SetVerboseLevel(verboseCmd->GetNewIntValue(newValue));
256 currentProcessName =
G4String(next());
257 G4bool isProcName =
false;
258 for (
auto itr=procNameVector->cbegin(); itr!=procNameVector->cend(); ++itr)
260 if ( (*itr) == currentProcessName )
268 type = GetProcessType(currentProcessName);
272 ed <<
" illegal process (or type) name ["
273 << currentProcessName <<
"]";
275 currentProcessName =
"";
281 currentParticleName =
G4String(next());
282 G4bool isParticleFound =
false;
284 if ( currentParticleName ==
"all" )
286 isParticleFound =
true;
299 if ( !isParticleFound )
302 ed <<
" illegal particle name [" << currentParticleName <<
"]";
304 currentParticleName =
"";
308 if( command==dumpCmd )
314 tmpVector = theProcessTable->FindProcesses(currentProcessName);
318 tmpVector = theProcessTable->FindProcesses(
G4ProcessType(type));
322 theProcessTable->DumpInfo( (*tmpVector)(i), currentParticle );
326 else if ( (command==activateCmd) || (command==inactivateCmd))
329 G4bool fActive = (command==activateCmd);
332 if ( currentParticle ==
nullptr )
334 theProcessTable->SetProcessActivation(currentProcessName,
339 theProcessTable->SetProcessActivation(currentProcessName,
346 if ( currentParticle ==
nullptr )
G4bool contains(const G4ParticleDefinition *particle) const
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
static G4ParticleTable * GetParticleTable()