Geant4  10.02.p03
G4ProcessManagerMessenger Class Reference

#include <G4ProcessManagerMessenger.hh>

Inheritance diagram for G4ProcessManagerMessenger:
Collaboration diagram for G4ProcessManagerMessenger:

Public Member Functions

 G4ProcessManagerMessenger (G4ParticleTable *pTable=0)
 
virtual ~G4ProcessManagerMessenger ()
 
virtual void SetNewValue (G4UIcommand *command, G4String newValues)
 
virtual G4String GetCurrentValue (G4UIcommand *command)
 
- Public Member Functions inherited from G4UImessenger
 G4UImessenger ()
 
 G4UImessenger (const G4String &path, const G4String &dsc, G4bool commandsToBeBroadcasted=true)
 
virtual ~G4UImessenger ()
 
G4bool operator== (const G4UImessenger &messenger) const
 
G4bool CommandsShouldBeInMaster () const
 

Private Member Functions

 G4ProcessManagerMessenger (const G4ProcessManagerMessenger &)
 
G4ParticleDefinitionSetCurrentParticle ()
 

Private Attributes

G4ParticleTabletheParticleTable
 
G4ParticleDefinitioncurrentParticle
 
G4VProcesscurrentProcess
 
G4ProcessManagertheManager
 
G4ProcessVectortheProcessList
 
G4UIdirectorythisDirectory
 
G4UIcmdWithAnIntegerdumpCmd
 
G4UIcommandverboseCmd
 
G4UIcmdWithAnIntegeractivateCmd
 
G4UIcmdWithAnIntegerinactivateCmd
 

Additional Inherited Members

- Protected Member Functions inherited from G4UImessenger
G4String ItoS (G4int i)
 
G4String DtoS (G4double a)
 
G4String BtoS (G4bool b)
 
G4int StoI (G4String s)
 
G4double StoD (G4String s)
 
G4bool StoB (G4String s)
 
void AddUIcommand (G4UIcommand *newCommand)
 
void CreateDirectory (const G4String &path, const G4String &dsc, G4bool commandsToBeBroadcasted=true)
 
template<typename T >
T * CreateCommand (const G4String &cname, const G4String &dsc)
 
- Protected Attributes inherited from G4UImessenger
G4UIdirectorybaseDir
 
G4String baseDirName
 
G4bool commandsShouldBeInMaster
 

Detailed Description

Definition at line 69 of file G4ProcessManagerMessenger.hh.

Constructor & Destructor Documentation

◆ G4ProcessManagerMessenger() [1/2]

G4ProcessManagerMessenger::G4ProcessManagerMessenger ( G4ParticleTable pTable = 0)

Definition at line 62 of file G4ProcessManagerMessenger.cc.

63  :theParticleTable(pTable),
64  currentParticle(0),
65  currentProcess(0),
66  theManager(0),
68 {
70 
71  //Commnad /particle/process
72  thisDirectory = new G4UIdirectory("/particle/process/");
73  thisDirectory->SetGuidance("Process Manager control commands.");
74 
75  //Commnad /particle/process/dump
76  dumpCmd = new G4UIcmdWithAnInteger("/particle/process/dump",this);
77  dumpCmd->SetGuidance("dump process manager or process information");
78  dumpCmd->SetGuidance(" dump [process index]");
79  dumpCmd->SetGuidance(" process index: -1 for process manager");
80  dumpCmd->SetParameterName("index", true);
82 
83  //Commnad /particle/process/verbose
84  verboseCmd = new G4UIcommand("/particle/process/verbose",this);
85  verboseCmd->SetGuidance("Set Verbose Level for Process or Process Manager");
86  verboseCmd->SetGuidance(" Verbose [Verbose] [process index]");
87  verboseCmd->SetGuidance(" process index: -1 for process manager");
88  G4UIparameter* param = new G4UIparameter("Verbose",'i',true);
89  param->SetDefaultValue(1);
90  verboseCmd->SetParameter(param);
91  param = new G4UIparameter("index",'i',true);
92  param->SetDefaultValue(-1);
93  verboseCmd->SetParameter(param);
95 
96  //Commnad /particle/process/activate
97  activateCmd = new G4UIcmdWithAnInteger("/particle/process/activate",this);
98  activateCmd->SetGuidance("Activate process ");
99  activateCmd->SetGuidance(" Activate [process index]");
100  activateCmd->SetParameterName("index", false);
102  activateCmd->SetRange("index >=0");
104 
105  //Commnad /particle/process/inactivate
106  inactivateCmd = new G4UIcmdWithAnInteger("/particle/process/inactivate",this);
107  inactivateCmd->SetGuidance("Inactivate process ");
108  inactivateCmd->SetGuidance(" inactivate [process index]");
109  inactivateCmd->SetParameterName("index", false);
111  inactivateCmd->SetRange("index >=0");
113 
114 }
void SetParameter(G4UIparameter *const newParameter)
Definition: G4UIcommand.hh:152
void SetParameterName(const char *theName, G4bool omittable, G4bool currentAsDefault=false)
G4ParticleDefinition * currentParticle
void SetDefaultValue(const char *theDefaultValue)
void SetRange(const char *rs)
Definition: G4UIcommand.hh:125
void SetGuidance(const char *aGuidance)
Definition: G4UIcommand.hh:161
G4UIcmdWithAnInteger * inactivateCmd
void AvailableForStates(G4ApplicationState s1)
Definition: G4UIcommand.cc:239
static G4ParticleTable * GetParticleTable()
void SetDefaultValue(G4int defVal)
Here is the call graph for this function:

