69 :theProcessTable(pTable),
70 currentProcessTypeName(
"all"),
71 currentProcessName(
"all"),
72 currentParticleName(
"all")
76 thisDirectory->
SetGuidance(
"Process Table control commands.");
83 listCmd->
SetGuidance(
" type: process type [all:for all proceeses]");
86 SetNumberOfProcessType();
89 for (
G4int idx = 0; idx < NumberOfProcessType ; idx ++ ) {
97 verboseCmd->
SetGuidance(
"Set Verbose Level for Process Table");
102 verboseCmd->
SetRange(
"verbose >=0");
106 procVerboseCmd =
new G4UIcommand(
"/process/setVerbose",
this);
107 procVerboseCmd->
SetGuidance(
"Set verbose level for processes");
108 procVerboseCmd->
SetGuidance(
" setVerbose level [type or name] ");
109 procVerboseCmd->
SetGuidance(
" level: verbose level ");
110 procVerboseCmd->
SetGuidance(
" name : process name ");
111 procVerboseCmd->
SetGuidance(
" type : process type ");
112 procVerboseCmd->
SetGuidance(
" [all] for all proceeses ");
124 dumpCmd->
SetGuidance(
" name: process name or type name");
125 dumpCmd->
SetGuidance(
" particle: particle name [all: for all particles]");
134 activateCmd =
new G4UIcommand(
"/process/activate",
this);
136 activateCmd->
SetGuidance(
" Activate name [particle]");
137 activateCmd->
SetGuidance(
" name: process name or type name");
138 activateCmd->
SetGuidance(
" particle: particle name [all: for all particles]");
147 inactivateCmd =
new G4UIcommand(
"/process/inactivate",
this);
149 inactivateCmd->
SetGuidance(
"Inactivate processes ");
150 inactivateCmd->
SetGuidance(
" Inactivate name [particle]");
151 inactivateCmd->
SetGuidance(
" name: process name or type name");
152 inactivateCmd->
SetGuidance(
" particle: particle name [all: for all particles]");
165 delete inactivateCmd;
169 delete procVerboseCmd;
170 delete thisDirectory;
182 if( command == listCmd ){
185 if (newValue ==
"all") {
186 currentProcessTypeName = newValue;
188 type = GetProcessType(newValue);
192 currentProcessTypeName = newValue;
197 G4ProcessTable::G4ProcNameVector::iterator itr;
198 for (itr=procNameVector->begin(); itr!=procNameVector->end(); ++itr) {
201 if ( (type <0) || ( ((*tmpVector)(0)->GetProcessType()) == type) ) {
202 if ( counter%4 != 0)
G4cout <<
",";
203 G4cout << std::setw(19) <<*itr;
204 if ((counter++)%4 == 3) {
213 }
else if( command==procVerboseCmd ) {
220 const char* temp = (
const char*)(tmpS);
221 std::istringstream is((
char*)temp);
226 currentProcessTypeName =
G4String(next());
227 if (currentProcessTypeName.
isNull()) currentProcessTypeName =
"all";
228 G4bool isProcName =
false;
232 if (currentProcessTypeName ==
"all") {
235 type = GetProcessType(currentProcessTypeName);
238 currentProcessName = currentProcessTypeName;
239 currentProcessTypeName =
"";
243 G4ProcessTable::G4ProcNameVector::iterator itr;
244 for (itr=procNameVector->begin(); itr!=procNameVector->end(); ++itr) {
257 }
else if( command==verboseCmd ) {
266 currentProcessName =
G4String(next());
267 G4bool isProcName =
false;
268 G4ProcessTable::G4ProcNameVector::iterator itr;
269 for (itr=procNameVector->begin(); itr!=procNameVector->end(); ++itr) {
270 if ( (*itr) == currentProcessName ) {
276 type = GetProcessType(currentProcessName);
280 currentProcessName =
"";
286 currentParticleName =
G4String(next());
287 G4bool isParticleFound =
false;
289 if ( currentParticleName ==
"all" ) {
290 isParticleFound =
true;
294 if (isParticleFound) {
300 if ( !isParticleFound ) {
303 currentParticleName =
"";
307 if( command==dumpCmd ) {
311 tmpVector = theProcessTable->
FindProcesses(currentProcessName);
316 theProcessTable->
DumpInfo( (*tmpVector)(i), currentParticle );
321 }
else if ( (command==activateCmd) || (command==inactivateCmd)) {
323 G4bool fActive = (command==activateCmd);
325 if ( currentParticle == 0 ) {
334 if ( currentParticle == 0 ) {
359 std::ostringstream os;
364 if( command==verboseCmd ){
367 returnValue = os.str();
369 }
else if ( command==listCmd ){
372 for (idx = 0; idx < NumberOfProcessType ; idx ++ ) {
377 returnValue = currentProcessTypeName;
384 G4ProcessTable::G4ProcNameVector::iterator itr;
385 for (itr=procNameVector->begin(); itr!=procNameVector->end(); ++itr) {
386 candidates +=
" " + (*itr);
401 returnValue = currentProcessName +
" " + currentParticleName;
415 G4int G4ProcessTableMessenger::GetProcessType(
const G4String& aTypeName)
const
418 for (
G4int idx = 0; idx < NumberOfProcessType ; idx ++ ) {
429 void G4ProcessTableMessenger::SetNumberOfProcessType()
431 G4bool isFoundEndMark =
false;
433 for (idx = 0; idx < 1000 ; idx ++ ) {
435 isFoundEndMark = typeName.
contains(
"---");
436 if ( isFoundEndMark )
break;
438 if ( isFoundEndMark ) {
439 NumberOfProcessType = idx;
441 G4Exception(
"G4ProcessTableMessenger::SetNumberOfProcessType()",
"ProcMan014",
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void SetParameter(G4UIparameter *const newParameter)
static const G4String & GetProcessTypeName(G4ProcessType)
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
void DumpInfo(G4VProcess *process, G4ParticleDefinition *particle=0)
static G4int GetNewIntValue(const char *paramString)
void SetParameterCandidates(const char *theString)
void SetDefaultValue(const char *theDefaultValue)
G4ProcessTableMessenger(G4ProcessTable *pTable)
G4ProcessType GetProcessType() const
void SetProcessActivation(const G4String &processName, G4bool fActive)
const G4String & GetParticleName() const
static G4UImanager * GetUIpointer()
G4GLOB_DLL std::ostream G4cout
virtual G4String GetCurrentValue(G4UIcommand *command)
void SetVerboseLevel(G4int value)
void SetRange(const char *rs)
void SetGuidance(const char *aGuidance)
virtual ~G4ProcessTableMessenger()
G4UIparameter * GetParameter(G4int i) const
void AvailableForStates(G4ApplicationState s1)
const G4String & GetProcessName() const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
G4bool contains(const G4ParticleDefinition *particle) const
G4ProcNameVector * GetNameList()
G4bool contains(const std::string &) const
static G4ParticleTable * GetParticleTable()
virtual void SetNewValue(G4UIcommand *command, G4String newValues)
void SetDefaultValue(const char *defVal)
G4int GetVerboseLevel() const
std::vector< G4String > G4ProcNameVector
void SetCandidates(const char *candidateList)
void SetDefaultValue(G4int defVal)
G4ProcessVector * FindProcesses()
G4PTblDicIterator * GetIterator() const
void SetVerboseLevel(G4int value)
G4int ApplyCommand(const char *aCommand)