61 theParticleType(aParticleType),
63 duringTracking(false),
69 G4Exception(
"G4ProcessManager::G4ProcessManager()",
"ProcMan012",
77 G4Exception(
"G4ProcessManager::G4ProcessManager()",
"ProcMan012",
101 : theParticleType(right.theParticleType),
102 numberOfProcesses(0),
103 duringTracking(false),
104 verboseLevel(right.verboseLevel)
108 G4cout <<
"G4ProcessManageer:: copy constructor " <<
G4endl;
116 G4Exception(
"G4ProcessManager::G4ProcessManager() [coopy constructor]",
137 G4Exception(
"G4ProcessManager::G4ProcessManager() [coopy constructor]",
147 if ( (*src)[j] !=0 ) {
148 theProcessTable->
Insert((*src)[j],
this);
165 numberOfProcesses(0),
166 duringTracking(false),
173 G4Exception(
"G4ProcessManager::G4ProcessManager()",
"ProcMan111",
194 G4Exception(
"G4ProcessManager::operator=",
"ProcMan112",
212 G4ProcessAttrVector::iterator itr;
228 G4cout <<
"G4ProcessManagerMessenger is deleted" <<
G4endl;
246 if ( ( idxProc >=0) && (ivec >=0) ){
251 G4cout <<
" G4ProcessManager::GetProcessVectorIndex:";
256 G4cout <<
" is not registered yet ";
259 G4cout <<
" illegal DoIt Index [= " <<
G4int(idx) <<
","
260 <<
G4int(typ) <<
"]";
276 G4cout <<
"G4ProcessManager::GetAttribute():";
288 G4VProcess* aProcess = (*theProcessList)[index];
290 G4String aErrorMessage(
"Bad ProcessList: Null Pointer for");
292 G4Exception(
"G4ProcessManager::GetAttribute()",
"ProcMan012",
305 G4cout <<
"G4ProcessManager::GetAttribute():";
308 G4cout <<
"Warning:: attribute vector index is inconsistent with process List index"
314 G4ProcessAttrVector::iterator itr;
316 if ( (*itr)->idxProcessList == index) {
336 if ( (ip<0) || (ip > pVector->
entries()) )
return -1;
351 G4cout <<
" G4ProcessManager::InsertAt : No Process Attribute " <<
G4endl;
364 if ( (ip<0) || (ip >= pVector->
entries()) )
return -1;
373 if (ip < aAttr->idxProcVector[ivec]) {
382 G4cout <<
" G4ProcessManager::RemoveAt : No Process Attribute " <<
G4endl;
413 G4int ordAlongStepDoIt,
414 G4int ordPostStepDoIt
423 G4cout <<
"This process is not applicable to this particle" <<
G4endl;
437 theProcessTable->
Insert(aProcess,
this);
446 G4String anErrorMessage(
"Bad ProcessList: Inconsistent process List size for ");
449 G4Exception(
"G4ProcessManager::AddProcess()",
"ProcMan012",
459 if (ordAtRestDoIt==0) ordAtRestDoIt = 1;
460 if (ordAlongStepDoIt==0) ordAlongStepDoIt = 1;
461 if (ordPostStepDoIt==0) ordPostStepDoIt = 1;
491 G4cout <<
" in ProcessVetor[" << ivec<<
"]";
492 G4cout <<
" with Ordering parameter = " ;
521 if (pAttr == 0)
return 0;
524 G4VProcess* removedProcess = (*theProcessList)[index];
531 if ((idx >= 0) && (idx < pVector->entries())) {
533 if (
RemoveAt(idx, removedProcess, ivec) <0) {
534 G4String anErrorMessage(
"Bad index in attribute");
536 anErrorMessage +=
"process[" + removedProcess->
GetProcessName() +
"] " ;
537 G4Exception(
"G4ProcessManager::RemoveProcess()",
"Fatal Error",
545 G4String anErrorMessage(
"Bad ProcessList : Index is out of range ");
547 anErrorMessage +=
"process[" + removedProcess->
GetProcessName() +
"] " ;
548 G4Exception(
"G4ProcessManager::RemoveProcess()",
"ProcMan012",
556 G4ProcessAttrVector::iterator itr;
558 if ( (*itr) == pAttr) {
576 theProcessTable->
Remove(removedProcess,
this);
578 return removedProcess;
613 const G4String aErrorMessage(
" G4ProcessManager::SetProcessOrdering");
631 G4cout <<
" illegal DoIt Index [= " <<
G4int(idDoIt) <<
"]";
653 if (ordDoIt == 0) ordDoIt = 1;
671 G4cout <<
" in ProcessVetor[" << ivec<<
"]";
672 G4cout <<
" with Ordering parameter = " << ordDoIt ;
698 G4cout <<
"G4ProcessManager::SetProcessOrdering: ";
699 G4cout <<
" illegal DoIt Index [= " <<
G4int(idDoIt) <<
"]";
730 G4cout <<
"G4ProcessManager::SetProcessOrderingToFirst: ";
732 G4cout <<
" in ProcessVetor[" << ivec<<
"]";
739 G4String anErrMsg =
"Set Ordering First is invoked twice for ";
743 G4Exception(
"G4ProcessManager::SetProcessOrderingToFirst()",
763 const G4String aErrorMessage(
" G4ProcessManager::SetProcessOrderingToSecond");
781 G4cout <<
" illegal DoIt Index [= " <<
G4int(idDoIt) <<
"]";
835 G4cout <<
" in ProcessVetor[" << ivec<<
"]";
836 G4cout <<
" with Ordering parameter = 1 ";
857 G4String anErrMsg =
"Set Ordering Last is invoked twice for ";
861 G4Exception(
"G4ProcessManager::SetProcessOrderingToLast()",
"ProcMan114",
875 G4cout <<
"G4ProcessManager::InActivateProcess is not valid in ";
889 if (pAttr == 0)
return 0;
892 G4VProcess* pProcess = (*theProcessList)[index];
894 const G4String aErrorMessage(
" G4ProcessManager::InactivateProcess():");
905 }
else if ((idx >= 0) && (idx < pVector->entries())) {
907 if ((*pVector)[idx]== pProcess) {
910 G4String anErrorMessage(
"Bad ProcessList: Bad index in attribute");
912 anErrorMessage +=
"process[" + pProcess->
GetProcessName() +
"] " ;
913 G4Exception(
"G4ProcessManager::InactivateProcess():",
"ProcMan012",
919 G4String anErrorMessage(
"Bad ProcessList: Index is out of range");
921 anErrorMessage +=
"process[" + pProcess->
GetProcessName() +
"] " ;
922 G4Exception(
"G4ProcessManager::InactivateProcess():",
"ProcMan012",
940 G4cout <<
"G4ProcessManager::ActivateProcess is not valid in ";
954 if (pAttr == 0)
return 0;
957 G4VProcess* pProcess = (*theProcessList)[index];
966 }
else if ((idx >= 0) && (idx < pVector->entries())) {
968 if ((*pVector)[idx]== 0) {
969 (*pVector)[idx] = pProcess;
971 G4String anErrorMessage(
"Bad ProcessList: Bad index in attribute");
973 anErrorMessage +=
"process[" + pProcess->
GetProcessName() +
"] " ;
974 G4Exception(
"G4ProcessManager::ActivateProcess():",
"ProcMan012",
980 G4String anErrorMessage(
"bad ProcessList: Index is out of range");
982 anErrorMessage +=
"process[" + pProcess->
GetProcessName() +
"] " ;
983 G4Exception(
"G4ProcessManager::ActivateProcess():",
"ProcMan012",
997 return (
this == &right);
1003 return (
this != &right);
1012 G4cout <<
"G4ProcessManager: particle["
1019 G4cout <<
"[" << idx <<
"]";
1020 G4cout <<
"=== process[" << ((*theProcessList)(idx))->GetProcessName()<<
" :";
1026 if ( pAttr-> isActive ) {
1036 G4cout <<
" Ordering:: ";
1037 G4cout <<
" AtRest AlongStep PostStep ";
1040 G4cout <<
" GetPIL/ DoIt GetPIL/ DoIt GetPIL/ DoIt ";
1044 for (
G4int idx2 = 0; idx2 <6 ; idx2++) {
1049 for (
G4int idx3 = 0; idx3 <6 ; idx3++) {
1073 for(
G4int j=nproc-1;j>=0;j--) {
1136 G4cout <<
"G4ProcessManager::GetProcessActivation ";
1137 G4cout <<
" process (or its index) not found ";
1145 return pAttr-> isActive;
1151 if (aProcess==0)
return;
1156 G4cout <<
"G4ProcessManager::CheckOrderingParameters ";
1158 <<
" has no attribute" <<
G4endl;
1170 G4cerr <<
"G4ProcessManager::CheckOrderingParameters ";
1171 G4cerr <<
"You cannot set ordering parameter ["
1173 <<
"] for AtRest DoIt to the process "
1183 G4cerr <<
"G4ProcessManager::CheckOrderingParameters ";
1184 G4cerr <<
"You cannot set ordering parameter ["
1186 <<
"] for AlongStep DoIt to the process "
1197 G4cerr <<
"G4ProcessManager::CheckOrderingParameters ";
1198 G4cerr <<
"You cannot set ordering parameter ["
1200 <<
"] for PostStep DoIt to the process"
1209 msg =
"Invalid ordering parameters are set for ";
1211 G4Exception(
"G4ProcessManager::CheckOrderingParameters ",
std::vector< G4ProcessAttribute * > G4ProcessAttrVector
static const G4String & GetProcessTypeName(G4ProcessType)
G4int GetProcessVectorIndex(G4VProcess *aProcess, G4ProcessVectorDoItIndex idx, G4ProcessVectorTypeIndex typ=typeGPIL) const
G4bool insertAt(G4int i, G4VProcess *aProcess)
virtual void SetProcessManager(const G4ProcessManager *)
G4int Insert(G4VProcess *aProcess, G4ProcessManager *aProcMgr)
G4ProcessVectorTypeIndex typ
void SetProcessOrderingToFirst(G4VProcess *aProcess, G4ProcessVectorDoItIndex idDoIt)
G4bool isAlongStepDoItIsEnabled() const
void SetProcessOrderingToSecond(G4VProcess *aProcess, G4ProcessVectorDoItIndex idDoIt)
G4bool isPostStepDoItIsEnabled() const
G4VProcess * removeLast()
G4int Remove(G4VProcess *aProcess, G4ProcessManager *aProcMgr)
G4ProcessManager & operator=(const G4ProcessManager &right)
G4ProcessAttrVector * theAttrVector
static G4ThreadLocal G4int counterOfObjects
G4bool isAtRestDoItIsEnabled() const
G4int GetProcessOrdering(G4VProcess *aProcess, G4ProcessVectorDoItIndex idDoIt)
G4int operator==(const G4ProcessManager &right) const
G4bool isSetOrderingFirstInvoked[NDoit]
G4int GetVerboseLevel() const
const G4ParticleDefinition * theParticleType
G4int InsertAt(G4int position, G4VProcess *process, G4int ivec)
const G4String & GetParticleName() const
void CheckOrderingParameters(G4VProcess *) const
G4int operator!=(const G4ProcessManager &right) const
G4VProcess * SetProcessActivation(G4VProcess *aProcess, G4bool fActive)
G4VProcess * ActivateProcess(G4int index)
static G4StateManager * GetStateManager()
G4int RemoveAt(G4int position, G4VProcess *process, G4int ivec)
G4GLOB_DLL std::ostream G4cout
G4int ordProcVector[G4ProcessManager::SizeOfProcVectorArray]
G4int FindInsertPosition(G4int ord, G4int ivec)
G4int AddProcess(G4VProcess *aProcess, G4int ordAtRestDoIt=ordInActive, G4int ordAlongSteptDoIt=ordInActive, G4int ordPostStepDoIt=ordInActive)
G4ProcessAttribute * GetAttribute(G4int index) const
G4int idxProcVector[G4ProcessManager::SizeOfProcVectorArray]
G4ApplicationState GetCurrentState() const
void SetProcessOrdering(G4VProcess *aProcess, G4ProcessVectorDoItIndex idDoIt, G4int ordDoIt=ordDefault)
const G4String & GetProcessName() const
G4int GetProcessVectorId(G4ProcessVectorDoItIndex idx, G4ProcessVectorTypeIndex typ=typeGPIL) const
G4bool insert(G4VProcess *aProcess)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
G4VProcess * InActivateProcess(G4int index)
G4ProcessVector * theProcVector[SizeOfProcVectorArray]
void SetProcessOrderingToLast(G4VProcess *aProcess, G4ProcessVectorDoItIndex idDoIt)
void StartTracking(G4Track *aTrack=0)
G4VProcess * removeAt(G4int i)
G4int GetProcessIndex(G4VProcess *) const
G4bool GetProcessActivation(G4VProcess *aProcess) const
G4bool isSetOrderingLastInvoked[NDoit]
G4VProcess * RemoveProcess(G4VProcess *aProcess)
static G4ProcessTable * GetProcessTable()
G4ProcessVector * theProcessList
virtual G4bool IsApplicable(const G4ParticleDefinition &)
G4GLOB_DLL std::ostream G4cerr
static G4ThreadLocal G4ProcessManagerMessenger * fProcessManagerMessenger