Geant4-11
Public Types | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | Friends
G4ProcessTable Class Reference

#include <G4ProcessTable.hh>

Public Types

using G4ProcNameVector = std::vector< G4String >
 
using G4ProcTableVector = std::vector< G4ProcTblElement * >
 

Public Member Functions

void DeRegisterProcess (G4VProcess *)
 
void DumpInfo (G4VProcess *process, const G4ParticleDefinition *particle=nullptr)
 
G4VProcessFindProcess (const G4String &processName, const G4ParticleDefinition *particle) const
 
G4VProcessFindProcess (const G4String &processName, const G4ProcessManager *processManager) const
 
G4VProcessFindProcess (const G4String &processName, const G4String &particleName) const
 
G4VProcessFindProcess (G4int processSubType, const G4ParticleDefinition *particle) const
 
G4VProcessFindProcess (G4ProcessType processType, const G4ParticleDefinition *particle) const
 
G4ProcessVectorFindProcesses ()
 
G4ProcessVectorFindProcesses (const G4ProcessManager *pManager)
 
G4ProcessVectorFindProcesses (const G4String &processName)
 
G4ProcessVectorFindProcesses (G4ProcessType processType)
 
 G4ProcessTable (const G4ProcessTable &)=delete
 
G4ProcNameVectorGetNameList ()
 
G4ProcTableVectorGetProcTableVector ()
 
G4int GetVerboseLevel () const
 
G4int Insert (G4VProcess *aProcess, G4ProcessManager *aProcMgr)
 
G4int Length () const
 
G4bool operator!= (const G4ProcessTable &right) const =delete
 
G4ProcessTableoperator= (const G4ProcessTable &)=delete
 
G4bool operator== (const G4ProcessTable &right) const =delete
 
void RegisterProcess (G4VProcess *)
 
G4int Remove (G4VProcess *aProcess, G4ProcessManager *aProcMgr)
 
void SetProcessActivation (const G4String &processName, const G4ParticleDefinition *particle, G4bool fActive)
 
void SetProcessActivation (const G4String &processName, const G4String &particleName, G4bool fActive)
 
void SetProcessActivation (const G4String &processName, G4bool fActive)
 
void SetProcessActivation (const G4String &processName, G4ProcessManager *processManager, G4bool fActive)
 
void SetProcessActivation (G4ProcessType processType, const G4ParticleDefinition *particle, G4bool fActive)
 
void SetProcessActivation (G4ProcessType processType, const G4String &particleName, G4bool fActive)
 
void SetProcessActivation (G4ProcessType processType, G4bool fActive)
 
void SetProcessActivation (G4ProcessType processType, G4ProcessManager *processManager, G4bool fActive)
 
void SetVerboseLevel (G4int value)
 
 ~G4ProcessTable ()
 

Static Public Member Functions

static G4ProcessTableGetProcessTable ()
 

Private Member Functions

G4ProcessVectorExtractProcesses (G4ProcTableVector *) const
 
G4ProcTableVectorFind (const G4String &processName)
 
G4ProcTableVectorFind (G4ProcessType processType)
 
 G4ProcessTable ()
 

Private Attributes

std::vector< G4VProcess * > fListProcesses
 
G4ProcNameVectorfProcNameVector = nullptr
 
G4ProcessTableMessengerfProcTblMessenger = nullptr
 
G4ProcTableVectorfProcTblVector = nullptr
 
G4ProcTableVectortmpTblVector = nullptr
 
G4int verboseLevel = 1
 

Static Private Attributes

static G4ThreadLocal G4ProcessTablefProcessTable = nullptr
 

Friends

class G4ThreadLocalSingleton< G4ProcessTable >
 

Detailed Description

Definition at line 48 of file G4ProcessTable.hh.

Member Typedef Documentation

◆ G4ProcNameVector

Definition at line 55 of file G4ProcessTable.hh.

◆ G4ProcTableVector

Definition at line 54 of file G4ProcessTable.hh.

Constructor & Destructor Documentation

◆ ~G4ProcessTable()

G4ProcessTable::~G4ProcessTable ( )

Definition at line 60 of file G4ProcessTable.cc.

