Geant4  10.02.p03
G4ProcessTable Class Reference

#include <G4ProcessTable.hh>

Collaboration diagram for G4ProcessTable:

Public Types

typedef std::vector< G4ProcTblElement * > G4ProcTableVector
 
typedef std::vector< G4StringG4ProcNameVector
 

Public Member Functions

 G4ProcessTable ()
 
 ~G4ProcessTable ()
 
G4int Length () const
 
G4int Insert (G4VProcess *aProcess, G4ProcessManager *aProcMgr)
 
G4int Remove (G4VProcess *aProcess, G4ProcessManager *aProcMgr)
 
G4VProcessFindProcess (const G4String &processName, const G4String &particleName) const
 
G4VProcessFindProcess (const G4String &processName, const G4ParticleDefinition *particle) const
 
G4VProcessFindProcess (const G4String &processName, const G4ProcessManager *processManager) const
 
G4ProcessVectorFindProcesses ()
 
G4ProcessVectorFindProcesses (const G4ProcessManager *processManager)
 
G4ProcessVectorFindProcesses (const G4String &processName)
 
G4ProcessVectorFindProcesses (G4ProcessType processType)
 
void SetProcessActivation (const G4String &processName, G4bool fActive)
 
void SetProcessActivation (const G4String &processName, const G4String &particleName, G4bool fActive)
 
void SetProcessActivation (const G4String &processName, G4ParticleDefinition *particle, G4bool fActive)
 
void SetProcessActivation (const G4String &processName, G4ProcessManager *processManager, G4bool fActive)
 
void SetProcessActivation (G4ProcessType processType, G4bool fActive)
 
void SetProcessActivation (G4ProcessType processType, const G4String &particleName, G4bool fActive)
 
void SetProcessActivation (G4ProcessType processType, G4ParticleDefinition *particle, G4bool fActive)
 
void SetProcessActivation (G4ProcessType processType, G4ProcessManager *processManager, G4bool fActive)
 
G4ProcNameVectorGetNameList ()
 
G4ProcTableVectorGetProcTableVector ()
 
void DumpInfo (G4VProcess *process, G4ParticleDefinition *particle=0)
 
G4UImessengerCreateMessenger ()
 
void DeleteMessenger ()
 
void SetVerboseLevel (G4int value)
 
G4int GetVerboseLevel () const
 

Static Public Member Functions

static G4ProcessTableGetProcessTable ()
 

Private Member Functions

 G4ProcessTable (const G4ProcessTable &right)
 
G4ProcessTableoperator= (const G4ProcessTable &right)
 
G4int operator== (const G4ProcessTable &right) const
 
G4int operator!= (const G4ProcessTable &right) const
 
G4ProcTableVectorFind (G4ProcTableVector *procTableVector, const G4String &processName)
 
G4ProcTableVectorFind (G4ProcTableVector *procTableVector, G4ProcessType processType)
 
G4ProcessVectorExtractProcesses (G4ProcTableVector *procTableVector)
 

Private Attributes

G4ProcessTableMessengerfProcTblMessenger
 
G4ProcTableVectorfProcTblVector
 
G4ProcNameVectorfProcNameVector
 
G4ProcTableVectortmpTblVector
 
G4int verboseLevel
 

Static Private Attributes

static G4ThreadLocal G4ProcessTablefProcessTable =0
 

Detailed Description

Definition at line 59 of file G4ProcessTable.hh.

Member Typedef Documentation

◆ G4ProcNameVector

Definition at line 133 of file G4ProcessTable.hh.

◆ G4ProcTableVector

Definition at line 132 of file G4ProcessTable.hh.

Constructor & Destructor Documentation

◆ G4ProcessTable() [1/2]

G4ProcessTable::G4ProcessTable ( )

Definition at line 44 of file G4ProcessTable.cc.

44  :verboseLevel(1)
45 {
46 #ifdef G4VERBOSE
47  if (verboseLevel>1){
48  G4cout << "-- G4ProcessTable constructor --" << G4endl;
49  }
50 #endif
55 }
G4ProcessTableMessenger * fProcTblMessenger
G4ProcTableVector * tmpTblVector
G4ProcTableVector * fProcTblVector
G4GLOB_DLL std::ostream G4cout
std::vector< G4String > G4ProcNameVector
std::vector< G4ProcTblElement * > G4ProcTableVector
G4ProcNameVector * fProcNameVector
#define G4endl
Definition: G4ios.hh:61
Here is the caller graph for this function:

◆ ~G4ProcessTable()

G4ProcessTable::~G4ProcessTable ( )

Definition at line 73 of file G4ProcessTable.cc.

74 {
75 #ifdef G4VERBOSE
76  if (verboseLevel>1){
77  G4cout << "-- G4ProcessTable destructor --" << G4endl;
78  }
79 #endif
80 
81  if ( tmpTblVector != 0) {
82  tmpTblVector ->clear();
83  delete tmpTblVector;
84  }
85 
86  if ( fProcTblVector != 0) {
87  G4ProcTableVector::iterator idx;
88 
89  // destruction of processes has moved to G4VUserPhysicsList
90  for (idx=fProcTblVector->begin(); idx!=fProcTblVector->end(); ++idx) {
91  // delete all processes
92  // delete (*idx)->GetProcess();
93  delete (*idx);
94  }
95  fProcTblVector ->clear();
96  delete fProcTblVector;
97  }
98 
99  if ( fProcNameVector != 0) {
100  fProcNameVector ->clear();
101  delete fProcNameVector;
102  }
103  fProcessTable =0;
104 }
static G4ThreadLocal G4ProcessTable * fProcessTable
G4ProcTableVector * tmpTblVector
G4ProcTableVector * fProcTblVector
G4GLOB_DLL std::ostream G4cout
G4ProcNameVector * fProcNameVector
#define G4endl
Definition: G4ios.hh:61

◆ G4ProcessTable() [2/2]

G4ProcessTable::G4ProcessTable ( const G4ProcessTable right)
private

Definition at line 58 of file G4ProcessTable.cc.

59  :verboseLevel(1)
60 {
61  fProcTblVector = 0;
62  fProcNameVector = 0;
63  tmpTblVector = 0;
65 #ifdef G4VERBOSE
66  if (verboseLevel>0){
67  G4cout << "-- G4ProcessTable copy constructor --" << G4endl;
68  }
69 #endif
70 }
G4ProcessTableMessenger * fProcTblMessenger
G4ProcTableVector * tmpTblVector
G4ProcTableVector * fProcTblVector
G4GLOB_DLL std::ostream G4cout
G4ProcNameVector * fProcNameVector
#define G4endl
Definition: G4ios.hh:61

Member Function Documentation

◆ CreateMessenger()

G4UImessenger * G4ProcessTable::CreateMessenger ( )

Definition at line 107 of file G4ProcessTable.cc.

108 {
109  if (fProcTblMessenger == 0) {
111  }
112  return fProcTblMessenger;
113 }
G4ProcessTableMessenger * fProcTblMessenger
Here is the caller graph for this function:

◆ DeleteMessenger()

void G4ProcessTable::DeleteMessenger ( )

Definition at line 116 of file G4ProcessTable.cc.

117 {
118  if (fProcTblMessenger != 0) {
119  delete fProcTblMessenger;
120  }
121 }
G4ProcessTableMessenger * fProcTblMessenger
Here is the caller graph for this function:

◆ DumpInfo()

void G4ProcessTable::DumpInfo ( G4VProcess process,
G4ParticleDefinition particle = 0 
)

Definition at line 570 of file G4ProcessTable.cc.

572 {
573  G4ProcTableVector::iterator itr;
574  G4int idxTbl=0;
575  G4ProcTblElement* anElement=0;
576  G4bool isFoundInTbl = false;
577  G4ProcessManager* manager=0;
578  G4int idx;
579  // loop over all elements
580  for (itr=fProcTblVector->begin(); itr!=fProcTblVector->end(); ++itr, ++idxTbl) {
581  anElement = (*itr);
582  if (process == anElement->GetProcess() ){
583  if (particle!=0) {
584  for (idx=0; idx<anElement->Length(); idx++){
585  manager = anElement->GetProcessManager(idx);
586  if (particle == manager->GetParticleType()) {
587  isFoundInTbl = true;
588  break;
589  }
590  }
591  } else {
592  isFoundInTbl = true;
593  }
594  break;
595  }
596  }
597  if (!isFoundInTbl ) return;
598 
599  G4int tmpVerbose = process->GetVerboseLevel();
600  process->SetVerboseLevel(verboseLevel);
601  process->DumpInfo();
602  process->SetVerboseLevel(tmpVerbose);
603  if (particle==0) {
604  for (idx=0; idx<anElement->Length(); idx++){
605  manager = anElement->GetProcessManager(idx);
606  G4cout << " for " << manager->GetParticleType()->GetParticleName();
607  G4cout << G4endl;
608 #ifdef G4VERBOSE
609  if (verboseLevel >2){
610  tmpVerbose = manager->GetVerboseLevel();
611  manager->SetVerboseLevel(verboseLevel);
612  manager->DumpInfo();
613  manager->SetVerboseLevel(tmpVerbose);
614  }
615 #endif
616  }
617  } else {
618  G4cout << " for " << manager->GetParticleType()->GetParticleName();
619  G4cout << G4endl;
620 #ifdef G4VERBOSE
621  if (verboseLevel >2){
622  tmpVerbose = manager->GetVerboseLevel();
623  manager->SetVerboseLevel(verboseLevel);
624  manager->DumpInfo();
625  manager->SetVerboseLevel(tmpVerbose);
626  }
627 #endif
628  }
629 }
G4int GetVerboseLevel() const
void SetVerboseLevel(G4int value)
G4int GetVerboseLevel() const
Definition: G4VProcess.hh:442
int G4int
Definition: G4Types.hh:78
G4ProcTableVector * fProcTblVector
G4VProcess * GetProcess() const
G4ParticleDefinition * GetParticleType() const
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
bool G4bool
Definition: G4Types.hh:79
G4int Length() const
virtual void DumpInfo() const
Definition: G4VProcess.cc:178
G4ProcessManager * GetProcessManager(G4int index) const
#define G4endl
Definition: G4ios.hh:61
void SetVerboseLevel(G4int value)
Definition: G4VProcess.hh:437
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ExtractProcesses()

G4ProcessVector * G4ProcessTable::ExtractProcesses ( G4ProcTableVector procTableVector)
private

Definition at line 406 of file G4ProcessTable.cc.

407 {
408  G4ProcessVector* procList = new G4ProcessVector();
409  G4ProcTableVector::iterator itr;
410  // loop over all elements
411  for (itr=procTblVector->begin(); itr!=procTblVector->end(); ++itr) {
412  G4ProcTblElement* anElement = (*itr);
413  procList->insert( anElement->GetProcess() );
414  }
415  return procList;
416 }
G4VProcess * GetProcess() const
G4bool insert(G4VProcess *aProcess)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Find() [1/2]

G4ProcessTable::G4ProcTableVector * G4ProcessTable::Find ( G4ProcTableVector procTableVector,
const G4String processName 
)
private

Definition at line 347 of file G4ProcessTable.cc.

350 {
351  tmpTblVector->clear();
352 
353  G4ProcTableVector::iterator itr;
354  G4bool isFound = false;
355  G4ProcTblElement* anElement=0;
356  for (itr=fProcTblVector->begin(); itr!=fProcTblVector->end(); ++itr) {
357  anElement = (*itr);
358  // check name
359  if ( anElement->GetProcessName() == processName ) {
360  isFound = true;
361  tmpTblVector->push_back(anElement);
362  }
363  }
364 
365  if (!isFound && verboseLevel>0){
366 #ifdef G4VERBOSE
367  G4cout << " G4ProcessTable::Find :" ;
368  G4cout << " The Process[" << processName << "] is not found " << G4endl;
369 #endif
370  }
371 
372  return tmpTblVector;
373 
374 }
G4ProcTableVector * tmpTblVector
G4ProcTableVector * fProcTblVector
G4GLOB_DLL std::ostream G4cout
bool G4bool
Definition: G4Types.hh:79
const G4String & GetProcessName() const
#define G4endl
Definition: G4ios.hh:61
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Find() [2/2]

G4ProcessTable::G4ProcTableVector * G4ProcessTable::Find ( G4ProcTableVector procTableVector,
G4ProcessType  processType 
)
private

Definition at line 376 of file G4ProcessTable.cc.

379 {
380  tmpTblVector->clear();
381 
382  G4ProcTableVector::iterator itr;
383  G4bool isFound = false;
384  G4ProcTblElement* anElement=0;
385  for (itr=fProcTblVector->begin(); itr!=fProcTblVector->end(); ++itr) {
386  anElement = (*itr);
387  // check name
388  if ( anElement->GetProcess()->GetProcessType() == processType ) {
389  isFound = true;
390  tmpTblVector->push_back(anElement);
391  }
392  }
393 
394  if (!isFound && verboseLevel>0){
395 #ifdef G4VERBOSE
396  G4cout << " G4ProcessTable::Find :" ;
397  G4cout << " The ProcessType[" << processType << "] is not found " << G4endl;
398 #endif
399  }
400 
401  return tmpTblVector;
402 
403 }
G4ProcTableVector * tmpTblVector
G4ProcTableVector * fProcTblVector
G4VProcess * GetProcess() const
G4GLOB_DLL std::ostream G4cout
bool G4bool
Definition: G4Types.hh:79
#define G4endl
Definition: G4ios.hh:61
G4ProcessType GetProcessType() const
Definition: G4VProcess.hh:414
Here is the call graph for this function:

◆ FindProcess() [1/3]

G4VProcess* G4ProcessTable::FindProcess ( const G4String processName,
const G4String particleName 
) const
Here is the caller graph for this function:

◆ FindProcess() [2/3]

G4VProcess* G4ProcessTable::FindProcess ( const G4String processName,
const G4ParticleDefinition particle 
) const

◆ FindProcess() [3/3]

G4VProcess * G4ProcessTable::FindProcess ( const G4String processName,
const G4ProcessManager processManager 
) const

Definition at line 315 of file G4ProcessTable.cc.

318 {
319  G4ProcTableVector::iterator itr;
320  G4int idxTbl = 0;
321  G4bool isFound = false;
322  G4ProcTblElement* anElement=0;
323  for (itr=fProcTblVector->begin(); itr!=fProcTblVector->end(); ++itr, ++idxTbl) {
324  anElement = (*itr);
325  // check name
326  if ( anElement->GetProcessName() == processName ) {
327  // check if the processManage is included
328  if ( anElement->Contains(processManager) ) {
329  isFound = true;
330  break;
331  }
332  }
333  }
334 #ifdef G4VERBOSE
335  if (!isFound && verboseLevel>1){
336  G4cout << " G4ProcessTable::FindProcess :" ;
337  G4cout << " The Process[" << processName << "] is not found ";
338  G4cout << " for " << processManager->GetParticleType()->GetParticleName() << G4endl;
339  }
340 #endif
341 
342  if (isFound) return anElement->GetProcess();
343  else return 0;
344 }
G4bool Contains(const G4ProcessManager *pManager) const
int G4int
Definition: G4Types.hh:78
G4ProcTableVector * fProcTblVector
G4VProcess * GetProcess() const
G4ParticleDefinition * GetParticleType() const
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
bool G4bool
Definition: G4Types.hh:79
const G4String & GetProcessName() const
#define G4endl
Definition: G4ios.hh:61
Here is the call graph for this function:

◆ FindProcesses() [1/4]

G4ProcessVector * G4ProcessTable::FindProcesses ( )

Definition at line 419 of file G4ProcessTable.cc.

420 {
422 }
G4ProcTableVector * fProcTblVector
G4ProcessVector * ExtractProcesses(G4ProcTableVector *procTableVector)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FindProcesses() [2/4]

G4ProcessVector * G4ProcessTable::FindProcesses ( const G4ProcessManager processManager)

Definition at line 425 of file G4ProcessTable.cc.

426 {
427  G4ProcessVector* procList = pManager->GetProcessList();
428  return new G4ProcessVector(*procList);
429 }
Here is the call graph for this function:

◆ FindProcesses() [3/4]

G4ProcessVector * G4ProcessTable::FindProcesses ( const G4String processName)

Definition at line 432 of file G4ProcessTable.cc.

433 {
434  G4ProcTableVector* pTblVector = Find(fProcTblVector, processName);
435  return ExtractProcesses(pTblVector);
436 }
G4ProcTableVector * Find(G4ProcTableVector *procTableVector, const G4String &processName)
G4ProcTableVector * fProcTblVector
std::vector< G4ProcTblElement * > G4ProcTableVector
G4ProcessVector * ExtractProcesses(G4ProcTableVector *procTableVector)
Here is the call graph for this function:

◆ FindProcesses() [4/4]

G4ProcessVector * G4ProcessTable::FindProcesses ( G4ProcessType  processType)

Definition at line 439 of file G4ProcessTable.cc.

440 {
441  G4ProcTableVector* pTblVector = Find(fProcTblVector, processType);
442  return ExtractProcesses(pTblVector);
443 }
G4ProcTableVector * Find(G4ProcTableVector *procTableVector, const G4String &processName)
G4ProcTableVector * fProcTblVector
std::vector< G4ProcTblElement * > G4ProcTableVector
G4ProcessVector * ExtractProcesses(G4ProcTableVector *procTableVector)
Here is the call graph for this function:

◆ GetNameList()

G4ProcNameVector* G4ProcessTable::GetNameList ( )
Here is the caller graph for this function:

◆ GetProcessTable()

G4ProcessTable * G4ProcessTable::GetProcessTable ( )
static

Definition at line 152 of file G4ProcessTable.cc.

153 {
154  static G4ThreadLocal G4ProcessTable *theProcessTable_G4MT_TLS_ = 0 ; if (!theProcessTable_G4MT_TLS_) theProcessTable_G4MT_TLS_ = new G4ProcessTable ; G4ProcessTable &theProcessTable = *theProcessTable_G4MT_TLS_;
155  if (!fProcessTable){
156  fProcessTable = &theProcessTable;
157  }
158  return fProcessTable;
159 }
static G4ThreadLocal G4ProcessTable * fProcessTable
#define G4ThreadLocal
Definition: tls.hh:89
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetProcTableVector()

G4ProcTableVector* G4ProcessTable::GetProcTableVector ( )

◆ GetVerboseLevel()

G4int G4ProcessTable::GetVerboseLevel ( ) const
Here is the caller graph for this function:

◆ Insert()

G4int G4ProcessTable::Insert ( G4VProcess aProcess,
G4ProcessManager aProcMgr 
)

Definition at line 162 of file G4ProcessTable.cc.

164 {
165  if ( (aProcess == 0) || ( aProcMgr == 0 ) ){
166 #ifdef G4VERBOSE
167  if (verboseLevel>0){
168  G4cout << "G4ProcessTable::Insert : arguments are 0 pointer "
169  <<aProcess <<","<< aProcMgr << G4endl;
170  }
171 #endif
172  return -1;
173  }
174 
175 #ifdef G4VERBOSE
176  if (verboseLevel>1){
177  G4cout << "G4ProcessTable::Insert ";
178  G4cout << " Process[" << aProcess->GetProcessName() << "]";
179  G4cout << " Particle[" << aProcMgr->GetParticleType()->GetParticleName() << "]";
180  G4cout << G4endl;
181  }
182 #endif
183 
184  G4ProcTableVector::iterator itr;
185  G4int idxTbl=0;
186  G4ProcTblElement* anElement;
187  G4bool isFoundInTbl = false;
188  // loop over all elements
189  for (itr=fProcTblVector->begin(); itr!=fProcTblVector->end(); ++itr, ++idxTbl) {
190  anElement = (*itr);
191  // check if this process is included
192  if (aProcess == anElement->GetProcess()) {
193  isFoundInTbl = true;
194 
195  // add the process manager into the element
196  // unless this process manager is included
197  if (!anElement->Contains(aProcMgr)) {
198  anElement->Insert(aProcMgr);
199 #ifdef G4VERBOSE
200  if (verboseLevel>2){
201  G4cout << " This Process Manager is registered !! " << G4endl;
202  }
203 #endif
204  }
205  break;
206  }
207  }
208  // add this process into the table by creating a new element
209  if (!isFoundInTbl) {
210  G4ProcTblElement* newElement = new G4ProcTblElement(aProcess);
211  newElement->Insert(aProcMgr);
212  fProcTblVector->push_back(newElement);
213  // add into name vector
214  G4ProcNameVector::iterator ip;
215  G4bool isFound = false;
216  for (ip=fProcNameVector->begin(); ip!=fProcNameVector->end(); ++ip) {
217  isFound |= (aProcess->GetProcessName() == (*ip));
218  }
219  if (!isFound) {
220  fProcNameVector->push_back(aProcess->GetProcessName() );
221 #ifdef G4VERBOSE
222  if (verboseLevel>2){
223  G4cout << " This Process is registered !! " << G4endl;
224  }
225 #endif
226  }
227  }
228  return idxTbl;
229 }
G4bool Contains(const G4ProcessManager *pManager) const
int G4int
Definition: G4Types.hh:78
G4ProcTableVector * fProcTblVector
G4VProcess * GetProcess() const
G4ParticleDefinition * GetParticleType() const
const G4String & GetProcessName() const
Definition: G4VProcess.hh:408
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
bool G4bool
Definition: G4Types.hh:79
void Insert(G4ProcessManager *aProcMgr)
G4ProcNameVector * fProcNameVector
#define G4endl
Definition: G4ios.hh:61
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Length()

G4int G4ProcessTable::Length ( ) const
Here is the caller graph for this function:

◆ operator!=()

G4int G4ProcessTable::operator!= ( const G4ProcessTable right) const
private

Definition at line 142 of file G4ProcessTable.cc.

143 {
144  return (this != &right);
145 }

◆ operator=()

G4ProcessTable & G4ProcessTable::operator= ( const G4ProcessTable right)
private

Definition at line 125 of file G4ProcessTable.cc.

126 {
127 #ifdef G4VERBOSE
128  if (verboseLevel>0){
129  G4cout << "-- G4ProcessTable assignment operator --" << G4endl;
130  }
131 #endif
132  return *this;
133 }
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61

◆ operator==()

G4int G4ProcessTable::operator== ( const G4ProcessTable right) const
private

Definition at line 136 of file G4ProcessTable.cc.

137 {
138  return (this == &right);
139 }

◆ Remove()

G4int G4ProcessTable::Remove ( G4VProcess aProcess,
G4ProcessManager aProcMgr 
)

Definition at line 232 of file G4ProcessTable.cc.

234 {
235  if ( (aProcess == 0) || ( aProcMgr == 0 ) ){
236 #ifdef G4VERBOSE
237  if (verboseLevel>0){
238  G4cout << "G4ProcessTable::Remove : arguments are 0 pointer "<< G4endl;
239  }
240 #endif
241  return -1;
242  }
243 
244 #ifdef G4VERBOSE
245  if (verboseLevel>1){
246  G4cout << "G4ProcessTable::Remove ";
247  G4cout << " Process[" << aProcess->GetProcessName() << "]";
248  G4cout << " Particle[" << aProcMgr->GetParticleType()->GetParticleName() << "]" << G4endl;
249  }
250 #endif
251 
252  G4ProcTableVector::iterator itr;
253  G4int idxTbl=0;
254  G4ProcTblElement* anElement=0;
255  G4bool isFound = false;
256  // loop over all elements
257  for (itr=fProcTblVector->begin(); itr!=fProcTblVector->end(); ++itr, ++idxTbl) {
258  anElement = (*itr);
259 
260  // check if this process is included
261  if (aProcess == anElement->GetProcess()) {
262  isFound = anElement->Contains(aProcMgr);
263  // remove the process manager from the element
264  anElement->Remove(aProcMgr);
265 #ifdef G4VERBOSE
266  if (verboseLevel>2){
267  G4cout << " This Process Manager is removed !! " << G4endl;
268  }
269 #endif
270  break;
271  }
272  }
273  //
274  if (!isFound) {
275 #ifdef G4VERBOSE
276  if (verboseLevel>0){
277  G4cout << " This Process Manager is not registered !! " << G4endl;
278  }
279 #endif
280  return -1;
281  }
282  // remove the element if it has no entry
283  if (anElement->Length() == 0){
284  fProcTblVector->erase(itr);
285  delete anElement;
286  // check other prcesses with same name exist or not
287  G4bool isSameName = false;
288  for (itr=fProcTblVector->begin(); itr!=fProcTblVector->end(); ++itr) {
289  anElement = (*itr);
290  if (anElement->GetProcessName() == aProcess->GetProcessName()) {
291  isSameName = true;
292  break;
293  }
294  }
295  // remove from name vector
296  if (!isSameName ) {
297  G4ProcNameVector::iterator i;
298  for (i=fProcNameVector->begin(); i!=fProcNameVector->end(); ++i) {
299  if ( *i == aProcess->GetProcessName() ) {
300  fProcNameVector->erase(i);
301  break;
302  }
303  }
304  }
305 #ifdef G4VERBOSE
306  if (verboseLevel>1){
307  G4cout << " This Process is removed !! " << G4endl;
308  }
309 #endif
310  }
311  return idxTbl;
312 }
G4bool Contains(const G4ProcessManager *pManager) const
int G4int
Definition: G4Types.hh:78
G4ProcTableVector * fProcTblVector
G4VProcess * GetProcess() const
G4ParticleDefinition * GetParticleType() const
const G4String & GetProcessName() const
Definition: G4VProcess.hh:408
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
bool G4bool
Definition: G4Types.hh:79
G4int Length() const
const G4String & GetProcessName() const
void Remove(G4ProcessManager *aProcMgr)
G4ProcNameVector * fProcNameVector
#define G4endl
Definition: G4ios.hh:61
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetProcessActivation() [1/8]

void G4ProcessTable::SetProcessActivation ( const G4String processName,
G4bool  fActive 
)

