62 if ( tmpTblVector !=
nullptr )
64 tmpTblVector ->clear();
66 tmpTblVector =
nullptr;
69 if ( fProcTblVector !=
nullptr )
71 for (
auto elem : *fProcTblVector)
75 fProcTblVector ->clear();
76 delete fProcTblVector;
77 fProcTblVector =
nullptr;
81 for(
auto proc : fListProcesses)
83 if ( proc !=
nullptr )
94 fListProcesses.clear();
96 if ( fProcNameVector !=
nullptr )
98 fProcNameVector ->clear();
99 delete fProcNameVector;
100 fProcNameVector =
nullptr;
102 fProcessTable =
nullptr;
103 delete fProcTblMessenger;
110 if(fProcessTable ==
nullptr)
115 return fProcessTable;
123 if ( (aProcess ==
nullptr) || ( aProcMgr ==
nullptr ) || !fProcTblVector )
128 G4cout <<
"G4ProcessTable::Insert() - arguments are null pointer "
129 << aProcess <<
"," << aProcMgr <<
G4endl;
138 G4cout <<
"G4ProcessTable::Insert() -";
146 G4int nidx = fProcTblVector->size();
149 for (; idxTbl < nidx; ++idxTbl)
151 anElement = (*fProcTblVector)[idxTbl];
152 if(!anElement) {
continue; }
160 anElement->
Insert(aProcMgr);
164 G4cout <<
" This Process Manager is registered !! " <<
G4endl;
177 anElement->
Insert(aProcMgr);
178 fProcTblVector->push_back(anElement);
188 if ( (aProcess ==
nullptr) || ( aProcMgr ==
nullptr ) || !fProcTblVector )
193 G4cout <<
"G4ProcessTable::Remove() - arguments are null pointer "
203 G4cout <<
"G4ProcessTable::Remove() -";
211 G4int nidx = fProcTblVector->size();
214 for (; idxTbl < nidx; ++idxTbl)
216 anElement = (*fProcTblVector)[idxTbl];
217 if(!anElement) {
continue; }
225 anElement->
Remove(aProcMgr);
229 G4cout <<
" This Process Manager is removed !! " <<
G4endl;
232 if(anElement->
Length() == 0)
235 (*fProcTblVector)[idxTbl] =
nullptr;
250 G4cout <<
" This Process Manager is not registered to the process!! "
261 for(
auto proc : fListProcesses)
263 if(ptr == proc) {
return; }
265 fListProcesses.push_back(ptr);
272 G4int nn = fListProcesses.size();
273 for(
G4int i=0; i<nn; ++i)
275 if(ptr == fListProcesses[i])
277 fListProcesses[i] =
nullptr;
298 for (
auto anElement : *fProcTblVector)
301 if (anElement && anElement->GetProcessName() == processName
302 && anElement->Contains(processManager))
304 return anElement->GetProcess();
308 if (verboseLevel > 1)
310 G4cout <<
" G4ProcessTable::FindProcess() -" ;
311 G4cout <<
" The Process[" << processName <<
"] is not found ";
328 for (
auto anElement : *fProcTblVector)
330 if (anElement && anElement->GetProcess()->GetProcessType() == processType
331 && anElement->Contains(processManager))
337 if (verboseLevel > 1)
339 G4cout <<
" G4ProcessTable::FindProcess() -";
340 G4cout <<
" The Process Type " << processType <<
" is not found ";
356 for (
auto anElement : *fProcTblVector)
358 if ( anElement !=
nullptr
359 && anElement->GetProcess()->GetProcessSubType() == procSubType
360 && anElement->Contains(processManager) )
366 if (verboseLevel > 1)
368 G4cout <<
" G4ProcessTable::FindProcess() -";
369 G4cout <<
" The Process SubType " << procSubType <<
" is not found ";
379G4ProcessTable::Find(
const G4String& processName)
381 tmpTblVector->clear();
385 for (
auto itr=fProcTblVector->cbegin(); itr!=fProcTblVector->cend(); ++itr)
392 tmpTblVector->push_back(anElement);
396 if (!isFound && verboseLevel>0)
399 G4cout <<
" G4ProcessTable::Find() -" ;
400 G4cout <<
" The Process[" << processName <<
"] is not found " <<
G4endl;
412 tmpTblVector->clear();
416 for (
auto itr=fProcTblVector->cbegin(); itr!=fProcTblVector->cend(); ++itr)
423 tmpTblVector->push_back(anElement);
427 if (!isFound && verboseLevel>0)
430 G4cout <<
" G4ProcessTable::Find() -" ;
431 G4cout <<
" The ProcessType[" << processType <<
"] is not found "
442G4ProcessTable::ExtractProcesses(G4ProcTableVector* procTblVector)
const
446 for (
auto itr=procTblVector->cbegin(); itr!=procTblVector->cend(); ++itr)
460 if (particleName ==
"ALL" )
478 if ((particleName ==
"ALL" ) || (particleName ==
"all" ))
498 G4cout <<
" G4ProcessTable::SetProcessActivation() -" ;
499 G4cout <<
" The Process[" << processName <<
"] "<<
G4endl;
506 for (
auto itr=pTblVector->cbegin(); itr!=pTblVector->cend(); ++itr)
510 for (
G4int idx = 0 ; idx < anElement->
Length(); ++idx)
535 G4cout <<
" G4ProcessTable::SetProcessActivation() -" ;
536 G4cout <<
" The Process[" << processName <<
"] "<<
G4endl;
541 if ( process !=
nullptr)
564 G4cout <<
" G4ProcessTable::SetProcessActivation() -" ;
572 for (
auto itr=pTblVector->cbegin(); itr!=pTblVector->cend(); ++itr)
582 for (
G4int idx = 0 ; idx < anElement->
Length(); ++idx)
606 G4cout <<
" G4ProcessTable::SetProcessActivation() -" ;
612 for (std::size_t idx = 0; idx < procList->
length(); ++idx)
638 G4bool isFoundInTbl =
false;
642 for (
auto itr=fProcTblVector->cbegin();
643 itr!=fProcTblVector->cend(); ++itr, ++idxTbl)
648 if (particle !=
nullptr)
650 for (idx=0; idx<anElement->
Length(); ++idx)
667 if (!isFoundInTbl )
return;
673 if (particle ==
nullptr)
675 for (idx=0; idx<anElement->
Length(); ++idx)
G4GLOB_DLL std::ostream G4cout
G4ProcessManager * GetProcessManager() const
const G4String & GetParticleName() const
static G4ParticleTable * GetParticleTable()
const G4String & GetProcessName() const
G4VProcess * GetProcess() const
G4bool Contains(const G4ProcessManager *pManager) const
void Remove(G4ProcessManager *aProcMgr)
G4ProcessManager * GetProcessManager(G4int index) const
void Insert(G4ProcessManager *aProcMgr)
G4VProcess * GetProcess(const G4String &) const
G4VProcess * SetProcessActivation(G4VProcess *aProcess, G4bool fActive)
G4ParticleDefinition * GetParticleType() const
void SetVerboseLevel(G4int value)
G4ProcessVector * GetProcessList() const
G4int GetProcessIndex(G4VProcess *) const
G4int GetVerboseLevel() const
G4ProcessTable(const G4ProcessTable &)=delete
void DumpInfo(G4VProcess *process, const G4ParticleDefinition *particle=nullptr)
static G4ProcessTable * GetProcessTable()
G4VProcess * FindProcess(const G4String &processName, const G4String &particleName) const
G4int Insert(G4VProcess *aProcess, G4ProcessManager *aProcMgr)
void RegisterProcess(G4VProcess *)
void DeRegisterProcess(G4VProcess *)
G4int Remove(G4VProcess *aProcess, G4ProcessManager *aProcMgr)
void SetProcessActivation(const G4String &processName, G4bool fActive)
std::vector< G4ProcTblElement * > G4ProcTableVector
std::vector< G4String > G4ProcNameVector
G4bool insert(G4VProcess *aProcess)
std::size_t length() const
void SetVerboseLevel(G4int value)
G4int GetVerboseLevel() const
G4ProcessType GetProcessType() const
virtual void DumpInfo() const
const G4String & GetProcessName() const