61{
62 if ( tmpTblVector != nullptr )
63 {
64 tmpTblVector ->clear();
65 delete tmpTblVector;
66 tmpTblVector = nullptr;
67 }
68
69 if ( fProcTblVector != nullptr )
70 {
71 for (auto elem : *fProcTblVector)
72 {
73 delete elem;
74 }
75 fProcTblVector ->clear();
76 delete fProcTblVector;
77 fProcTblVector = nullptr;
78 }
79
80 // delete all process except transportation
81 for(auto proc : fListProcesses)
82 {
83 if ( proc != nullptr )
84 {
85 G4ProcessType type = proc->GetProcessType();
86 if (type != fTransportation && type != fParallel
87 && type != fParameterisation)
88 {
89 delete proc;
90 }
91 }
92 }
93
94 fListProcesses.clear();
95
96 if ( fProcNameVector != nullptr )
97 {
98 fProcNameVector ->clear();
99 delete fProcNameVector;
100 fProcNameVector = nullptr;
101 }
102 fProcessTable = nullptr;
103 delete fProcTblMessenger;
104}
#define elem(i, j)
G4ProcessType
@ fParameterisation
@ fParallel
@ fTransportation
G4ProcessTableMessenger * fProcTblMessenger
G4ProcTableVector * tmpTblVector
G4ProcTableVector * fProcTblVector
std::vector< G4VProcess * > fListProcesses
G4ProcNameVector * fProcNameVector
static G4ThreadLocal G4ProcessTable * fProcessTable

References elem, fListProcesses, fParallel, fParameterisation, fProcessTable, fProcNameVector, fProcTblMessenger, fProcTblVector, fTransportation, and tmpTblVector.

◆ G4ProcessTable() [1/2]

G4ProcessTable::G4ProcessTable ( const G4ProcessTable )
delete

◆ G4ProcessTable() [2/2]

G4ProcessTable::G4ProcessTable ( )
private

Definition at line 43 of file G4ProcessTable.cc.

44{
45#ifdef G4VERBOSE
46 if (verboseLevel>1)
47 {
48 G4cout << "-- G4ProcessTable constructor --" << G4endl;
49 }
50#endif
55}
#define G4endl
Definition: G4ios.hh:57
G4GLOB_DLL std::ostream G4cout
std::vector< G4ProcTblElement * > G4ProcTableVector
std::vector< G4String > G4ProcNameVector

References fProcNameVector, fProcTblMessenger, fProcTblVector, G4cout, G4endl, tmpTblVector, and verboseLevel.

Member Function Documentation

◆ DeRegisterProcess()

void G4ProcessTable::DeRegisterProcess ( G4VProcess ptr)

Definition at line 270 of file G4ProcessTable.cc.

271{
272 G4int nn = fListProcesses.size();
273 for(G4int i=0; i<nn; ++i)
274 {
275 if(ptr == fListProcesses[i])
276 {
277 fListProcesses[i] = nullptr;
278 return;
279 }
280 }
281}
int G4int
Definition: G4Types.hh:85

References fListProcesses, and G4InuclParticleNames::nn.

Referenced by G4VProcess::~G4VProcess().

◆ DumpInfo()

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

Definition at line 635 of file G4ProcessTable.cc.