◆ ~G4ProcessManagerMessenger()

G4ProcessManagerMessenger::~G4ProcessManagerMessenger ( )
virtual

Definition at line 116 of file G4ProcessManagerMessenger.cc.

117 {
118  delete activateCmd;
119  delete inactivateCmd;
120  delete verboseCmd;
121  delete dumpCmd;
122  delete thisDirectory;
123 }
G4UIcmdWithAnInteger * inactivateCmd

◆ G4ProcessManagerMessenger() [2/2]

G4ProcessManagerMessenger::G4ProcessManagerMessenger ( const G4ProcessManagerMessenger )
inlineprivate

Definition at line 86 of file G4ProcessManagerMessenger.hh.

87  : G4UImessenger() {};
Here is the call graph for this function:

Member Function Documentation

◆ GetCurrentValue()

G4String G4ProcessManagerMessenger::GetCurrentValue ( G4UIcommand command)
virtual

Reimplemented from G4UImessenger.

Definition at line 203 of file G4ProcessManagerMessenger.cc.

204 {
205  if(SetCurrentParticle() == 0) return "";
206 
207  if( command==verboseCmd ){
208  //Commnad /particle/process/Verbose
210  } else {
211  return "";
212  }
213 }
G4int GetVerboseLevel() const
static G4String ConvertToString(G4bool boolVal)
Definition: G4UIcommand.cc:371
G4ParticleDefinition * SetCurrentParticle()
Here is the call graph for this function:

◆ SetCurrentParticle()

G4ParticleDefinition * G4ProcessManagerMessenger::SetCurrentParticle ( )
private

Definition at line 125 of file G4ProcessManagerMessenger.cc.

126 {
127  // set currentParticle pointer
128  // get particle name by asking G4ParticleMessenger
129  G4String particleName = G4UImanager::GetUIpointer()->GetCurrentStringValue("/particle/select");
130 
132  if (currentParticle == 0) {
133  theManager = 0;
134  G4cout << "G4ProcessManagerMessenger::SetCurrentParticle() ";
135  G4cout << particleName << " not found " << G4endl;
136  } else {
139  }
140  return currentParticle;
141 }
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
G4ProcessVector * GetProcessList() const
G4String GetCurrentStringValue(const char *aCommand, G4int parameterNumber=1, G4bool reGet=true)
Definition: G4UImanager.cc:182
G4ParticleDefinition * currentParticle
G4ProcessManager * GetProcessManager() const
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:58
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetNewValue()

void G4ProcessManagerMessenger::SetNewValue ( G4UIcommand command,
G4String  newValues 
)
virtual

Reimplemented from G4UImessenger.

Definition at line 143 of file G4ProcessManagerMessenger.cc.

