Import Geant4 5.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 16:57:27 +02:00
parent 330b82b769
commit 37fff30d2e
5733 changed files with 263867 additions and 74574 deletions
+54 -31
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4SteppingManager2.cc,v 1.5 2002/02/04 01:49:08 tsasaki Exp $
// GEANT4 tag $Name: geant4-04-01 $
// $Id: G4SteppingManager2.cc,v 1.9 2002/11/07 21:31:57 tsasaki Exp $
// GEANT4 tag $Name: geant4-05-00 $
//
//
//---------------------------------------------------------------
@@ -70,6 +70,13 @@ void G4SteppingManager::GetProcessNumber()
MAXofPostStepLoops = pm->GetPostStepProcessVector()->entries();
fPostStepDoItVector = pm->GetPostStepProcessVector(typeDoIt);
fPostStepGetPhysIntVector = pm->GetPostStepProcessVector(typeGPIL);
if (SizeOfSelectedDoItVector<MAXofAtRestLoops ||
SizeOfSelectedDoItVector<MAXofAlongStepLoops ||
SizeOfSelectedDoItVector<MAXofPostStepLoops ) {
G4Exception("G4SteppingManager::GetProcessNumber : The array size is small than the actutal number of processes. Chnage G4SteppingManager.hh and recompile is needed. " );
}
}
@@ -119,7 +126,7 @@ void G4SteppingManager::GetProcessNumber()
for(size_t np=0; np < MAXofPostStepLoops; np++){
fCurrentProcess = (*fPostStepGetPhysIntVector)(np);
if (fCurrentProcess== NULL) {
(*fSelectedPostStepDoItVector)[np] = 0;
(*fSelectedPostStepDoItVector)[np] = InActivated;
continue;
} // NULL means the process is inactivated by a user on fly.
@@ -134,19 +141,22 @@ void G4SteppingManager::GetProcessNumber()
switch (fCondition) {
case ExclusivelyForced:
(*fSelectedPostStepDoItVector)[np] = 4;
(*fSelectedPostStepDoItVector)[np] = ExclusivelyForced;
fStepStatus = fExclusivelyForcedProc;
fStep->GetPostStepPoint()
->SetProcessDefinedStep(fCurrentProcess);
break;
case Conditionally:
(*fSelectedPostStepDoItVector)[np] = 3;
(*fSelectedPostStepDoItVector)[np] = Conditionally;
break;
case Forced:
(*fSelectedPostStepDoItVector)[np] = 2;
(*fSelectedPostStepDoItVector)[np] = Forced;
break;
case StronglyForced:
(*fSelectedPostStepDoItVector)[np] = StronglyForced;
break;
default:
(*fSelectedPostStepDoItVector)[np] = 0;
(*fSelectedPostStepDoItVector)[np] = InActivated;
if(physIntLength < PhysicalStep ){
PhysicalStep = physIntLength;
fStepStatus = fPostStepDoItProc;
@@ -159,7 +169,7 @@ void G4SteppingManager::GetProcessNumber()
}
if(fPostStepDoItProcTriggered<MAXofPostStepLoops)
(*fSelectedPostStepDoItVector)[fPostStepDoItProcTriggered] = 1;
(*fSelectedPostStepDoItVector)[fPostStepDoItProcTriggered] = NotForced;
// GPIL for AlongStep
@@ -227,7 +237,7 @@ void G4SteppingManager::InvokeAtRestDoItProcs()
for( size_t ri=0 ; ri < MAXofAtRestLoops ; ri++ ){
fCurrentProcess = (*fAtRestGetPhysIntVector)[ri];
if (fCurrentProcess== NULL) {
(*fSelectedAtRestDoItVector)[ri] = 0;
(*fSelectedAtRestDoItVector)[ri] = InActivated;
NofInactiveProc++;
continue;
} // NULL means the process is inactivated by a user on fly.
@@ -237,11 +247,11 @@ void G4SteppingManager::InvokeAtRestDoItProcs()
*fTrack,
&fCondition );
if(fCondition==Forced){
(*fSelectedAtRestDoItVector)[ri] = 2;
(*fSelectedAtRestDoItVector)[ri] = Forced;
}
else{
(*fSelectedAtRestDoItVector)[ri] = 0;
if(lifeTime < shortestLifeTime ){
(*fSelectedAtRestDoItVector)[ri] = InActivated;
if(lifeTime < shortestLifeTime ){
shortestLifeTime = lifeTime;
fAtRestDoItProcTriggered = G4int(int(ri));
}
@@ -254,7 +264,7 @@ void G4SteppingManager::InvokeAtRestDoItProcs()
G4Exception("G4SteppingManager::InvokeAtRestDoItProcs: No AtRestDoIt process is active. " );
}
(*fSelectedAtRestDoItVector)[fAtRestDoItProcTriggered] = 1;
(*fSelectedAtRestDoItVector)[fAtRestDoItProcTriggered] = NotForced;
fStep->SetStepLength( 0. ); //the particle has stopped
fTrack->SetStepLength( 0. );
@@ -265,7 +275,7 @@ void G4SteppingManager::InvokeAtRestDoItProcs()
// Note: DoItVector has inverse order against GetPhysIntVector
// and SelectedAtRestDoItVector.
//
if( (*fSelectedAtRestDoItVector)[MAXofAtRestLoops-np-1] != 0){
if( (*fSelectedAtRestDoItVector)[MAXofAtRestLoops-np-1] != InActivated){
fCurrentProcess = (*fAtRestDoItVector)[np];
@@ -354,7 +364,7 @@ void G4SteppingManager::InvokeAtRestDoItProcs()
// clear ParticleChange
fParticleChange->Clear();
} //if(fSelectedAtRestDoItVector[np] != 0){
} //if(fSelectedAtRestDoItVector[np] != InActivated){
} //for(size_t np=0; np < MAXofAtRestLoops; np++){
fStep->UpdateTrack();
@@ -484,16 +494,37 @@ void G4SteppingManager::InvokePostStepDoItProcs()
// Note: DoItVector has inverse order against GetPhysIntVector
// and SelectedPostStepDoItVector.
//
size_t npGPIL = MAXofPostStepLoops-np-1;
G4int tmp= (*fSelectedPostStepDoItVector)[npGPIL];
if(tmp != 0){
G4int Cond = (*fSelectedPostStepDoItVector)[MAXofPostStepLoops-np-1];
if(Cond != InActivated){
if( ((Cond == NotForced) && (fStepStatus == fPostStepDoItProc)) ||
((Cond == Forced) && (fStepStatus != fExclusivelyForcedProc)) ||
((Cond == Conditionally) && (fStepStatus == fAlongStepDoItProc)) ||
((Cond == ExclusivelyForced) && (fStepStatus == fExclusivelyForcedProc)) ||
((Cond == StronglyForced) )
) {
if ( ((tmp == 1) && (fStepStatus == fPostStepDoItProc)) ||
((tmp == 2) && (fStepStatus != fExclusivelyForcedProc)) ||
((tmp == 3) && (fStepStatus == fAlongStepDoItProc)) ||
((tmp == 4) && (fStepStatus == fExclusivelyForcedProc)) ) {
InvokePSDIP(np);
}
} //if(*fSelectedPostStepDoItVector(np)........
// Exit from PostStepLoop if the track has been killed,
// but extra treatment for processes with Strongly Forced flag
if(fTrack->GetTrackStatus() == fStopAndKill) {
for(size_t np1=np+1; np1 < MAXofPostStepLoops; np1++){
G4int Cond2 = (*fSelectedPostStepDoItVector)[MAXofPostStepLoops-np1-1];
if (Cond2 == StronglyForced) {
InvokePSDIP(np1);
}
}
break;
}
} //for(size_t np=0; np < MAXofPostStepLoops; np++){
}
void G4SteppingManager::InvokePSDIP(size_t np)
{
fCurrentProcess = (*fPostStepDoItVector)[np];
fParticleChange
= fCurrentProcess->PostStepDoIt( *fTrack, *fStep);
@@ -586,12 +617,4 @@ void G4SteppingManager::InvokePostStepDoItProcs()
// clear ParticleChange
fParticleChange->Clear();
}
} //if(*fSelectedPostStepDoItVector(np) != 0){
// Exit from PostStepLoop if the track has been killed
if(fTrack->GetTrackStatus() == fStopAndKill) break;
} //for(size_t np=0; np < MAXofPostStepLoops; np++){
}