637{
638 G4int idxTbl=0;
639 G4ProcTblElement* anElement = nullptr;
640 G4bool isFoundInTbl = false;
641 G4ProcessManager* manager = nullptr;
642 G4int idx;
643 // loop over all elements
644 for (auto itr=fProcTblVector->cbegin();
645 itr!=fProcTblVector->cend(); ++itr, ++idxTbl)
646 {
647 anElement = (*itr);
648 if ( anElement == nullptr ) continue;
649 if (process == anElement->GetProcess() )
650 {
651 if (particle != nullptr)
652 {
653 for (idx=0; idx<anElement->Length(); ++idx)
654 {
655 manager = anElement->GetProcessManager(idx);
656 if (particle == manager->GetParticleType())
657 {
658 isFoundInTbl = true;
659 break;
660 }
661 }
662 }
663 else
664 {
665 isFoundInTbl = true;
666 }
667 break;
668 }
669 }
670 if (!isFoundInTbl ) return;
671
672 G4int tmpVerbose = process->GetVerboseLevel();
674 process->DumpInfo();
675 process->SetVerboseLevel(tmpVerbose);
676 if (particle == nullptr)
677 {
678 for (idx=0; idx<anElement->Length(); ++idx)
679 {
680 manager = anElement->GetProcessManager(idx);
681 G4cout << " for " << manager->GetParticleType()->GetParticleName();
682 G4cout << G4endl;
683#ifdef G4VERBOSE
684 if (verboseLevel >2)
685 {
686 tmpVerbose = manager->GetVerboseLevel();
688 manager->DumpInfo();
689 manager->SetVerboseLevel(tmpVerbose);
690 }
691#endif
692 }
693 }
694 else
695 {
696 G4cout << " for " << manager->GetParticleType()->GetParticleName();
697 G4cout << G4endl;
698#ifdef G4VERBOSE
699 if (verboseLevel >2)
700 {
701 tmpVerbose = manager->GetVerboseLevel();
703 manager->DumpInfo();
704 manager->SetVerboseLevel(tmpVerbose);
705 }
706#endif
707 }
708}
bool G4bool
Definition: G4Types.hh:86
const G4String & GetParticleName() const
G4VProcess * GetProcess() const
G4int Length() const
G4ProcessManager * GetProcessManager(G4int index) const
G4ParticleDefinition * GetParticleType() const
void SetVerboseLevel(G4int value)
G4int GetVerboseLevel() const
void SetVerboseLevel(G4int value)
Definition: G4VProcess.hh:412
G4int GetVerboseLevel() const
Definition: G4VProcess.hh:418
virtual void DumpInfo() const
Definition: G4VProcess.cc:167

References G4ProcessManager::DumpInfo(), G4VProcess::DumpInfo(), fProcTblVector, G4cout, G4endl, G4ParticleDefinition::GetParticleName(), G4ProcessManager::GetParticleType(), G4ProcTblElement::GetProcess(), G4ProcTblElement::GetProcessManager(), G4ProcessManager::GetVerboseLevel(), G4VProcess::GetVerboseLevel(), G4ProcTblElement::Length(), G4ProcessManager::SetVerboseLevel(), G4VProcess::SetVerboseLevel(), and verboseLevel.

Referenced by export_G4ProcessTable(), and G4ProcessTableMessenger::SetNewValue().

◆ ExtractProcesses()

G4ProcessVector * G4ProcessTable::ExtractProcesses ( G4ProcTableVector procTblVector) const
private

Definition at line 442 of file G4ProcessTable.cc.

443{
444 G4ProcessVector* procList = new G4ProcessVector();
445 // loop over all elements
446 for (auto itr=procTblVector->cbegin(); itr!=procTblVector->cend(); ++itr)
447 {
448 G4ProcTblElement* anElement = (*itr);
449 if ( anElement != nullptr) procList->insert( anElement->GetProcess() );
450 }
451 return procList;
452}
G4bool insert(G4VProcess *aProcess)

References G4ProcTblElement::GetProcess(), and G4ProcessVector::insert().

◆ Find() [1/2]

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

Definition at line 379 of file G4ProcessTable.cc.

380{
381 tmpTblVector->clear();
382
383 G4bool isFound = false;
384 G4ProcTblElement* anElement = nullptr;
385 for (auto itr=fProcTblVector->cbegin(); itr!=fProcTblVector->cend(); ++itr)
386 {
387 anElement = (*itr);
388 // check name
389 if ( anElement != nullptr && anElement->GetProcessName() == processName )
390 {
391 isFound = true;
392 tmpTblVector->push_back(anElement);
393 }
394 }
395
396 if (!isFound && verboseLevel>0)
397 {
398#ifdef G4VERBOSE
399 G4cout << " G4ProcessTable::Find() -" ;
400 G4cout << " The Process[" << processName << "] is not found " << G4endl;
401#endif
402 }
403
404 return tmpTblVector;
405}
const G4String & GetProcessName() const

References fProcTblVector, G4cout, G4endl, G4ProcTblElement::GetProcessName(), tmpTblVector, and verboseLevel.

Referenced by SetProcessActivation().

◆ Find() [2/2]

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

Definition at line 410 of file G4ProcessTable.cc.

411{
412 tmpTblVector->clear();
413
414 G4bool isFound = false;
415 G4ProcTblElement* anElement = nullptr;
416 for (auto itr=fProcTblVector->cbegin(); itr!=fProcTblVector->cend(); ++itr)
417 {
418 anElement = (*itr);
419 // check name
420 if ( anElement != nullptr && anElement->GetProcess()->GetProcessType() == processType )
421 {
422 isFound = true;
423 tmpTblVector->push_back(anElement);
424 }
425 }
426
427 if (!isFound && verboseLevel>0)
428 {
429#ifdef G4VERBOSE
430 G4cout << " G4ProcessTable::Find() -" ;
431 G4cout << " The ProcessType[" << processType << "] is not found "
432 << G4endl;
433#endif
434 }
435
436 return tmpTblVector;
437}
G4ProcessType GetProcessType() const
Definition: G4VProcess.hh:388

References fProcTblVector, G4cout, G4endl, G4ProcTblElement::GetProcess(), G4VProcess::GetProcessType(), tmpTblVector, and verboseLevel.

◆ FindProcess() [1/5]

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

◆ FindProcess() [2/5]

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

Definition at line 294 of file G4ProcessTable.cc.

297{
298 for (auto anElement : *fProcTblVector)
299 {
300 // check name and if the processManage is included
301 if (anElement && anElement->GetProcessName() == processName
302 && anElement->Contains(processManager))
303 {
304 return anElement->GetProcess();
305 }
306 }
307#ifdef G4VERBOSE
308 if (verboseLevel > 1)
309 {
310 G4cout << " G4ProcessTable::FindProcess() -" ;
311 G4cout << " The Process[" << processName << "] is not found ";
312 G4cout << " for [" << processManager->GetParticleType()->GetParticleName()
313 << "]" << G4endl;
314 }
315#endif
316 return nullptr;
317}

References fProcTblVector, G4cout, G4endl, G4ParticleDefinition::GetParticleName(), G4ProcessManager::GetParticleType(), and verboseLevel.

◆ FindProcess() [3/5]

G4VProcess * G4ProcessTable::FindProcess ( const G4String processName,
const G4String particleName 
) const

Definition at line 285 of file G4ProcessTable.cc.

287{
288 return FindProcess(processName,
289 G4ParticleTable::GetParticleTable()->FindParticle(particleName));
290}
static G4ParticleTable * GetParticleTable()
G4VProcess * FindProcess(const G4String &processName, const G4String &particleName) const

References FindProcess(), and G4ParticleTable::GetParticleTable().

Referenced by G4EmDNAChemistry::ConstructProcess(), G4SpinDecayPhysics::ConstructProcess(), FindProcess(), and SetProcessActivation().

◆ FindProcess() [4/5]

G4VProcess * G4ProcessTable::FindProcess ( G4int  processSubType,
const G4ParticleDefinition particle 
) const

Definition at line 350 of file G4ProcessTable.cc.

352{
353 // find the first process of given type for this particle
354
355 const G4ProcessManager* processManager = particle->GetProcessManager();
356 for (auto anElement : *fProcTblVector)
357 {
358 if ( anElement != nullptr
359 && anElement->GetProcess()->GetProcessSubType() == procSubType
360 && anElement->Contains(processManager) )
361 {
362 return anElement->GetProcess();
363 }
364 }
365#ifdef G4VERBOSE
366 if (verboseLevel > 1)
367 {
368 G4cout << " G4ProcessTable::FindProcess() -";
369 G4cout << " The Process SubType " << procSubType << " is not found ";
370 G4cout << " for [" << particle->GetParticleName() << "]" << G4endl;
371 }
372#endif
373 return nullptr;
374}
G4ProcessManager * GetProcessManager() const
G4VProcess * GetProcess(const G4String &) const

References fProcTblVector, G4cout, G4endl, G4ParticleDefinition::GetParticleName(), G4ProcessManager::GetProcess(), G4ParticleDefinition::GetProcessManager(), and verboseLevel.

◆ FindProcess() [5/5]

G4VProcess * G4ProcessTable::FindProcess ( G4ProcessType  processType,
const G4ParticleDefinition particle 
) const

Definition at line 322 of file G4ProcessTable.cc.

324{
325 // find the first process of given type for this particle
326
327 const G4ProcessManager* processManager = particle->GetProcessManager();
328 for (auto anElement : *fProcTblVector)
329 {
330 if (anElement && anElement->GetProcess()->GetProcessType() == processType
331 && anElement->Contains(processManager))
332 {
333 return anElement->GetProcess();
334 }
335 }
336#ifdef G4VERBOSE
337 if (verboseLevel > 1)
338 {
339 G4cout << " G4ProcessTable::FindProcess() -";
340 G4cout << " The Process Type " << processType << " is not found ";
341 G4cout << " for [" << particle->GetParticleName() << "]" << G4endl;
342 }
343#endif
344 return nullptr;
345}

References fProcTblVector, G4cout, G4endl, G4ParticleDefinition::GetParticleName(), G4ProcessManager::GetProcess(), G4ParticleDefinition::GetProcessManager(), and verboseLevel.

◆ FindProcesses() [1/4]

G4ProcessVector * G4ProcessTable::FindProcesses ( )
inline

◆ FindProcesses() [2/4]

G4ProcessVector * G4ProcessTable::FindProcesses ( const G4ProcessManager pManager)
inline

◆ FindProcesses() [3/4]

G4ProcessVector * G4ProcessTable::FindProcesses ( const G4String processName)
inline

◆ FindProcesses() [4/4]

G4ProcessVector * G4ProcessTable::FindProcesses ( G4ProcessType  processType)
inline

◆ GetNameList()

G4ProcNameVector * G4ProcessTable::GetNameList ( )
inline

◆ GetProcessTable()

G4ProcessTable * G4ProcessTable::GetProcessTable ( )
static

◆ GetProcTableVector()

G4ProcTableVector * G4ProcessTable::GetProcTableVector ( )
inline

◆ GetVerboseLevel()

G4int G4ProcessTable::GetVerboseLevel ( ) const
inline

◆ Insert()

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

Definition at line 120 of file G4ProcessTable.cc.

122{
123 if ( (aProcess == nullptr) || ( aProcMgr == nullptr ) || !fProcTblVector )
124 {
125#ifdef G4VERBOSE
126 if (verboseLevel>0)
127 {
128 G4cout << "G4ProcessTable::Insert() - arguments are null pointer "
129 << aProcess << "," << aProcMgr << G4endl;
130 }
131#endif
132 return -1;
133 }
134
135#ifdef G4VERBOSE
136 if (verboseLevel>1)
137 {
138 G4cout << "G4ProcessTable::Insert() -";
139 G4cout << " Process[" << aProcess->GetProcessName() << "]";
140 G4cout << " Particle[" << aProcMgr->GetParticleType()->GetParticleName()
141 << "]" << G4endl;
142 }
143#endif
144
145 G4int idxTbl = 0;
146 G4int nidx = fProcTblVector->size();
147 G4ProcTblElement* anElement = nullptr;
148 // loop over all elements
149 for (; idxTbl < nidx; ++idxTbl)
150 {
151 anElement = (*fProcTblVector)[idxTbl];
152 if(!anElement) { continue; }
153 // check if this process is included
154 if (aProcess == anElement->GetProcess())
155 {
156 // add the process manager into the element
157 // unless this process manager is included
158 if (!anElement->Contains(aProcMgr))
159 {
160 anElement->Insert(aProcMgr);
161#ifdef G4VERBOSE
162 if (verboseLevel>2)
163 {
164 G4cout << " This Process Manager is registered !! " << G4endl;
165 }
166#endif
167 }
168 return idxTbl;
169 }
170 }
171 // add this process into the table by creating a new element
172 if (verboseLevel>2)
173 {
174 G4cout << " New element is created !! " << G4endl;
175 }
176 anElement = new G4ProcTblElement(aProcess);
177 anElement->Insert(aProcMgr);
178 fProcTblVector->push_back(anElement);
179 fProcNameVector->push_back(aProcess->GetProcessName() );
180 return nidx;
181}
G4bool Contains(const G4ProcessManager *pManager) const
void Insert(G4ProcessManager *aProcMgr)
const G4String & GetProcessName() const
Definition: G4VProcess.hh:382

References G4ProcTblElement::Contains(), fProcNameVector, fProcTblVector, G4cout, G4endl, G4ParticleDefinition::GetParticleName(), G4ProcessManager::GetParticleType(), G4ProcTblElement::GetProcess(), G4VProcess::GetProcessName(), G4ProcTblElement::Insert(), and verboseLevel.

Referenced by G4ProcessManager::AddProcess(), and G4ProcessManager::G4ProcessManager().