144 {
145  if (SetCurrentParticle()==0) {
146  G4cout << "Particle is not selected yet !! Command ignored." << G4endl;
147  return;
148  }
149  if( command == dumpCmd ){
150  //Commnad /particle/process/dump
151  G4int index = dumpCmd->GetNewIntValue(newValue);
152  if (index <0) {
153  theManager->DumpInfo();
154  } else if ( index < theManager->GetProcessListLength()){
155  currentProcess = (*theProcessList)(index);
156  if (currentProcess == 0) {
157  G4cout << " no process at index of " << index;
158  G4cout << "in the Process Vector" << G4endl;
159  } else {
161  }
162  } else {
163  G4cout << " illegal index !!! " << G4endl;
164  currentProcess = 0;
165  }
166 
167  } else if( command==activateCmd ) {
168  //Commnad /particle/process/activate
170  G4UImanager::GetUIpointer()->ApplyCommand("/run/physicsModified");
171 
172  } else if( command==inactivateCmd ) {
173  //Commnad /particle/process/inactivate
175  G4UImanager::GetUIpointer()->ApplyCommand("/run/physicsModified");
176 
177  } else if( command==verboseCmd ) {
178  //Commnad /particle/process/Verbose
179  // inputstream for newValues
180  const char* temp = (const char*)(newValue);
181  std::istringstream is((char*)temp);
182  G4int Verbose, index;
183  is >>Verbose >>index;
184  if (index <0) {
185  theManager->SetVerboseLevel(Verbose);
186 
187  } else if ( index < theManager->GetProcessListLength()){
188  currentProcess = (*theProcessList)(index);
189  if (currentProcess == 0) {
190  G4cout << " no process at index of " << index;
191  G4cout << "in the Process Vector" << G4endl;
192  } else {
194  }
195  } else {
196  G4cout << " illegal index !!! " << G4endl;
197  currentProcess = 0;
198  }
199  }
200 }
Int_t index
static G4int GetNewIntValue(const char *paramString)
void SetVerboseLevel(G4int value)
int G4int
Definition: G4Types.hh:78
G4VProcess * SetProcessActivation(G4VProcess *aProcess, G4bool fActive)
static G4UImanager * GetUIpointer()
Definition: G4UImanager.cc:58
G4GLOB_DLL std::ostream G4cout
G4UIcmdWithAnInteger * inactivateCmd
virtual void DumpInfo() const
Definition: G4VProcess.cc:178
G4ParticleDefinition * SetCurrentParticle()
#define G4endl
Definition: G4ios.hh:61
void SetVerboseLevel(G4int value)
Definition: G4VProcess.hh:437
G4int ApplyCommand(const char *aCommand)
Definition: G4UImanager.cc:446
Here is the call graph for this function:

Member Data Documentation

◆ activateCmd

G4UIcmdWithAnInteger* G4ProcessManagerMessenger::activateCmd
private

Definition at line 104 of file G4ProcessManagerMessenger.hh.

◆ currentParticle

G4ParticleDefinition* G4ProcessManagerMessenger::currentParticle
private

Definition at line 96 of file G4ProcessManagerMessenger.hh.

◆ currentProcess

G4VProcess* G4ProcessManagerMessenger::currentProcess
private

Definition at line 97 of file G4ProcessManagerMessenger.hh.

◆ dumpCmd

G4UIcmdWithAnInteger* G4ProcessManagerMessenger::dumpCmd
private

Definition at line 102 of file G4ProcessManagerMessenger.hh.

◆ inactivateCmd

G4UIcmdWithAnInteger* G4ProcessManagerMessenger::inactivateCmd
private

Definition at line 105 of file G4ProcessManagerMessenger.hh.

◆ theManager

G4ProcessManager* G4ProcessManagerMessenger::theManager
private

Definition at line 98 of file G4ProcessManagerMessenger.hh.

◆ theParticleTable

G4ParticleTable* G4ProcessManagerMessenger::theParticleTable
private

Definition at line 95 of file G4ProcessManagerMessenger.hh.

◆ theProcessList

G4ProcessVector* G4ProcessManagerMessenger::theProcessList
private

Definition at line 99 of file G4ProcessManagerMessenger.hh.

◆ thisDirectory

G4UIdirectory* G4ProcessManagerMessenger::thisDirectory
private

Definition at line 101 of file G4ProcessManagerMessenger.hh.

◆ verboseCmd

G4UIcommand* G4ProcessManagerMessenger::verboseCmd
private

Definition at line 103 of file G4ProcessManagerMessenger.hh.


The documentation for this class was generated from the following files: