MCPcopy Create free account
hub / github.com/Geant4/geant4 / Remove

Method Remove

source/processes/management/src/G4ProcessTable.cc:185–255  ·  view source on GitHub ↗

--------------------------------------------------------------------

Source from the content-addressed store, hash-verified

183// --------------------------------------------------------------------
184//
185G4int G4ProcessTable::Remove( G4VProcess* aProcess,
186 G4ProcessManager* aProcMgr )
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 = (G4int)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 }

Callers 4

DefinitionMethod · 0.45
DefinitionMethod · 0.45
DefinitionMethod · 0.45
RemoveProcessMethod · 0.45

Calls 6

GetParticleNameMethod · 0.45
GetParticleTypeMethod · 0.45
sizeMethod · 0.45
GetProcessMethod · 0.45
ContainsMethod · 0.45
LengthMethod · 0.45

Tested by

no test coverage detected