◆ Length()

G4int G4ProcessTable::Length ( ) const
inline

Referenced by export_G4ProcessTable().

◆ operator!=()

G4bool G4ProcessTable::operator!= ( const G4ProcessTable right) const
delete

◆ operator=()

G4ProcessTable & G4ProcessTable::operator= ( const G4ProcessTable )
delete

◆ operator==()

G4bool G4ProcessTable::operator== ( const G4ProcessTable right) const
delete

◆ RegisterProcess()

void G4ProcessTable::RegisterProcess ( G4VProcess ptr)

Definition at line 259 of file G4ProcessTable.cc.

260{
261 for(auto proc : fListProcesses)
262 {
263 if(ptr == proc) { return; }
264 }
265 fListProcesses.push_back(ptr);
266}

References fListProcesses.

Referenced by G4VProcess::G4VProcess().

◆ Remove()

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

Definition at line 185 of file G4ProcessTable.cc.

187{
188 if ( (aProcess == nullptr) || ( aProcMgr == nullptr ) || !fProcTblVector )
189 {
190#ifdef G4VERBOSE
191 if (verboseLevel>0)
192 {
193 G4cout << "G4ProcessTable::Remove() - arguments are null pointer "
194 << G4endl;
195 }
196#endif
197 return -1;
198 }
199
200#ifdef G4VERBOSE
201 if (verboseLevel>1)
202 {
203 G4cout << "G4ProcessTable::Remove() -";
204 G4cout << " Process[" << aProcess->GetProcessName() << "]";
205 G4cout << " Particle[" << aProcMgr->GetParticleType()->GetParticleName()
206 << "]" << G4endl;
207 }
208#endif
209
210 G4int idxTbl = 0;
211 G4int nidx = fProcTblVector->size();
212 G4ProcTblElement* anElement =nullptr;
213 // loop over all elements
214 for (; idxTbl < nidx; ++idxTbl)
215 {
216 anElement = (*fProcTblVector)[idxTbl];
217 if(!anElement) { continue; }
218
219 // check if this process is included
220 if (aProcess == anElement->GetProcess())
221 {
222 if(anElement->Contains(aProcMgr))
223 {
224 // remove the process manager from the element
225 anElement->Remove(aProcMgr);
226#ifdef G4VERBOSE
227 if (verboseLevel>2)
228 {
229 G4cout << " This Process Manager is removed !! " << G4endl;
230 }
231#endif
232 if(anElement->Length() == 0)
233 {
234 delete anElement;
235 (*fProcTblVector)[idxTbl] = nullptr;
236#ifdef G4VERBOSE
237 if (verboseLevel>1)
238 {
239 G4cout << " This Process is removed !! " << G4endl;
240 }
241#endif
242 }
243 return idxTbl;
244 }
245 }
246 }
247#ifdef G4VERBOSE
248 if (verboseLevel>1)
249 {
250 G4cout << " This Process Manager is not registered to the process!! "
251 << G4endl;
252 }
253#endif
254 return -1;
255}
void Remove(G4ProcessManager *aProcMgr)

References G4ProcTblElement::Contains(), fProcTblVector, G4cout, G4endl, G4ParticleDefinition::GetParticleName(), G4ProcessManager::GetParticleType(), G4ProcTblElement::GetProcess(), G4VProcess::GetProcessName(), G4ProcTblElement::Length(), G4ProcTblElement::Remove(), and verboseLevel.

Referenced by G4ProcessManager::RemoveProcess().

◆ SetProcessActivation() [1/8]

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

◆ SetProcessActivation() [2/8]

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

Definition at line 456 of file G4ProcessTable.cc.

459{
460 if (particleName == "ALL" )
461 {
462 SetProcessActivation( processName, fActive);
463 }
464 else
465 {
466 SetProcessActivation(processName,
467 G4ParticleTable::GetParticleTable()->FindParticle(particleName),
468 fActive );
469 }
470}
void SetProcessActivation(const G4String &processName, G4bool fActive)

References G4ParticleTable::GetParticleTable(), and SetProcessActivation().

◆ SetProcessActivation() [3/8]

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

Definition at line 492 of file G4ProcessTable.cc.

