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

Method AddProcess

source/processes/management/src/G4ProcessManager.cc:405–515  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

403
404// --------------------------------------------------------------------
405G4int G4ProcessManager::AddProcess(
406 G4VProcess* aProcess,
407 G4int ordAtRestDoIt,
408 G4int ordAlongStepDoIt,
409 G4int ordPostStepDoIt
410 )
411{
412 // check the process is applicable to this particle type
413 if ( !aProcess->IsApplicable(*theParticleType) )
414 {
415#ifdef G4VERBOSE
416 if (GetVerboseLevel()>1)
417 {
418 G4cout << "G4ProcessManager::AddProcess()" << G4endl;
419 G4cout << "This process is not applicable to this particle" << G4endl;
420 }
421#endif
422 return -1;
423 }
424
425#ifdef G4VERBOSE
426 if (GetVerboseLevel()>2)
427 {
428 G4cout << "G4ProcessManager::AddProcess()" << G4endl;
429 }
430#endif
431
432 // add aProcess and this ProcessManager into ProcesssTable
433 G4ProcessTable* theProcessTable = G4ProcessTable::GetProcessTable();
434 theProcessTable->Insert(aProcess, this);
435
436 // add aProcess to process List
437 theProcessList->insert(aProcess);
438 G4int idx = G4int(theProcessList->entries() - 1);
439
440 // check size of the ProcessVector[0]
441 if (numberOfProcesses != idx)
442 {
443 theProcessList->removeLast();
444 G4String anErrorMessage("Inconsistent process List size for ");
445 anErrorMessage += "process[" + aProcess->GetProcessName() + "]";
446 anErrorMessage += " particle[" + theParticleType->GetParticleName() + "]";
447 G4Exception("G4ProcessManager::AddProcess()", "ProcMan012",
448 FatalException, anErrorMessage);
449 return -1;
450 }
451
452 // create ProcessAttribute
453 G4ProcessAttribute* pAttr = new G4ProcessAttribute(aProcess);
454 pAttr->idxProcessList = idx;
455
456 // check if ordering parameter is non-zero
457 if (ordAtRestDoIt==0) ordAtRestDoIt = 1;
458 if (ordAlongStepDoIt==0) ordAlongStepDoIt = 1;
459 if (ordPostStepDoIt==0) ordPostStepDoIt = 1;
460
461 // ordering parameter
462 pAttr->ordProcVector[0] = ordAtRestDoIt;

Callers 6

ConstructProcessMethod · 0.45
AddTransportationMethod · 0.45
RegisterProcessMethod · 0.45

Calls 8

G4ExceptionFunction · 0.85
IsApplicableMethod · 0.45
InsertMethod · 0.45
insertMethod · 0.45
entriesMethod · 0.45
GetParticleNameMethod · 0.45
push_backMethod · 0.45
SetProcessManagerMethod · 0.45

Tested by

no test coverage detected