Definition at line 446 of file G4ProcessTable.cc.

448 {
449 #ifdef G4VERBOSE
450  if (verboseLevel>1){
451  G4cout << " G4ProcessTable::SetProcessActivation:" ;
452  G4cout << " The Process[" << processName << "] "<< G4endl;
453  }
454 #endif
455 
456  G4ProcTableVector* pTblVector = Find(fProcTblVector, processName);
457  G4ProcTableVector::iterator itr;
458  G4ProcTblElement* anElement;
459  // loop over all elements
460  for (itr=pTblVector->begin(); itr!=pTblVector->end(); ++itr) {
461  anElement = (*itr);
462  G4VProcess* process = anElement->GetProcess();
463  for (G4int idx = 0 ; idx < anElement->Length(); idx++) {
464  G4ProcessManager* manager = anElement->GetProcessManager(idx);
465  manager->SetProcessActivation(process, fActive);
466 #ifdef G4VERBOSE
467  if (verboseLevel>1){
468  G4cout << " for " << manager->GetParticleType()->GetParticleName();
469  G4cout << " Index = " << manager->GetProcessIndex(process);
470  G4cout << G4endl;
471  }
472 #endif
473  }
474  }
475 }
int G4int
Definition: G4Types.hh:78
G4VProcess * SetProcessActivation(G4VProcess *aProcess, G4bool fActive)
G4ProcTableVector * Find(G4ProcTableVector *procTableVector, const G4String &processName)
G4ProcTableVector * fProcTblVector
G4VProcess * GetProcess() const
G4ParticleDefinition * GetParticleType() const
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
G4int Length() const
std::vector< G4ProcTblElement * > G4ProcTableVector
G4ProcessManager * GetProcessManager(G4int index) const
#define G4endl
Definition: G4ios.hh:61
G4int GetProcessIndex(G4VProcess *) const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetProcessActivation() [2/8]

void G4ProcessTable::SetProcessActivation ( const G4String processName,
const G4String particleName,
G4bool  fActive 
)

◆ SetProcessActivation() [3/8]

void G4ProcessTable::SetProcessActivation ( const G4String processName,
G4ParticleDefinition particle,
G4bool  fActive 
)

◆ SetProcessActivation() [4/8]

void G4ProcessTable::SetProcessActivation ( const G4String processName,
G4ProcessManager processManager,
G4bool  fActive 
)

Definition at line 478 of file G4ProcessTable.cc.

482 {
483 #ifdef G4VERBOSE
484  if (verboseLevel>1){
485  G4cout << " G4ProcessTable::SetProcessActivation:" ;
486  G4cout << " The Process[" << processName << "] "<< G4endl;
487  }
488 #endif
489 
490  G4VProcess* process = FindProcess( processName, processManager);
491  if ( process != 0) {
492  processManager->SetProcessActivation(process, fActive);
493 #ifdef G4VERBOSE
494  if (verboseLevel>1){
495  G4cout << " for " << processManager->GetParticleType()->GetParticleName();
496  G4cout << " Index = " << processManager->GetProcessIndex(process) << G4endl;
497  }
498 #endif
499  }
500 }
G4VProcess * FindProcess(const G4String &processName, const G4String &particleName) const
G4VProcess * SetProcessActivation(G4VProcess *aProcess, G4bool fActive)
G4ParticleDefinition * GetParticleType() const
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
G4int GetProcessIndex(G4VProcess *) const
Here is the call graph for this function:

◆ SetProcessActivation() [5/8]

void G4ProcessTable::SetProcessActivation ( G4ProcessType  processType,
G4bool  fActive 
)

Definition at line 504 of file G4ProcessTable.cc.