494{
495#ifdef G4VERBOSE
496 if (verboseLevel>1)
497 {
498 G4cout << " G4ProcessTable::SetProcessActivation() -" ;
499 G4cout << " The Process[" << processName << "] "<< G4endl;
500 }
501#endif
502
503 G4ProcTableVector* pTblVector = Find(processName);
504 G4ProcTblElement* anElement;
505 // loop over all elements
506 for (auto itr=pTblVector->cbegin(); itr!=pTblVector->cend(); ++itr)
507 {
508 anElement = (*itr);
509 if ( anElement == nullptr ) continue;
510 G4VProcess* process = anElement->GetProcess();
511 for (G4int idx = 0 ; idx < anElement->Length(); ++idx)
512 {
513 G4ProcessManager* manager = anElement->GetProcessManager(idx);
514 manager->SetProcessActivation(process, fActive);
515#ifdef G4VERBOSE
516 if (verboseLevel>1)
517 {
518 G4cout << " for " << manager->GetParticleType()->GetParticleName();
519 G4cout << " Index = " << manager->GetProcessIndex(process);
520 G4cout << G4endl;
521 }
522#endif
523 }
524 }
525}
G4VProcess * SetProcessActivation(G4VProcess *aProcess, G4bool fActive)
G4int GetProcessIndex(G4VProcess *) const
G4ProcTableVector * Find(const G4String &processName)

References Find(), G4cout, G4endl, G4ParticleDefinition::GetParticleName(), G4ProcessManager::GetParticleType(), G4ProcTblElement::GetProcess(), G4ProcessManager::GetProcessIndex(), G4ProcTblElement::GetProcessManager(), G4ProcTblElement::Length(), G4ProcessManager::SetProcessActivation(), and verboseLevel.

Referenced by G4ProcessTableMessenger::SetNewValue(), and SetProcessActivation().

◆ SetProcessActivation() [4/8]

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

Definition at line 529 of file G4ProcessTable.cc.

532{
533#ifdef G4VERBOSE
534 if (verboseLevel>1)
535 {
536 G4cout << " G4ProcessTable::SetProcessActivation() -" ;
537 G4cout << " The Process[" << processName << "] "<< G4endl;
538 }
539#endif
540
541 G4VProcess* process = FindProcess( processName, processManager);
542 if ( process != nullptr)
543 {
544 processManager->SetProcessActivation(process, fActive);
545#ifdef G4VERBOSE
546 if (verboseLevel>1)
547 {
548 G4cout << " for "
549 << processManager->GetParticleType()->GetParticleName();
550 G4cout << " Index = "
551 << processManager->GetProcessIndex(process) << G4endl;
552 }
553#endif
554 }
555}

References FindProcess(), G4cout, G4endl, G4ParticleDefinition::GetParticleName(), G4ProcessManager::GetParticleType(), G4ProcessManager::GetProcessIndex(), G4ProcessManager::SetProcessActivation(), and verboseLevel.

◆ SetProcessActivation() [5/8]

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

◆ SetProcessActivation() [6/8]

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

Definition at line 474 of file G4ProcessTable.cc.

477{
478 if ((particleName == "ALL" ) || (particleName == "all" ))
479 {
480 SetProcessActivation( processType, fActive );
481 }
482 else
483 {
484 SetProcessActivation(processType,
485 G4ParticleTable::GetParticleTable()->FindParticle(particleName),
486 fActive );
487 }
488}

References G4ParticleTable::GetParticleTable(), and SetProcessActivation().

◆ SetProcessActivation() [7/8]

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

Definition at line 559 of file G4ProcessTable.cc.

561{
562#ifdef G4VERBOSE
563 if (verboseLevel>1)
564 {
565 G4cout << " G4ProcessTable::SetProcessActivation() -" ;
566 G4cout << " The ProcessType[" << G4int(processType) << "] "<< G4endl;
567 }
568#endif
569
570 G4ProcTableVector* pTblVector = Find(processType);
571 G4ProcTblElement* anElement;
572 // loop over all elements
573 for (auto itr=pTblVector->cbegin(); itr!=pTblVector->cend(); ++itr)
574 {
575 anElement = (*itr);
576 if ( anElement == nullptr ) continue;
577 G4VProcess* process = anElement->GetProcess();
578#ifdef G4VERBOSE
579 if (verboseLevel>1)
580 {
581 G4cout << " The Process[" << process->GetProcessName()<< "] "<< G4endl;
582 }
583#endif
584 for (G4int idx = 0 ; idx < anElement->Length(); ++idx)
585 {
586 G4ProcessManager* manager = anElement->GetProcessManager(idx);
587 manager->SetProcessActivation(process, fActive);
588#ifdef G4VERBOSE
589 if (verboseLevel>1)
590 {
591 G4cout << " for " << manager->GetParticleType()->GetParticleName();
592 G4cout << " Index = " << manager->GetProcessIndex(process) << G4endl;
593 }
594#endif
595 }
596 }
597}