506 {
507 #ifdef G4VERBOSE
508  if (verboseLevel>1){
509  G4cout << " G4ProcessTable::SetProcessActivation:" ;
510  G4cout << " The ProcessType[" << G4int(processType) << "] "<< G4endl;
511  }
512 #endif
513 
514  G4ProcTableVector* pTblVector = Find(fProcTblVector, processType);
515  G4ProcTableVector::iterator itr;
516  G4ProcTblElement* anElement;
517  // loop over all elements
518  for (itr=pTblVector->begin(); itr!=pTblVector->end(); ++itr) {
519  anElement = (*itr);
520  G4VProcess* process = anElement->GetProcess();
521 #ifdef G4VERBOSE
522  if (verboseLevel>1){
523  G4cout << " The Process[" << process->GetProcessName()<< "] "<< G4endl;
524  }
525 #endif
526  for (G4int idx = 0 ; idx < anElement->Length(); idx++) {
527  G4ProcessManager* manager = anElement->GetProcessManager(idx);
528  manager->SetProcessActivation(process, fActive);
529 #ifdef G4VERBOSE
530  if (verboseLevel>1){
531  G4cout << " for " << manager->GetParticleType()->GetParticleName();
532  G4cout << " Index = " << manager->GetProcessIndex(process) << G4endl;
533  }
534 #endif
535  }
536  }
537 }
int G4int
Definition: G4Types.hh:78
G4VProcess * SetProcessActivation(G4VProcess *aProcess, G4bool fActive)
G4ProcTableVector * Find(G4ProcTableVector *procTableVector, const G4String &processName)
G4ProcTableVector * fProcTblVector
G4VProcess * GetProcess() const
G4ParticleDefinition * GetParticleType() const
const G4String & GetProcessName() const
Definition: G4VProcess.hh:408
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
G4int Length() const
std::vector< G4ProcTblElement * > G4ProcTableVector
G4ProcessManager * GetProcessManager(G4int index) const
#define G4endl
Definition: G4ios.hh:61
G4int GetProcessIndex(G4VProcess *) const
Here is the call graph for this function:

◆ SetProcessActivation() [6/8]

void G4ProcessTable::SetProcessActivation ( G4ProcessType  processType,
const G4String particleName,
G4bool  fActive 
)

◆ SetProcessActivation() [7/8]

void G4ProcessTable::SetProcessActivation ( G4ProcessType  processType,
G4ParticleDefinition particle,
G4bool  fActive 
)

◆ SetProcessActivation() [8/8]

void G4ProcessTable::SetProcessActivation ( G4ProcessType  processType,
G4ProcessManager processManager,
G4bool  fActive 
)

Definition at line 540 of file G4ProcessTable.cc.

544 {
545 #ifdef G4VERBOSE
546  if (verboseLevel>1){
547  G4cout << " G4ProcessTable::SetProcessActivation:" ;
548  G4cout << " The ProcessType[" << G4int(processType) << "] "<< G4endl;
549  }
550 #endif
551 
552  G4ProcessVector* procList = processManager->GetProcessList();
553  for (G4int idx = 0; idx < procList->length(); idx++) {
554  G4VProcess* process = (*procList)(idx);
555  if ( process->GetProcessType() == processType) {
556  processManager->SetProcessActivation(process, fActive);
557 #ifdef G4VERBOSE
558  if (verboseLevel>1){
559  G4cout << " The Process[" << process->GetProcessName()<< "] "<< G4endl;
560  G4cout << " for " << processManager->GetParticleType()->GetParticleName();
561  G4cout << " Index = " << idx << G4endl;
562  }
563 #endif
564  }
565  }
566 }
G4ProcessVector * GetProcessList() const
int G4int
Definition: G4Types.hh:78
G4VProcess * SetProcessActivation(G4VProcess *aProcess, G4bool fActive)
G4ParticleDefinition * GetParticleType() const
const G4String & GetProcessName() const
Definition: G4VProcess.hh:408
const G4String & GetParticleName() const
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61
G4ProcessType GetProcessType() const
Definition: G4VProcess.hh:414
G4int length() const
Here is the call graph for this function:

◆ SetVerboseLevel()

void G4ProcessTable::SetVerboseLevel ( G4int  value)
Here is the caller graph for this function:

Member Data Documentation

◆ fProcessTable

G4ThreadLocal G4ProcessTable * G4ProcessTable::fProcessTable =0
staticprivate

Definition at line 174 of file G4ProcessTable.hh.

◆ fProcNameVector

G4ProcNameVector* G4ProcessTable::fProcNameVector
private

Definition at line 179 of file G4ProcessTable.hh.

◆ fProcTblMessenger

G4ProcessTableMessenger* G4ProcessTable::fProcTblMessenger
private

Definition at line 175 of file G4ProcessTable.hh.

◆ fProcTblVector

G4ProcTableVector* G4ProcessTable::fProcTblVector
private

Definition at line 178 of file G4ProcessTable.hh.

◆ tmpTblVector

G4ProcTableVector* G4ProcessTable::tmpTblVector
private

Definition at line 182 of file G4ProcessTable.hh.

◆ verboseLevel

G4int G4ProcessTable::verboseLevel
private

Definition at line 186 of file G4ProcessTable.hh.


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