References Find(), G4cout, G4endl, G4ParticleDefinition::GetParticleName(), G4ProcessManager::GetParticleType(), G4ProcTblElement::GetProcess(), G4ProcessManager::GetProcessIndex(), G4ProcTblElement::GetProcessManager(), G4VProcess::GetProcessName(), G4ProcTblElement::Length(), G4ProcessManager::SetProcessActivation(), and verboseLevel.

◆ SetProcessActivation() [8/8]

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

Definition at line 601 of file G4ProcessTable.cc.

604{
605#ifdef G4VERBOSE
606 if (verboseLevel>1)
607 {
608 G4cout << " G4ProcessTable::SetProcessActivation() -" ;
609 G4cout << " The ProcessType[" << G4int(processType) << "] "<< G4endl;
610 }
611#endif
612
613 G4ProcessVector* procList = processManager->GetProcessList();
614 for (std::size_t idx = 0; idx < procList->length(); ++idx)
615 {
616 G4VProcess* process = (*procList)(idx);
617 if ( process->GetProcessType() == processType)
618 {
619 processManager->SetProcessActivation(process, fActive);
620#ifdef G4VERBOSE
621 if (verboseLevel>1)
622 {
623 G4cout << " The Process[" << process->GetProcessName()<< "] "<< G4endl;
624 G4cout << " for "
625 << processManager->GetParticleType()->GetParticleName();
626 G4cout << " Index = " << idx << G4endl;
627 }
628#endif
629 }
630 }
631}
G4ProcessVector * GetProcessList() const
std::size_t length() const

References G4cout, G4endl, G4ParticleDefinition::GetParticleName(), G4ProcessManager::GetParticleType(), G4ProcessManager::GetProcessList(), G4VProcess::GetProcessName(), G4VProcess::GetProcessType(), G4ProcessVector::length(), G4ProcessManager::SetProcessActivation(), and verboseLevel.

◆ SetVerboseLevel()

void G4ProcessTable::SetVerboseLevel ( G4int  value)
inline

Friends And Related Function Documentation

◆ G4ThreadLocalSingleton< G4ProcessTable >

friend class G4ThreadLocalSingleton< G4ProcessTable >
friend

Definition at line 1 of file G4ProcessTable.hh.

Field Documentation

◆ fListProcesses

std::vector<G4VProcess*> G4ProcessTable::fListProcesses
private

Definition at line 167 of file G4ProcessTable.hh.

Referenced by DeRegisterProcess(), RegisterProcess(), and ~G4ProcessTable().

◆ fProcessTable

G4ThreadLocal G4ProcessTable * G4ProcessTable::fProcessTable = nullptr
staticprivate

Definition at line 158 of file G4ProcessTable.hh.

Referenced by GetProcessTable(), and ~G4ProcessTable().

◆ fProcNameVector

G4ProcNameVector* G4ProcessTable::fProcNameVector = nullptr
private

Definition at line 162 of file G4ProcessTable.hh.

Referenced by G4ProcessTable(), Insert(), and ~G4ProcessTable().

◆ fProcTblMessenger

G4ProcessTableMessenger* G4ProcessTable::fProcTblMessenger = nullptr
private

Definition at line 159 of file G4ProcessTable.hh.

Referenced by G4ProcessTable(), and ~G4ProcessTable().

◆ fProcTblVector

G4ProcTableVector* G4ProcessTable::fProcTblVector = nullptr
private

◆ tmpTblVector

G4ProcTableVector* G4ProcessTable::tmpTblVector = nullptr
private

Definition at line 164 of file G4ProcessTable.hh.

Referenced by Find(), G4ProcessTable(), and ~G4ProcessTable().

◆ verboseLevel

G4int G4ProcessTable::verboseLevel = 1
private

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