#include <G4ITStepProcessor.hh>
Definition at line 83 of file G4ITStepProcessor.hh.
G4ITStepProcessor::G4ITStepProcessor | ( | ) |
Definition at line 63 of file G4ITStepProcessor.cc.
References CleanProcessor(), DBL_MAX, and ResetSecondaries().
00064 { 00065 verboseLevel = 0 ; 00066 // fpUserSteppingAction = 0 ; 00067 fStoreTrajectory = 0; 00068 fpTrackingManager = 0; 00069 fpNavigator = 0; 00070 kCarTolerance = -1.; 00071 fInitialized = false; 00072 fPreviousTimeStep = DBL_MAX; 00073 CleanProcessor(); 00074 ResetSecondaries(); 00075 }
G4ITStepProcessor::~G4ITStepProcessor | ( | ) | [virtual] |
Definition at line 183 of file G4ITStepProcessor.cc.
References ClearProcessInfo(), G4ITTransportationManager::DeleteInstance(), and G4Step::DeleteSecondaryVector().
00184 { 00185 if(fpStep) 00186 { 00187 fpStep->DeleteSecondaryVector(); 00188 delete fpStep; 00189 } 00190 00191 if(fpSecondary) delete fpSecondary; 00192 ClearProcessInfo(); 00193 G4ITTransportationManager::DeleteInstance(); 00194 00195 // if(fpUserSteppingAction) delete fpUserSteppingAction; 00196 }
G4ITStepProcessor::G4ITStepProcessor | ( | const G4ITStepProcessor & | other | ) | [protected] |
Definition at line 199 of file G4ITStepProcessor.cc.
References CleanProcessor(), DBL_MAX, fStoreTrajectory, kCarTolerance, ResetSecondaries(), and verboseLevel.
00200 { 00201 verboseLevel = rhs.verboseLevel ; 00202 fStoreTrajectory = rhs.fStoreTrajectory ; 00203 00204 // fpUserSteppingAction = 0 ; 00205 fpTrackingManager = 0; 00206 fpNavigator = 0; 00207 fInitialized = false; 00208 00209 kCarTolerance = rhs.kCarTolerance; 00210 fInitialized = false; 00211 fPreviousTimeStep = DBL_MAX; 00212 00213 CleanProcessor(); 00214 ResetSecondaries(); 00215 }
void G4ITStepProcessor::ActiveOnlyITProcess | ( | G4ProcessManager * | ) | [protected] |
Definition at line 259 of file G4ITStepProcessor.cc.
References G4ProcessManager::GetProcessList(), G4ProcessManager::SetProcessActivation(), and G4ProcessVector::size().
00260 { 00261 // Method not used for the time being 00262 G4ProcessVector* processVector = processManager->GetProcessList(); 00263 00264 G4VITProcess* itProcess = 0 ; 00265 for(int i = 0 ; i < processVector->size() ; i++) 00266 { 00267 G4VProcess* base_process = (*processVector)[i]; 00268 itProcess = dynamic_cast<G4VITProcess*>(base_process); 00269 00270 if(!itProcess) 00271 { 00272 processManager->SetProcessActivation(base_process, false); 00273 } 00274 } 00275 }
void G4ITStepProcessor::ActiveOnlyITProcess | ( | ) | [protected] |
Definition at line 226 of file G4ITStepProcessor.cc.
References FatalException, G4cerr, G4cout, G4endl, G4Exception(), G4ParticleTable::GetIterator(), G4ParticleDefinition::GetParticleName(), G4ParticleTable::GetParticleTable(), G4ParticleDefinition::GetPDGEncoding(), G4ParticleDefinition::GetProcessManager(), G4ParticleTableIterator< K, V >::reset(), and G4ParticleTableIterator< K, V >::value().
00227 { 00228 // Method not used for the time being 00229 #ifdef debug 00230 G4cout<<"G4ITStepProcessor::CloneProcesses: is called"<<G4endl; 00231 #endif 00232 00233 G4ParticleTable* theParticleTable = G4ParticleTable::GetParticleTable(); 00234 G4ParticleTable::G4PTblDicIterator* theParticleIterator = theParticleTable->GetIterator(); 00235 00236 theParticleIterator->reset(); 00237 // TODO : Ne faire la boucle que sur les IT **** !!! 00238 while( (*theParticleIterator)() ) 00239 { 00240 G4ParticleDefinition* particle = theParticleIterator->value(); 00241 G4ProcessManager* pm= particle->GetProcessManager(); 00242 00243 if(!pm) 00244 { 00245 G4cerr << "ERROR - G4ITStepProcessor::GetProcessNumber()" << G4endl 00246 << " ProcessManager is NULL for particle = " 00247 << particle->GetParticleName() << ", PDG_code = " 00248 << particle->GetPDGEncoding() << G4endl; 00249 G4Exception("G4ITStepProcessor::GetProcessNumber()", "ITStepProcessor0001", 00250 FatalException, "Process Manager is not found."); 00251 return; 00252 } 00253 00254 ActiveOnlyITProcess(pm); 00255 } 00256 }
void G4ITStepProcessor::ApplyProductionCut | ( | G4Track * | ) | [protected] |
Definition at line 570 of file G4ITStepProcessor2.cc.
References G4Step::AddTotalEnergyDeposit(), CalculateSafety(), DBL_MIN, G4DynamicParticle::GetCharge(), G4ProductionCutsTable::GetCoupleIndex(), G4Track::GetDefinition(), G4Track::GetDynamicParticle(), G4ProductionCutsTable::GetEnergyCutsVector(), G4ProductionCuts::GetIndex(), G4Track::GetKineticEnergy(), G4StepPoint::GetMaterialCutsCouple(), G4ProductionCutsTable::GetProductionCutsTable(), G4LossTableManager::GetRange(), G4LossTableManager::Instance(), G4Track::IsGoodForTracking(), and G4Track::SetKineticEnergy().
Referenced by DealWithSecondaries().
00571 { 00572 G4bool tBelowCutEnergyAndSafety = false; 00573 G4int tPtclIdx 00574 = G4ProductionCuts::GetIndex(aSecondary->GetDefinition()); 00575 if (tPtclIdx<0) 00576 { 00577 return; 00578 } 00579 G4ProductionCutsTable* tCutsTbl 00580 = G4ProductionCutsTable::GetProductionCutsTable(); 00581 G4int tCoupleIdx 00582 = tCutsTbl->GetCoupleIndex(fpPreStepPoint->GetMaterialCutsCouple()); 00583 G4double tProdThreshold 00584 = (*(tCutsTbl->GetEnergyCutsVector(tPtclIdx)))[tCoupleIdx]; 00585 if( aSecondary->GetKineticEnergy()<tProdThreshold ) 00586 { 00587 tBelowCutEnergyAndSafety = true; 00588 if(std::abs(aSecondary->GetDynamicParticle()->GetCharge()) > DBL_MIN) 00589 { 00590 G4double currentRange 00591 = G4LossTableManager::Instance()->GetRange(aSecondary->GetDefinition(), 00592 aSecondary->GetKineticEnergy(), 00593 fpPreStepPoint->GetMaterialCutsCouple()); 00594 tBelowCutEnergyAndSafety = (currentRange < CalculateSafety() ); 00595 } 00596 } 00597 00598 if( tBelowCutEnergyAndSafety ) 00599 { 00600 if( !(aSecondary->IsGoodForTracking()) ) 00601 { 00602 // Add kinetic energy to the total energy deposit 00603 fpStep->AddTotalEnergyDeposit( 00604 aSecondary->GetKineticEnergy() ); 00605 aSecondary->SetKineticEnergy(0.0); 00606 } 00607 } 00608 }
G4double G4ITStepProcessor::CalculateSafety | ( | ) | [inline, protected] |
Definition at line 314 of file G4ITStepProcessor.hh.
References G4StepPoint::GetPosition().
Referenced by ApplyProductionCut(), and InvokePSDIP().
00315 { 00316 return std::max( fpState->endpointSafety - 00317 (fpState->endpointSafOrigin - fpPostStepPoint->GetPosition()).mag(), 00318 kCarTolerance ); 00319 }
void G4ITStepProcessor::CalculateStep | ( | ) | [protected] |
void G4ITStepProcessor::CalculateStep | ( | G4Track * | ) |
void G4ITStepProcessor::CalculateStep | ( | G4Track * | , | |
const double & | ||||
) |
void G4ITStepProcessor::CleanProcessor | ( | ) | [inline] |
Definition at line 326 of file G4ITStepProcessor.hh.
References DBL_MAX, INT_MAX, NotCandidateForSelection, and NotForced.
Referenced by G4ITStepProcessor(), Initialize(), and Stepping().
00327 { 00328 fTimeStep = DBL_MAX ; 00329 fPhysIntLength = DBL_MAX; 00330 00331 fpState = 0; 00332 fpTrack = 0; 00333 fpTrackingInfo = 0 ; 00334 fpITrack = 0; 00335 fpStep = 0; 00336 fpPreStepPoint = 0; 00337 fpPostStepPoint = 0; 00338 00339 fpParticleChange = 0; 00340 00341 fpCurrentVolume = 0; 00342 // fpSensitive = 0; 00343 00344 fpSecondary = 0 ; 00345 00346 fpTransportation = 0; 00347 00348 fpCurrentProcess= 0; 00349 fpProcessInfo = 0; 00350 00351 fAtRestDoItProcTriggered = INT_MAX; 00352 fPostStepDoItProcTriggered = INT_MAX; 00353 fPostStepAtTimeDoItProcTriggered = INT_MAX; 00354 fGPILSelection = NotCandidateForSelection ; 00355 fCondition = NotForced; 00356 }
void G4ITStepProcessor::ClearProcessInfo | ( | ) | [protected] |
Definition at line 140 of file G4ITStepProcessor.cc.
Referenced by ForceReInitialization(), and ~G4ITStepProcessor().
00141 { 00142 std::map<const G4ParticleDefinition*, ProcessGeneralInfo*> ::iterator it; 00143 00144 for(it = fProcessGeneralInfoMap.begin();it != fProcessGeneralInfoMap.end();it++) 00145 { 00146 if(it->second) 00147 { 00148 delete it->second; 00149 it->second = 0; 00150 } 00151 } 00152 00153 fProcessGeneralInfoMap.clear(); 00154 }
void G4ITStepProcessor::CloneProcesses | ( | ) | [protected] |
void G4ITStepProcessor::DealWithSecondaries | ( | G4int & | ) | [protected] |
Definition at line 50 of file G4ITStepProcessor2.cc.
References ApplyProductionCut(), DBL_MIN, fStopButAlive, G4ParticleDefinition::GetApplyCutsFlag(), G4Track::GetDefinition(), G4Track::GetKineticEnergy(), G4VParticleChange::GetNumberOfSecondaries(), G4ParticleDefinition::GetProcessManager(), G4VParticleChange::GetSecondary(), G4Track::GetTrackID(), G4Track::SetCreatorProcess(), G4Track::SetParentID(), and G4Track::SetTrackStatus().
Referenced by InvokeAlongStepDoItProcs(), InvokeAtRestDoItProcs(), and InvokePSDIP().
00051 { 00052 // Now Store the secondaries from ParticleChange to SecondaryList 00053 G4Track* tempSecondaryTrack; 00054 00055 for(G4int DSecLoop=0 ; 00056 DSecLoop<fpParticleChange->GetNumberOfSecondaries() ; 00057 DSecLoop++) 00058 { 00059 tempSecondaryTrack = fpParticleChange->GetSecondary(DSecLoop); 00060 00061 if(tempSecondaryTrack->GetDefinition()->GetApplyCutsFlag()) 00062 { 00063 ApplyProductionCut(tempSecondaryTrack); 00064 } 00065 00066 // Set parentID 00067 tempSecondaryTrack->SetParentID( fpTrack->GetTrackID() ); 00068 00069 // Set the process pointer which created this track 00070 tempSecondaryTrack->SetCreatorProcess( fpCurrentProcess ); 00071 00072 // If this 2ndry particle has 'zero' kinetic energy, make sure 00073 // it invokes a rest process at the beginning of the tracking 00074 if(tempSecondaryTrack->GetKineticEnergy() <= DBL_MIN) 00075 { 00076 G4ProcessManager* pm = tempSecondaryTrack->GetDefinition()->GetProcessManager(); 00077 if (pm->GetAtRestProcessVector()->entries()>0){ 00078 tempSecondaryTrack->SetTrackStatus( fStopButAlive ); 00079 fpSecondary->push_back( tempSecondaryTrack ); 00080 fN2ndariesAtRestDoIt++; 00081 } else { 00082 delete tempSecondaryTrack; 00083 } 00084 } 00085 else 00086 { 00087 fpSecondary->push_back( tempSecondaryTrack ); 00088 counter++; 00089 } 00090 } //end of loop on secondary 00091 }
void G4ITStepProcessor::DefinePhysicalStepLength | ( | G4Track * | ) |
Definition at line 508 of file G4ITStepProcessor.cc.
References DoDefinePhysicalStepLength(), and SetTrack().
00509 { 00510 SetTrack(track); 00511 DoDefinePhysicalStepLength(); 00512 }
void G4ITStepProcessor::DoCalculateStep | ( | ) | [protected] |
void G4ITStepProcessor::DoDefinePhysicalStepLength | ( | ) | [protected] |
Definition at line 698 of file G4ITStepProcessor.cc.
References CandidateForSelection, G4ITTransportation::ComputeStep(), Conditionally, DBL_MAX, ExclusivelyForced, fAlongStepDoItProc, FatalErrorInArgument, FatalException, fExclusivelyForcedProc, fGeomBoundary, Forced, fPostStepDoItProc, fStopAndKill, fStopButAlive, fWorldBoundary, G4Exception(), GetAtRestIL(), G4VITProcess::GetInteractionTimeLeft(), G4ITNavigator::GetNavigatorState(), G4Track::GetNextVolume(), G4Step::GetPostStepPoint(), G4VITProcess::GetProcessID(), G4TrackingInformation::GetProcessState(), G4IT::GetTrackingInfo(), InActivated, InitDefineStep(), NotForced, G4VITProcess::ProposesTimeStep(), G4ITNavigator::SetNavigatorState(), G4TrackingInformation::SetNavigatorState(), G4StepPoint::SetProcessDefinedStep(), G4VITProcess::SetProcessState(), and StronglyForced.
Referenced by DefinePhysicalStepLength().
00699 { 00700 00701 InitDefineStep(); 00702 00703 G4TrackStatus trackStatus = fpTrack -> GetTrackStatus() ; 00704 00705 if(trackStatus == fStopAndKill) 00706 { 00707 return ; 00708 } 00709 00710 if(trackStatus == fStopButAlive) 00711 { 00712 fpITrack->GetTrackingInfo()->SetNavigatorState(fpNavigator->GetNavigatorState()); 00713 fpNavigator->SetNavigatorState(0); 00714 return GetAtRestIL() ; 00715 } 00716 00717 00718 // Find minimum Step length and corresponding time 00719 // demanded by active disc./cont. processes 00720 00721 // ReSet the counter etc. 00722 fpState->fPhysicalStep = DBL_MAX; // Initialize by a huge number 00723 fPhysIntLength = DBL_MAX; // Initialize by a huge number 00724 00725 double proposedTimeStep = DBL_MAX; 00726 G4VProcess* processWithPostStepGivenByTimeStep(0); 00727 00728 // GPIL for PostStep 00729 fPostStepDoItProcTriggered = fpProcessInfo->MAXofPostStepLoops; 00730 fPostStepAtTimeDoItProcTriggered = fpProcessInfo->MAXofPostStepLoops; 00731 00732 // G4cout << "fpProcessInfo->MAXofPostStepLoops : " << fpProcessInfo->MAXofPostStepLoops 00733 // << " mol : " << fpITrack -> GetName() << " id : " << fpTrack->GetTrackID() 00734 // << G4endl; 00735 00736 for(size_t np=0; np < fpProcessInfo->MAXofPostStepLoops; np++) 00737 { 00738 fpCurrentProcess = (G4VITProcess*) (*fpProcessInfo->fpPostStepGetPhysIntVector)[np]; 00739 if (fpCurrentProcess== 0) 00740 { 00741 (fpState->fSelectedPostStepDoItVector)[np] = InActivated; 00742 continue; 00743 } // NULL means the process is inactivated by a user on fly. 00744 00745 fCondition=NotForced; 00746 fpCurrentProcess->SetProcessState(fpTrackingInfo->GetProcessState(fpCurrentProcess->GetProcessID())); 00747 00748 // G4cout << "Is going to call : " << fpCurrentProcess -> GetProcessName() << G4endl; 00749 fPhysIntLength = fpCurrentProcess-> 00750 PostStepGPIL( *fpTrack, 00751 fpState->fPreviousStepSize, 00752 &fCondition ); 00753 fpCurrentProcess->SetProcessState(0); 00754 00755 switch (fCondition) 00756 { 00757 case ExclusivelyForced: // Will need special treatment 00758 (fpState->fSelectedPostStepDoItVector)[np] = ExclusivelyForced; 00759 fpState->fStepStatus = fExclusivelyForcedProc; 00760 fpStep->GetPostStepPoint() 00761 ->SetProcessDefinedStep(fpCurrentProcess); 00762 break; 00763 00764 case Conditionally: 00765 // (fpState->fSelectedPostStepDoItVector)[np] = Conditionally; 00766 G4Exception("G4ITStepProcessor::DefinePhysicalStepLength()", "ITStepProcessor0008", 00767 FatalException, "This feature is no more supported"); 00768 break; 00769 00770 case Forced: 00771 (fpState->fSelectedPostStepDoItVector)[np] = Forced; 00772 break; 00773 00774 case StronglyForced: 00775 (fpState->fSelectedPostStepDoItVector)[np] = StronglyForced; 00776 break; 00777 00778 default: 00779 (fpState->fSelectedPostStepDoItVector)[np] = InActivated; 00780 break; 00781 } 00782 00783 if (fCondition==ExclusivelyForced) 00784 { 00785 for(size_t nrest=np+1; nrest < fpProcessInfo->MAXofPostStepLoops; nrest++) 00786 { 00787 (fpState->fSelectedPostStepDoItVector)[nrest] = InActivated; 00788 } 00789 return; // Please note the 'return' at here !!! 00790 } 00791 else 00792 { 00793 if(fPhysIntLength < fpState->fPhysicalStep ) 00794 { 00795 // To avoid checking whether the process is actually 00796 // proposing a time step, the returned time steps are 00797 // negative (just for tagging) 00798 if(fpCurrentProcess->ProposesTimeStep()) 00799 { 00800 fPhysIntLength *= -1; 00801 if(fPhysIntLength < proposedTimeStep) 00802 { 00803 proposedTimeStep = fPhysIntLength; 00804 fPostStepAtTimeDoItProcTriggered = np; 00805 processWithPostStepGivenByTimeStep = fpCurrentProcess; 00806 } 00807 } 00808 else 00809 { 00810 fpState->fPhysicalStep = fPhysIntLength; 00811 fpState->fStepStatus = fPostStepDoItProc; 00812 fPostStepDoItProcTriggered = G4int(np); 00813 fpStep->GetPostStepPoint() 00814 ->SetProcessDefinedStep(fpCurrentProcess); 00815 } 00816 } 00817 } 00818 } 00819 00820 // GPIL for AlongStep 00821 fpState->proposedSafety = DBL_MAX; 00822 G4double safetyProposedToAndByProcess = fpState->proposedSafety; 00823 00824 for(size_t kp=0; kp < fpProcessInfo->MAXofAlongStepLoops; kp++) 00825 { 00826 fpCurrentProcess = (G4VITProcess*) (*fpProcessInfo->fpAlongStepGetPhysIntVector)[kp]; 00827 if (fpCurrentProcess== 0) continue; 00828 // NULL means the process is inactivated by a user on fly. 00829 00830 fpCurrentProcess->SetProcessState(fpTrackingInfo->GetProcessState(fpCurrentProcess->GetProcessID())); 00831 fPhysIntLength = fpCurrentProcess-> AlongStepGPIL( *fpTrack, 00832 fpState->fPreviousStepSize, 00833 fpState->fPhysicalStep, 00834 safetyProposedToAndByProcess, 00835 &fGPILSelection ); 00836 00837 if(fPhysIntLength < fpState->fPhysicalStep) 00838 { 00839 fpState->fPhysicalStep = fPhysIntLength; 00840 // Should save PS and TS in IT 00841 00842 // Check if the process wants to be the GPIL winner. For example, 00843 // multi-scattering proposes Step limit, but won't be the winner. 00844 if(fGPILSelection==CandidateForSelection) 00845 { 00846 fpState->fStepStatus = fAlongStepDoItProc; 00847 fpStep->GetPostStepPoint() 00848 ->SetProcessDefinedStep(fpCurrentProcess); 00849 } 00850 00851 // Transportation is assumed to be the last process in the vector 00852 if(kp == fpProcessInfo->MAXofAlongStepLoops-1) 00853 { 00854 fpTransportation = dynamic_cast<G4ITTransportation*>(fpCurrentProcess); 00855 00856 if(! fpTransportation) 00857 { 00858 G4ExceptionDescription exceptionDescription ; 00859 exceptionDescription << "No transportation process found " ; 00860 G4Exception("G4ITStepProcessor::DoDefinePhysicalStepLength","ITStepProcessor0009", 00861 FatalErrorInArgument,exceptionDescription); 00862 } 00863 00864 fTimeStep = fpTransportation->GetInteractionTimeLeft(); 00865 00866 00867 if (fpTrack->GetNextVolume() != 0) 00868 fpState->fStepStatus = fGeomBoundary; 00869 else 00870 fpState->fStepStatus = fWorldBoundary; 00871 } 00872 } 00873 else 00874 { 00875 if(kp == fpProcessInfo->MAXofAlongStepLoops-1) 00876 { 00877 fpTransportation = dynamic_cast<G4ITTransportation*>(fpCurrentProcess); 00878 00879 if(! fpTransportation) 00880 { 00881 G4ExceptionDescription exceptionDescription ; 00882 exceptionDescription << "No transportation process found " ; 00883 G4Exception("G4ITStepProcessor::DoDefinePhysicalStepLength","ITStepProcessor0010", 00884 FatalErrorInArgument,exceptionDescription); 00885 } 00886 00887 fTimeStep = fpTransportation->GetInteractionTimeLeft(); 00888 } 00889 } 00890 00891 if(proposedTimeStep < fTimeStep) 00892 { 00893 if(fPostStepAtTimeDoItProcTriggered<fpProcessInfo->MAXofPostStepLoops) 00894 { 00895 if ((fpState->fSelectedPostStepDoItVector)[fPostStepAtTimeDoItProcTriggered] == 00896 InActivated) 00897 { 00898 (fpState->fSelectedPostStepDoItVector)[fPostStepAtTimeDoItProcTriggered] = NotForced; 00899 // (fpState->fSelectedPostStepDoItVector)[fPostStepDoItProcTriggered] = InActivated; 00900 00901 fpState->fStepStatus = fPostStepDoItProc; 00902 fpStep->GetPostStepPoint()->SetProcessDefinedStep(processWithPostStepGivenByTimeStep); 00903 00904 fTimeStep = proposedTimeStep; 00905 00906 fpTransportation->ComputeStep(*fpTrack,*fpStep,fTimeStep,fpState->fPhysicalStep); 00907 } 00908 } 00909 } 00910 else 00911 { 00912 if (fPostStepDoItProcTriggered<fpProcessInfo->MAXofPostStepLoops) 00913 { 00914 if ((fpState->fSelectedPostStepDoItVector)[fPostStepDoItProcTriggered] == 00915 InActivated) 00916 { 00917 (fpState->fSelectedPostStepDoItVector)[fPostStepDoItProcTriggered] = 00918 NotForced; 00919 } 00920 } 00921 } 00922 00923 fpCurrentProcess->SetProcessState(0); 00924 00925 // Make sure to check the safety, even if Step is not limited 00926 // by this process. J. Apostolakis, June 20, 1998 00927 // 00928 if (safetyProposedToAndByProcess < fpState->proposedSafety) 00929 // proposedSafety keeps the smallest value: 00930 fpState->proposedSafety = safetyProposedToAndByProcess; 00931 else 00932 // safetyProposedToAndByProcess always proposes a valid safety: 00933 safetyProposedToAndByProcess = fpState->proposedSafety; 00934 00935 } 00936 00937 fpITrack->GetTrackingInfo()->SetNavigatorState(fpNavigator->GetNavigatorState()); 00938 fpNavigator->SetNavigatorState(0); 00939 }
void G4ITStepProcessor::DoIt | ( | G4Track * | , | |
double | ||||
) |
void G4ITStepProcessor::DoStepping | ( | ) | [protected] |
Definition at line 108 of file G4ITStepProcessor2.cc.
References G4Track::AddTrackLength(), G4ITTrackingManager::AppendStep(), FatalErrorInArgument, fAtRestDoItProc, FindTransportationStep(), fPostStepDoItProc, fStopAndKill, fStopButAlive, fUndefined, G4endl, G4Exception(), G4Track::GetDefinition(), GetIT(), G4Track::GetMomentumDirection(), G4ITNavigator::GetNavigatorState(), G4TrackingInformation::GetNavigatorState(), G4ParticleDefinition::GetParticleName(), G4StepPoint::GetPosition(), G4Track::GetPosition(), G4Step::GetPostStepPoint(), G4Step::GetStepLength(), G4Track::GetTouchableHandle(), G4Track::GetTrackID(), G4IT::GetTrackingInfo(), G4Track::GetTrackStatus(), G4Track::IncrementCurrentStepNumber(), InvokeAlongStepDoItProcs(), InvokeAtRestDoItProcs(), InvokePostStepDoItProcs(), InvokeTransportationProc(), G4TrackingInformation::IsLeadingStep(), G4ITNavigator::ResetHierarchyAndLocate(), G4TrackingInformation::SetNavigatorState(), G4ITNavigator::SetNavigatorState(), G4StepPoint::SetProcessDefinedStep(), G4StepPoint::SetSafety(), G4Step::SetStepLength(), G4Track::SetStepLength(), G4StepPoint::SetStepStatus(), G4Track::SetTrackStatus(), and SetupMembers().
Referenced by Stepping().
00109 { 00110 SetupMembers() ; 00111 00112 if(!fpProcessInfo) 00113 { 00114 G4ExceptionDescription exceptionDescription ; 00115 exceptionDescription << "No process info found for particle :" 00116 << fpTrack->GetDefinition()->GetParticleName(); 00117 G4Exception("G4ITStepProcessor::DoStepping","ITStepProcessor0012", 00118 FatalErrorInArgument,exceptionDescription); 00119 return ; 00120 } 00121 else if(fpTrack->GetTrackStatus() == fStopAndKill ) 00122 { 00123 fpState->fStepStatus = fUndefined; 00124 return ; 00125 } 00126 00127 if(fpProcessInfo->MAXofPostStepLoops == 0 00128 && fpProcessInfo->MAXofAlongStepLoops == 0 00129 && fpProcessInfo->MAXofAtRestLoops == 0) 00130 { 00131 fpTrack -> SetTrackStatus(fStopAndKill) ; 00132 fpState->fStepStatus = fUndefined; 00133 return ; 00134 } 00135 //--------------------------------- 00136 // AtRestStep, AlongStep and PostStep Processes 00137 //--------------------------------- 00138 else 00139 { 00140 fpNavigator->SetNavigatorState(fpITrack->GetTrackingInfo()->GetNavigatorState()); 00141 fpNavigator->ResetHierarchyAndLocate( fpTrack->GetPosition(), 00142 fpTrack->GetMomentumDirection(), 00143 *((G4TouchableHistory*)fpTrack->GetTouchableHandle()()) ); 00144 fpNavigator->SetNavigatorState(fpITrack->GetTrackingInfo()->GetNavigatorState()); 00145 // We reset the navigator state before checking for AtRest 00146 // in case a AtRest processe would use a navigator info 00147 00148 if( fpTrack->GetTrackStatus() == fStopButAlive ) 00149 { 00150 if( fpProcessInfo->MAXofAtRestLoops>0 && 00151 fpProcessInfo->fpAtRestDoItVector != 0) // second condition to make coverity happy 00152 { 00153 //----------------- 00154 // AtRestStepDoIt 00155 //----------------- 00156 InvokeAtRestDoItProcs(); 00157 fpState->fStepStatus = fAtRestDoItProc; 00158 fpStep->GetPostStepPoint()->SetStepStatus( fpState->fStepStatus ); 00159 00160 } 00161 // Make sure the track is killed 00162 fpTrack->SetTrackStatus( fStopAndKill ); 00163 } 00164 else // if(fTimeStep > 0.) // Bye, because PostStepIL can return 0 => time =0 00165 { 00166 if(fpITrack == 0) 00167 { 00168 G4ExceptionDescription exceptionDescription ; 00169 exceptionDescription 00170 << " !!! TrackID : "<< fpTrack->GetTrackID() << G4endl 00171 << " !!! Track status : "<< fpTrack->GetTrackStatus() << G4endl 00172 << " !!! Particle Name : "<< fpTrack -> GetDefinition() -> GetParticleName() << G4endl 00173 << "No G4ITStepProcessor::fpITrack found" << G4endl; 00174 00175 G4Exception("G4ITStepProcessor::DoStepping","ITStepProcessor0013", 00176 FatalErrorInArgument,exceptionDescription); 00177 return ; // to make coverity happy 00178 } 00179 00180 if(fpITrack->GetTrackingInfo()->IsLeadingStep() == false) 00181 { 00182 // In case the track has NOT the minimum step length 00183 // Given the final step time, the transportation 00184 // will compute the final position of the particle 00185 00186 fpState->fStepStatus = fPostStepDoItProc; 00187 fpStep->GetPostStepPoint() 00188 ->SetProcessDefinedStep(fpTransportation); 00189 FindTransportationStep(); 00190 } 00191 00192 00193 // Store the Step length (geometrical length) to G4Step and G4Track 00194 fpTrack->SetStepLength( fpState->fPhysicalStep ); 00195 fpStep->SetStepLength( fpState->fPhysicalStep ); 00196 00197 G4double GeomStepLength = fpState->fPhysicalStep; 00198 00199 // Store StepStatus to PostStepPoint 00200 fpStep->GetPostStepPoint()->SetStepStatus( fpState->fStepStatus ); 00201 00202 // Invoke AlongStepDoIt 00203 InvokeAlongStepDoItProcs(); 00204 00205 // Update track by taking into account all changes by AlongStepDoIt 00206 // fpStep->UpdateTrack(); // done in InvokeAlongStepDoItProcs 00207 00208 // Update safety after invocation of all AlongStepDoIts 00209 fpState->endpointSafOrigin= fpPostStepPoint->GetPosition(); 00210 00211 fpState->endpointSafety= std::max( fpState->proposedSafety - GeomStepLength, kCarTolerance); 00212 00213 fpStep->GetPostStepPoint()->SetSafety( fpState->endpointSafety ); 00214 00215 if(GetIT(fpTrack)->GetTrackingInfo()->IsLeadingStep()) 00216 { 00217 // Invoke PostStepDoIt including G4ITTransportation::PSDI 00218 InvokePostStepDoItProcs(); 00219 } 00220 else 00221 { 00222 // Only invoke transportation 00223 InvokeTransportationProc(); 00224 } 00225 } 00226 00227 fpITrack->GetTrackingInfo()->SetNavigatorState(fpNavigator->GetNavigatorState()); 00228 fpNavigator->SetNavigatorState(0); 00229 } 00230 //------- 00231 // Finale 00232 //------- 00233 00234 // Update 'TrackLength' and remeber the Step length of the current Step 00235 fpTrack->AddTrackLength(fpStep->GetStepLength()); 00236 fpTrack->IncrementCurrentStepNumber(); 00237 00238 // Send G4Step information to Hit/Dig if the volume is sensitive 00239 /*** 00240 fpCurrentVolume = fpStep->GetPreStepPoint()->GetPhysicalVolume(); 00241 StepControlFlag = fpStep->GetControlFlag(); 00242 00243 if( fpCurrentVolume != 0 && StepControlFlag != AvoidHitInvocation) 00244 { 00245 fpSensitive = fpStep->GetPreStepPoint()-> 00246 GetSensitiveDetector(); 00247 if( fpSensitive != 0 ) 00248 { 00249 fpSensitive->Hit(fpStep); 00250 } 00251 } 00252 00253 User intervention process. 00254 if( fpUserSteppingAction != 0 ) 00255 { 00256 fpUserSteppingAction->UserSteppingAction(fpStep); 00257 } 00258 G4UserSteppingAction* regionalAction 00259 = fpStep->GetPreStepPoint()->GetPhysicalVolume()->GetLogicalVolume()->GetRegion() 00260 ->GetRegionalSteppingAction(); 00261 if( regionalAction ) regionalAction->UserSteppingAction(fpStep); 00262 ***/ 00263 fpTrackingManager->AppendStep(fpTrack,fpStep); 00264 // Stepping process finish. Return the value of the StepStatus. 00265 00266 // return fpState->fStepStatus; 00267 }
void G4ITStepProcessor::FindTransportationStep | ( | ) |
Definition at line 464 of file G4ITStepProcessor2.cc.
References G4ITTransportation::ComputeStep(), DBL_MAX, FatalErrorInArgument, fStopAndKill, G4Exception(), G4VITProcess::GetProcessID(), G4TrackingInformation::GetProcessState(), G4IT::GetTrack(), and G4VITProcess::SetProcessState().
Referenced by DoStepping().
00465 { 00466 double physicalStep(0.) ; 00467 00468 fpTransportation = fpProcessInfo->fpTransportation; 00469 // dynamic_cast<G4ITTransportation*>((fpProcessInfo->fpAlongStepGetPhysIntVector)[MAXofAlongStepLoops-1]); 00470 00471 if(!fpTrack) 00472 { 00473 G4ExceptionDescription exceptionDescription ; 00474 exceptionDescription 00475 << "No G4ITStepProcessor::fpTrack found"; 00476 G4Exception("G4ITStepProcessor::FindTransportationStep","ITStepProcessor0013", 00477 FatalErrorInArgument,exceptionDescription); 00478 return; 00479 00480 } 00481 if(!fpITrack) 00482 { 00483 G4ExceptionDescription exceptionDescription ; 00484 exceptionDescription 00485 << "No G4ITStepProcessor::fITrack" ; 00486 G4Exception("G4ITStepProcessor::FindTransportationStep","ITStepProcessor0014", 00487 FatalErrorInArgument,exceptionDescription); 00488 return; 00489 } 00490 if(!(fpITrack->GetTrack())) 00491 { 00492 G4ExceptionDescription exceptionDescription ; 00493 exceptionDescription 00494 << "No G4ITStepProcessor::fITrack->GetTrack()" ; 00495 G4Exception("G4ITStepProcessor::FindTransportationStep","ITStepProcessor0015", 00496 FatalErrorInArgument,exceptionDescription); 00497 return; 00498 } 00499 00500 if(fpTransportation) 00501 { 00502 fpTransportation->SetProcessState(fpTrackingInfo->GetProcessState(fpTransportation->GetProcessID())); 00503 fpTransportation->ComputeStep(*fpTrack, *fpStep, fTimeStep, physicalStep) ; 00504 fpTransportation->SetProcessState(0); 00505 } 00506 00507 if(physicalStep >= DBL_MAX) 00508 { 00509 fpTrack -> SetTrackStatus(fStopAndKill) ; 00510 return ; 00511 } 00512 00513 fpState->fPhysicalStep = physicalStep ; 00514 }
void G4ITStepProcessor::ForceReInitialization | ( | ) |
Definition at line 158 of file G4ITStepProcessor.cc.
References ClearProcessInfo(), and Initialize().
00159 { 00160 fInitialized = false; 00161 ClearProcessInfo(); 00162 Initialize(); 00163 }
void G4ITStepProcessor::GetAtRestIL | ( | ) | [protected] |
Definition at line 453 of file G4ITStepProcessor.cc.
References G4VProcess::AtRestGPIL(), DBL_MAX, Forced, G4cerr, G4endl, G4VITProcess::GetProcessID(), G4TrackingInformation::GetProcessState(), InActivated, NotForced, and G4VITProcess::SetProcessState().
Referenced by DoDefinePhysicalStepLength().
00454 { 00455 // Select the rest process which has the shortest time before 00456 // it is invoked. In rest processes, GPIL() 00457 // returns the time before a process occurs. 00458 G4double lifeTime (DBL_MAX), shortestLifeTime (DBL_MAX); 00459 00460 fAtRestDoItProcTriggered = 0; 00461 shortestLifeTime = DBL_MAX; 00462 00463 unsigned int NofInactiveProc=0; 00464 00465 for( size_t ri=0 ; ri < fpProcessInfo->MAXofAtRestLoops ; ri++ ) 00466 { 00467 fpCurrentProcess = (G4VITProcess*) (*fpProcessInfo->fpAtRestGetPhysIntVector)[ri]; 00468 if (fpCurrentProcess== 0) 00469 { 00470 (fpState->fSelectedAtRestDoItVector)[ri] = InActivated; 00471 NofInactiveProc++; 00472 continue; 00473 } // NULL means the process is inactivated by a user on fly. 00474 00475 fCondition=NotForced; 00476 fpCurrentProcess->SetProcessState(fpTrackingInfo->GetProcessState(fpCurrentProcess->GetProcessID())); 00477 lifeTime = fpCurrentProcess->AtRestGPIL( *fpTrack, &fCondition ); 00478 fpCurrentProcess->SetProcessState(0); 00479 00480 if(fCondition==Forced) 00481 { 00482 (fpState->fSelectedAtRestDoItVector)[ri] = Forced; 00483 } 00484 else 00485 { 00486 (fpState->fSelectedAtRestDoItVector)[ri] = InActivated; 00487 if(lifeTime < shortestLifeTime ) 00488 { 00489 shortestLifeTime = lifeTime; 00490 fAtRestDoItProcTriggered = G4int(ri); 00491 (fpState->fSelectedAtRestDoItVector)[fAtRestDoItProcTriggered] = NotForced; 00492 } 00493 } 00494 } 00495 00496 fTimeStep = shortestLifeTime ; 00497 00498 // at least one process is necessary to destroy the particle 00499 // exit with warning 00500 if(NofInactiveProc==fpProcessInfo->MAXofAtRestLoops) 00501 { 00502 G4cerr << "ERROR - G4ITStepProcessor::InvokeAtRestDoItProcs()" << G4endl 00503 << " No AtRestDoIt process is active!" << G4endl; 00504 } 00505 }
double G4ITStepProcessor::GetInteractionTime | ( | ) | [inline] |
void G4ITStepProcessor::GetProcessInfo | ( | ) | [protected] |
Definition at line 408 of file G4ITStepProcessor.cc.
References FatalErrorInArgument, G4Exception(), G4Track::GetDefinition(), G4ParticleDefinition::GetProcessManager(), and SetupGeneralProcessInfo().
Referenced by SetupMembers().
00409 { 00410 G4ParticleDefinition* particle = fpTrack->GetDefinition(); 00411 std::map<const G4ParticleDefinition*, ProcessGeneralInfo*>::iterator it = fProcessGeneralInfoMap.find(particle); 00412 00413 if(it == fProcessGeneralInfoMap.end()) 00414 { 00415 SetupGeneralProcessInfo(particle,fpTrack->GetDefinition()->GetProcessManager()); 00416 if(fpProcessInfo == 0) 00417 { 00418 G4ExceptionDescription exceptionDescription ("..."); 00419 G4Exception("G4ITStepProcessor::GetProcessNumber","ITStepProcessor0008", 00420 FatalErrorInArgument,exceptionDescription); 00421 return; 00422 } 00423 } 00424 else 00425 { 00426 fpProcessInfo = it->second; 00427 } 00428 }
G4TrackVector* G4ITStepProcessor::GetSecondaries | ( | ) | [inline] |
const G4Step* G4ITStepProcessor::GetStep | ( | ) | const [inline] |
G4Step* G4ITStepProcessor::GetStep | ( | ) | [inline] |
const G4Track * G4ITStepProcessor::GetTrack | ( | ) | const [inline] |
G4Track* G4ITStepProcessor::GetTrack | ( | ) | [inline] |
G4ITTrackingManager* G4ITStepProcessor::GetTrackingManager | ( | ) | [inline] |
void G4ITStepProcessor::InitDefineStep | ( | ) | [protected] |
Definition at line 611 of file G4ITStepProcessor.cc.
References G4Step::CopyPostToPreStepPoint(), G4ITNavigator::CreateTouchableHistory(), G4Track::GetMomentumDirection(), G4TrackingInformation::GetNavigatorState(), G4Track::GetNextTouchableHandle(), G4StepPoint::GetPhysicalVolume(), G4Track::GetPosition(), G4Step::GetPreStepPoint(), G4VPhysicalVolume::GetRegularStructureId(), G4Track::GetStepLength(), G4Track::GetTouchableHandle(), G4IT::GetTrackingInfo(), G4ITNavigator::NewNavigatorState(), G4Step::NewSecondaryVector(), G4ITNavigator::ResetHierarchyAndLocate(), G4Step::ResetTotalEnergyDeposit(), SetInitialStep(), G4ITNavigator::SetNavigatorState(), G4Track::SetNextTouchableHandle(), G4Step::SetPointerToVectorOfAuxiliaryPoints(), G4Track::SetStep(), G4TrackingInformation::SetStepProcessorState(), G4Track::SetTouchableHandle(), and SetupMembers().
Referenced by DoDefinePhysicalStepLength().
00612 { 00613 00614 if(!fpStep) 00615 { 00616 00617 // Create new Step and give it to the track 00618 fpStep = new G4Step(); 00619 fpTrack->SetStep(fpStep); 00620 fpSecondary = fpStep->NewSecondaryVector(); 00621 00622 // Create new state and set it in the trackingInfo 00623 fpState = new G4ITStepProcessorState(); 00624 fpITrack->GetTrackingInfo()->SetStepProcessorState((G4ITStepProcessorState_Lock*)fpState); 00625 00626 SetupMembers(); 00627 fpNavigator->NewNavigatorState(); 00628 00629 SetInitialStep(); 00630 } 00631 else 00632 { 00633 SetupMembers(); 00634 00635 fpState->fPreviousStepSize = fpTrack->GetStepLength(); 00636 /*** 00637 // Send G4Step information to Hit/Dig if the volume is sensitive 00638 fpCurrentVolume = fpStep->GetPreStepPoint()->GetPhysicalVolume(); 00639 StepControlFlag = fpStep->GetControlFlag(); 00640 if( fpCurrentVolume != 0 && StepControlFlag != AvoidHitInvocation) 00641 { 00642 fpSensitive = fpStep->GetPreStepPoint()-> 00643 GetSensitiveDetector(); 00644 00645 // if( fSensitive != 0 ) { 00646 // fSensitive->Hit(fStep); 00647 // } 00648 } 00649 ***/ 00650 // Store last PostStepPoint to PreStepPoint, and swap current and next 00651 // volume information of G4Track. Reset total energy deposit in one Step. 00652 fpStep->CopyPostToPreStepPoint(); 00653 fpStep->ResetTotalEnergyDeposit(); 00654 00655 //JA Set the volume before it is used (in DefineStepLength() for User Limit) 00656 fpCurrentVolume = fpStep->GetPreStepPoint()->GetPhysicalVolume(); 00657 /* 00658 G4cout << G4endl; 00659 G4cout << "!!!!!!!!!!!!!!!!!!!!!!!!!!!" << G4endl; 00660 G4cout << "PreStepPoint Volume : " << fpCurrentVolume->GetName() << G4endl; 00661 G4cout << "Track Touchable : " << fpTrack->GetTouchableHandle()->GetVolume()->GetName() << G4endl; 00662 G4cout << "Track NextTouchable : " << fpTrack->GetNextTouchableHandle()->GetVolume()->GetName() << G4endl; 00663 */ 00664 // Reset the step's auxiliary points vector pointer 00665 fpStep->SetPointerToVectorOfAuxiliaryPoints(0); 00666 00667 // Switch next touchable in track to current one 00668 fpTrack->SetTouchableHandle(fpTrack->GetNextTouchableHandle()); 00669 fpState->fTouchableHandle = fpTrack->GetTouchableHandle(); 00670 fpTrack->SetNextTouchableHandle( fpState->fTouchableHandle ); 00671 G4VPhysicalVolume* oldTopVolume= fpTrack->GetTouchableHandle()->GetVolume(); 00672 fpNavigator->SetNavigatorState(fpITrack->GetTrackingInfo()->GetNavigatorState()); 00673 00674 G4VPhysicalVolume* newTopVolume= 00675 fpNavigator->ResetHierarchyAndLocate( fpTrack->GetPosition(), 00676 fpTrack->GetMomentumDirection(), 00677 *((G4TouchableHistory*)fpTrack->GetTouchableHandle()()) ); 00678 00679 // G4cout << "New Top Volume : " << newTopVolume->GetName() << G4endl; 00680 00681 if(newTopVolume != oldTopVolume || oldTopVolume->GetRegularStructureId() == 1 ) 00682 { 00683 fpState->fTouchableHandle = fpNavigator->CreateTouchableHistory(); 00684 fpTrack->SetTouchableHandle( fpState->fTouchableHandle ); 00685 fpTrack->SetNextTouchableHandle( fpState->fTouchableHandle ); 00686 } 00687 00688 fpNavigator->SetNavigatorState(fpITrack->GetTrackingInfo()->GetNavigatorState()); 00689 } 00690 }
void G4ITStepProcessor::Initialize | ( | ) | [virtual] |
Definition at line 167 of file G4ITStepProcessor.cc.
References CleanProcessor(), DBL_MAX, G4GeometryTolerance::GetInstance(), G4GeometryTolerance::GetSurfaceTolerance(), G4ITTransportationManager::GetTransportationManager(), and SetNavigator().
Referenced by ForceReInitialization().
00168 { 00169 CleanProcessor(); 00170 if(fInitialized) return; 00171 // ActiveOnlyITProcess(); 00172 00173 SetNavigator(G4ITTransportationManager::GetTransportationManager() 00174 ->GetNavigatorForTracking()); 00175 00176 fPhysIntLength = DBL_MAX; 00177 kCarTolerance = 0.5*G4GeometryTolerance::GetInstance()->GetSurfaceTolerance(); 00178 00179 fInitialized = true; 00180 }
void G4ITStepProcessor::InvokeAlongStepDoItProcs | ( | ) | [protected] |
Definition at line 325 of file G4ITStepProcessor2.cc.
References G4VProcess::AlongStepDoIt(), G4VParticleChange::Clear(), DBL_MIN, DealWithSecondaries(), fAlive, fExclusivelyForcedProc, fStopAndKill, fStopButAlive, G4Track::GetKineticEnergy(), G4VITProcess::GetProcessID(), G4TrackingInformation::GetProcessState(), G4Track::GetTrackStatus(), G4VParticleChange::GetTrackStatus(), G4VITProcess::SetProcessState(), G4Track::SetTrackStatus(), G4VParticleChange::UpdateStepForAlongStep(), and G4Step::UpdateTrack().
Referenced by DoStepping().
00326 { 00327 00328 // If the current Step is defined by a 'ExclusivelyForced' 00329 // PostStepDoIt, then don't invoke any AlongStepDoIt 00330 if(fpState->fStepStatus == fExclusivelyForcedProc) 00331 { 00332 return; // Take note 'return' at here !!! 00333 } 00334 00335 // Invoke the all active continuous processes 00336 for( size_t ci=0 ; ci<fpProcessInfo->MAXofAlongStepLoops ; ci++ ) 00337 { 00338 fpCurrentProcess = (G4VITProcess*) (*fpProcessInfo->fpAlongStepDoItVector)[ci]; 00339 if (fpCurrentProcess== 0) continue; 00340 // NULL means the process is inactivated by a user on fly. 00341 00342 fpCurrentProcess->SetProcessState(fpTrackingInfo->GetProcessState(fpCurrentProcess->GetProcessID())); 00343 fpParticleChange 00344 = fpCurrentProcess->AlongStepDoIt( *fpTrack, *fpStep ); 00345 fpCurrentProcess->SetProcessState(0); 00346 // Update the PostStepPoint of Step according to ParticleChange 00347 00348 fpParticleChange->UpdateStepForAlongStep(fpStep); 00349 00350 // Now Store the secondaries from ParticleChange to SecondaryList 00351 DealWithSecondaries(fN2ndariesAlongStepDoIt) ; 00352 00353 // Set the track status according to what the process defined 00354 // if kinetic energy >0, otherwise set fStopButAlive 00355 fpTrack->SetTrackStatus( fpParticleChange->GetTrackStatus() ); 00356 00357 // clear ParticleChange 00358 fpParticleChange->Clear(); 00359 } 00360 00361 fpStep->UpdateTrack(); 00362 00363 G4TrackStatus fNewStatus = fpTrack->GetTrackStatus(); 00364 00365 if ( fNewStatus == fAlive && fpTrack->GetKineticEnergy() <= DBL_MIN ) 00366 { 00367 // G4cout << "G4ITStepProcessor::InvokeAlongStepDoItProcs : Track will be killed" << G4endl; 00368 if(fpProcessInfo->MAXofAtRestLoops>0) fNewStatus = fStopButAlive; 00369 else fNewStatus = fStopAndKill; 00370 fpTrack->SetTrackStatus( fNewStatus ); 00371 } 00372 00373 }
void G4ITStepProcessor::InvokeAtRestDoItProcs | ( | ) | [protected] |
Definition at line 275 of file G4ITStepProcessor2.cc.
References G4VProcess::AtRestDoIt(), G4VParticleChange::Clear(), DealWithSecondaries(), G4Step::GetPostStepPoint(), G4VITProcess::GetProcessID(), G4TrackingInformation::GetProcessState(), InActivated, G4StepPoint::SetProcessDefinedStep(), G4VITProcess::SetProcessState(), G4Track::SetStepLength(), G4Step::SetStepLength(), and G4VParticleChange::UpdateStepForAtRest().
Referenced by DoStepping().
00276 { 00277 fpStep->SetStepLength( 0. ); //the particle has stopped 00278 fpTrack->SetStepLength( 0. ); 00279 00280 G4SelectedAtRestDoItVector& selectedAtRestDoItVector = fpState->fSelectedAtRestDoItVector; 00281 00282 // invoke selected process 00283 for(size_t np=0; np < fpProcessInfo->MAXofAtRestLoops; np++) 00284 { 00285 // 00286 // Note: DoItVector has inverse order against GetPhysIntVector 00287 // and SelectedAtRestDoItVector. 00288 // 00289 if( selectedAtRestDoItVector[fpProcessInfo->MAXofAtRestLoops-np-1] != InActivated) 00290 { 00291 fpCurrentProcess = (G4VITProcess*) (*fpProcessInfo->fpAtRestDoItVector)[np]; 00292 00293 fpCurrentProcess->SetProcessState( 00294 fpTrackingInfo->GetProcessState(fpCurrentProcess->GetProcessID())); 00295 fpParticleChange 00296 = fpCurrentProcess->AtRestDoIt( *fpTrack, *fpStep); 00297 fpCurrentProcess->SetProcessState(0); 00298 00299 // Set the current process as a process which defined this Step length 00300 fpStep->GetPostStepPoint() 00301 ->SetProcessDefinedStep(fpCurrentProcess); 00302 00303 // Update Step 00304 fpParticleChange->UpdateStepForAtRest(fpStep); 00305 00306 // Now Store the secondaries from ParticleChange to SecondaryList 00307 DealWithSecondaries(fN2ndariesAtRestDoIt) ; 00308 00309 // clear ParticleChange 00310 fpParticleChange->Clear(); 00311 00312 } //if(fSelectedAtRestDoItVector[np] != InActivated){ 00313 } //for(size_t np=0; np < MAXofAtRestLoops; np++){ 00314 fpStep->UpdateTrack(); 00315 00316 fpTrack->SetTrackStatus( fStopAndKill ); 00317 }
void G4ITStepProcessor::InvokePostStepDoItProcs | ( | ) | [protected] |
Definition at line 383 of file G4ITStepProcessor2.cc.
References ExclusivelyForced, fExclusivelyForcedProc, Forced, fPostStepDoItProc, InActivated, InvokePSDIP(), NotForced, and StronglyForced.
Referenced by DoStepping().
00384 { 00385 00386 G4SelectedPostStepDoItVector& selectedPostStepDoItVector = fpState->fSelectedPostStepDoItVector; 00387 G4StepStatus& stepStatus = fpState->fStepStatus; 00388 00389 // Invoke the specified discrete processes 00390 for(size_t np=0; np < fpProcessInfo->MAXofPostStepLoops; np++) 00391 { 00392 // 00393 // Note: DoItVector has inverse order against GetPhysIntVector 00394 // and SelectedPostStepDoItVector. 00395 // 00396 G4int Cond = selectedPostStepDoItVector[fpProcessInfo->MAXofPostStepLoops-np-1]; 00397 if(Cond != InActivated) 00398 { 00399 if( ((Cond == NotForced) && (stepStatus == fPostStepDoItProc)) || 00400 ((Cond == Forced) && (stepStatus != fExclusivelyForcedProc)) || 00401 // ((Cond == Conditionally) && (stepStatus == fAlongStepDoItProc)) || 00402 ((Cond == ExclusivelyForced) && (stepStatus == fExclusivelyForcedProc)) || 00403 ((Cond == StronglyForced) ) 00404 ) 00405 { 00406 00407 InvokePSDIP(np); 00408 } 00409 } //if(*fSelectedPostStepDoItVector(np)........ 00410 00411 // Exit from PostStepLoop if the track has been killed, 00412 // but extra treatment for processes with Strongly Forced flag 00413 if(fpTrack->GetTrackStatus() == fStopAndKill) 00414 { 00415 for(size_t np1=np+1; np1 < fpProcessInfo->MAXofPostStepLoops; np1++) 00416 { 00417 G4int Cond2 = selectedPostStepDoItVector[fpProcessInfo->MAXofPostStepLoops-np1-1]; 00418 if (Cond2 == StronglyForced) 00419 { 00420 InvokePSDIP(np1); 00421 } 00422 } 00423 break; 00424 } 00425 } //for(size_t np=0; np < MAXofPostStepLoops; np++){ 00426 }
void G4ITStepProcessor::InvokePSDIP | ( | size_t | ) | [protected] |
Definition at line 430 of file G4ITStepProcessor2.cc.
References CalculateSafety(), G4VParticleChange::Clear(), DealWithSecondaries(), G4Step::GetPostStepPoint(), G4VITProcess::GetProcessID(), G4TrackingInformation::GetProcessState(), G4VParticleChange::GetTrackStatus(), G4VProcess::PostStepDoIt(), G4VITProcess::SetProcessState(), G4StepPoint::SetSafety(), G4Track::SetTrackStatus(), G4VParticleChange::UpdateStepForPostStep(), and G4Step::UpdateTrack().
Referenced by InvokePostStepDoItProcs(), and InvokeTransportationProc().
00431 { 00432 fpCurrentProcess = (G4VITProcess*) (*fpProcessInfo->fpPostStepDoItVector)[np]; 00433 00434 fpCurrentProcess->SetProcessState(fpTrackingInfo->GetProcessState(fpCurrentProcess->GetProcessID())); 00435 fpParticleChange 00436 = fpCurrentProcess->PostStepDoIt( *fpTrack, *fpStep); 00437 fpCurrentProcess->SetProcessState(0); 00438 00439 // Update PostStepPoint of Step according to ParticleChange 00440 fpParticleChange->UpdateStepForPostStep(fpStep); 00441 00442 // Update G4Track according to ParticleChange after each PostStepDoIt 00443 fpStep->UpdateTrack(); 00444 00445 // Update safety after each invocation of PostStepDoIts 00446 fpStep->GetPostStepPoint()->SetSafety( CalculateSafety() ); 00447 00448 // Now Store the secondaries from ParticleChange to SecondaryList 00449 DealWithSecondaries(fN2ndariesPostStepDoIt) ; 00450 00451 // Set the track status according to what the process defined 00452 fpTrack->SetTrackStatus( fpParticleChange->GetTrackStatus() ); 00453 00454 // clear ParticleChange 00455 fpParticleChange->Clear(); 00456 }
void G4ITStepProcessor::InvokeTransportationProc | ( | ) | [protected] |
Definition at line 518 of file G4ITStepProcessor2.cc.
References ExclusivelyForced, fExclusivelyForcedProc, Forced, fStopAndKill, G4Track::GetTrackStatus(), InActivated, InvokePSDIP(), and StronglyForced.
Referenced by DoStepping().
00519 { 00520 size_t _MAXofPostStepLoops = fpProcessInfo->MAXofPostStepLoops; 00521 G4SelectedPostStepDoItVector& selectedPostStepDoItVector = fpState->fSelectedPostStepDoItVector; 00522 G4StepStatus& stepStatus = fpState->fStepStatus; 00523 00524 // Invoke the specified discrete processes 00525 for(size_t np=0; np < _MAXofPostStepLoops; np++) 00526 { 00527 // 00528 // Note: DoItVector has inverse order against GetPhysIntVector 00529 // and SelectedPostStepDoItVector. 00530 // 00531 G4int Cond = selectedPostStepDoItVector[_MAXofPostStepLoops-np-1]; 00532 if(Cond != InActivated) 00533 { 00534 if( 00535 ((Cond == Forced) && (stepStatus != fExclusivelyForcedProc)) || 00536 // ((Cond == Conditionally) && (stepStatus == fAlongStepDoItProc)) || 00537 ((Cond == ExclusivelyForced) && (stepStatus == fExclusivelyForcedProc)) || 00538 ((Cond == StronglyForced) ) 00539 ) 00540 { 00541 00542 InvokePSDIP(np); 00543 } 00544 } //if(*fSelectedPostStepDoItVector(np)........ 00545 00546 // Exit from PostStepLoop if the track has been killed, 00547 // but extra treatment for processes with Strongly Forced flag 00548 if(fpTrack->GetTrackStatus() == fStopAndKill) 00549 { 00550 for(size_t np1=np+1; np1 < _MAXofPostStepLoops; np1++) 00551 { 00552 G4int Cond2 = selectedPostStepDoItVector[_MAXofPostStepLoops-np1-1]; 00553 if (Cond2 == StronglyForced) 00554 { 00555 InvokePSDIP(np1); 00556 } 00557 } 00558 break; 00559 } 00560 } 00561 }
G4ITStepProcessor & G4ITStepProcessor::operator= | ( | const G4ITStepProcessor & | other | ) | [protected] |
Definition at line 218 of file G4ITStepProcessor.cc.
00219 { 00220 if (this == &rhs) return *this; // handle self assignment 00221 //assignment operator 00222 return *this; 00223 }
void G4ITStepProcessor::ResetSecondaries | ( | ) | [protected] |
Definition at line 444 of file G4ITStepProcessor.cc.
Referenced by G4ITStepProcessor(), and SetupMembers().
00445 { 00446 // Reset the secondary particles 00447 fN2ndariesAtRestDoIt = 0; 00448 fN2ndariesAlongStepDoIt = 0; 00449 fN2ndariesPostStepDoIt = 0; 00450 }
void G4ITStepProcessor::SetInitialStep | ( | ) | [protected] |
Definition at line 516 of file G4ITStepProcessor.cc.
References G4ITNavigator::CreateTouchableHistory(), fAlive, FatalException, fPostponeToNextEvent, fStopAndKill, fStopButAlive, fSuspend, fUndefined, G4cerr, G4cout, G4endl, G4Exception(), G4Track::GetCurrentStepNumber(), G4Track::GetKineticEnergy(), G4VPhysicalVolume::GetLogicalVolume(), G4Track::GetMomentumDirection(), G4Track::GetParentID(), G4Track::GetPosition(), G4VPhysicalVolume::GetRegularStructureId(), G4Track::GetTouchableHandle(), G4Track::GetTrackStatus(), G4Track::GetVolume(), G4Step::InitializeStep(), G4ITNavigator::LocateGlobalPointAndSetup(), G4ITNavigator::ResetHierarchyAndLocate(), G4Track::SetLogicalVolumeAtVertex(), G4Track::SetNextTouchableHandle(), G4Track::SetTouchableHandle(), G4Track::SetTrackStatus(), G4Track::SetVertexKineticEnergy(), G4Track::SetVertexMomentumDirection(), G4Track::SetVertexPosition(), and G4ITTrackingManager::StartTracking().
Referenced by InitDefineStep().
00517 { 00518 // DEBUG 00519 // G4cout << "SetInitialStep for : " << fpITrack-> GetName() << G4endl; 00520 //________________________________________________________ 00521 // Initialize geometry 00522 00523 00524 if ( ! fpTrack->GetTouchableHandle()) 00525 { 00526 G4ThreeVector direction= fpTrack->GetMomentumDirection(); 00527 fpNavigator->LocateGlobalPointAndSetup( fpTrack->GetPosition(), 00528 &direction, false, false ); 00529 fpState->fTouchableHandle = fpNavigator->CreateTouchableHistory(); 00530 00531 fpTrack->SetTouchableHandle( fpState->fTouchableHandle ); 00532 fpTrack->SetNextTouchableHandle( fpState->fTouchableHandle ); 00533 } 00534 else 00535 { 00536 fpState->fTouchableHandle = fpTrack->GetTouchableHandle(); 00537 fpTrack->SetNextTouchableHandle( fpState->fTouchableHandle ); 00538 G4VPhysicalVolume* oldTopVolume= fpTrack->GetTouchableHandle()->GetVolume(); 00539 G4VPhysicalVolume* newTopVolume= 00540 fpNavigator->ResetHierarchyAndLocate( fpTrack->GetPosition(), 00541 fpTrack->GetMomentumDirection(), 00542 *((G4TouchableHistory*)fpTrack->GetTouchableHandle()()) ); 00543 if(newTopVolume != oldTopVolume || oldTopVolume->GetRegularStructureId() == 1 ) 00544 { 00545 fpState->fTouchableHandle = fpNavigator->CreateTouchableHistory(); 00546 fpTrack->SetTouchableHandle( fpState->fTouchableHandle ); 00547 fpTrack->SetNextTouchableHandle( fpState->fTouchableHandle ); 00548 } 00549 } 00550 00551 fpCurrentVolume = fpState->fTouchableHandle->GetVolume(); 00552 00553 //________________________________________________________ 00554 // If the primary track has 'Suspend' or 'PostponeToNextEvent' state, 00555 // set the track state to 'Alive'. 00556 if( (fpTrack->GetTrackStatus()==fSuspend) || 00557 (fpTrack->GetTrackStatus()==fPostponeToNextEvent) ) 00558 { 00559 fpTrack->SetTrackStatus(fAlive); 00560 } 00561 00562 // If the primary track has 'zero' kinetic energy, set the track 00563 // state to 'StopButAlive'. 00564 if(fpTrack->GetKineticEnergy() <= 0.0) 00565 { 00566 fpTrack->SetTrackStatus( fStopButAlive ); 00567 } 00568 //________________________________________________________ 00569 // Set vertex information of G4Track at here 00570 if ( fpTrack->GetCurrentStepNumber() == 0 ) 00571 { 00572 fpTrack->SetVertexPosition( fpTrack->GetPosition() ); 00573 fpTrack->SetVertexMomentumDirection( fpTrack->GetMomentumDirection() ); 00574 fpTrack->SetVertexKineticEnergy( fpTrack->GetKineticEnergy() ); 00575 fpTrack->SetLogicalVolumeAtVertex( fpTrack->GetVolume()->GetLogicalVolume() ); 00576 } 00577 //________________________________________________________ 00578 // If track is already outside the world boundary, kill it 00579 if( fpCurrentVolume==0 ) 00580 { 00581 // If the track is a primary, stop processing 00582 if(fpTrack->GetParentID()==0) 00583 { 00584 G4cerr << "ERROR - G4ITStepProcessor::SetInitialStep()" << G4endl 00585 << " Primary particle starting at - " 00586 << fpTrack->GetPosition() 00587 << " - is outside of the world volume." << G4endl; 00588 G4Exception("G4ITStepProcessor::SetInitialStep()", "ITStepProcessor0011", 00589 FatalException, "Primary vertex outside of the world!"); 00590 } 00591 00592 fpTrack->SetTrackStatus( fStopAndKill ); 00593 G4cout << "WARNING - G4ITStepProcessor::SetInitialStep()" << G4endl 00594 << " Initial track position is outside world! - " 00595 << fpTrack->GetPosition() << G4endl; 00596 } 00597 else{ 00598 // Initial set up for attribues of 'Step' 00599 fpStep->InitializeStep( fpTrack ); 00600 } 00601 00602 00603 if( fpTrack->GetTrackStatus() == fStopAndKill ) return ; 00604 00605 fpTrackingManager->StartTracking(fpTrack); 00606 00607 fpState->fStepStatus = fUndefined; 00608 }
void G4ITStepProcessor::SetNavigator | ( | G4ITNavigator * | value | ) | [inline, protected] |
void G4ITStepProcessor::SetPreviousStepTime | ( | G4double | ) | [inline] |
void G4ITStepProcessor::SetStep | ( | G4Step * | val | ) | [inline] |
void G4ITStepProcessor::SetTrack | ( | G4Track * | ) | [protected] |
Definition at line 378 of file G4ITStepProcessor.cc.
References FatalErrorInArgument, G4cerr, G4endl, G4Exception(), GetIT(), GetStep(), G4Track::GetTrackID(), and G4IT::GetTrackingInfo().
Referenced by DefinePhysicalStepLength(), and Stepping().
00379 { 00380 fpTrack = track ; 00381 if(fpTrack) 00382 { 00383 fpITrack = GetIT(fpTrack) ; 00384 fpStep = const_cast<G4Step*>(fpTrack -> GetStep()); 00385 00386 if(fpITrack) 00387 { 00388 fpTrackingInfo = fpITrack->GetTrackingInfo() ; 00389 } 00390 else 00391 { 00392 fpTrackingInfo = 0; 00393 G4cerr << "Track ID : " << fpTrack->GetTrackID() << G4endl; 00394 00395 G4ExceptionDescription exceptionDescription ("No IT pointer was attached to the track you try to process."); 00396 G4Exception("G4ITStepProcessor::SetTrack","ITStepProcessor0007", 00397 FatalErrorInArgument,exceptionDescription); 00398 } 00399 } 00400 else 00401 { 00402 fpITrack = 0; 00403 fpStep = 0 ; 00404 } 00405 }
void G4ITStepProcessor::SetTrackingManager | ( | G4ITTrackingManager * | trackMan | ) | [inline] |
void G4ITStepProcessor::SetupGeneralProcessInfo | ( | G4ParticleDefinition * | , | |
G4ProcessManager * | ||||
) | [protected] |
Definition at line 277 of file G4ITStepProcessor.cc.
References G4ProcessVector::entries(), FatalErrorInArgument, FatalException, G4cerr, G4cout, G4endl, G4Exception(), G4ProcessManager::GetAlongStepProcessVector(), G4ProcessManager::GetAtRestProcessVector(), G4ParticleDefinition::GetParticleName(), G4ParticleDefinition::GetPDGEncoding(), G4ProcessManager::GetPostStepProcessVector(), typeDoIt, and typeGPIL.
Referenced by GetProcessInfo().
00279 { 00280 00281 #ifdef debug 00282 G4cout<<"G4ITStepProcessor::GetProcessNumber: is called track"<<G4endl; 00283 #endif 00284 if(!pm) 00285 { 00286 G4cerr << "ERROR - G4SteppingManager::GetProcessNumber()" << G4endl 00287 << " ProcessManager is NULL for particle = " 00288 << particle->GetParticleName() << ", PDG_code = " 00289 << particle->GetPDGEncoding() << G4endl; 00290 G4Exception("G4SteppingManager::GetProcessNumber()", "ITStepProcessor0002", 00291 FatalException, "Process Manager is not found."); 00292 return; 00293 } 00294 00295 std::map<const G4ParticleDefinition*, ProcessGeneralInfo*>::iterator it = fProcessGeneralInfoMap.find(particle); 00296 if(it != fProcessGeneralInfoMap.end()) 00297 { 00298 G4Exception("G4SteppingManager::SetupGeneralProcessInfo()", "ITStepProcessor0003", 00299 FatalException, "Process info already registered."); 00300 return; 00301 } 00302 00303 // here used as temporary 00304 fpProcessInfo = new ProcessGeneralInfo(); 00305 00306 // AtRestDoits 00307 fpProcessInfo->MAXofAtRestLoops = pm->GetAtRestProcessVector()->entries(); 00308 fpProcessInfo->fpAtRestDoItVector = pm->GetAtRestProcessVector(typeDoIt); 00309 fpProcessInfo->fpAtRestGetPhysIntVector = pm->GetAtRestProcessVector(typeGPIL); 00310 #ifdef debug 00311 G4cout << "G4ITStepProcessor::GetProcessNumber: #ofAtRest=" 00312 << fpProcessInfo->MAXofAtRestLoops << G4endl; 00313 #endif 00314 00315 // AlongStepDoits 00316 fpProcessInfo->MAXofAlongStepLoops = pm->GetAlongStepProcessVector()->entries(); 00317 fpProcessInfo->fpAlongStepDoItVector = pm->GetAlongStepProcessVector(typeDoIt); 00318 fpProcessInfo->fpAlongStepGetPhysIntVector = pm->GetAlongStepProcessVector(typeGPIL); 00319 #ifdef debug 00320 G4cout << "G4ITStepProcessor::GetProcessNumber:#ofAlongStp=" 00321 << fpProcessInfo->MAXofAlongStepLoops << G4endl; 00322 #endif 00323 00324 // PostStepDoits 00325 fpProcessInfo->MAXofPostStepLoops = pm->GetPostStepProcessVector()->entries(); 00326 fpProcessInfo->fpPostStepDoItVector = pm->GetPostStepProcessVector(typeDoIt); 00327 fpProcessInfo->fpPostStepGetPhysIntVector = pm->GetPostStepProcessVector(typeGPIL); 00328 #ifdef debug 00329 G4cout << "G4ITStepProcessor::GetProcessNumber: #ofPostStep=" 00330 << fpProcessInfo->MAXofPostStepLoops << G4endl; 00331 #endif 00332 00333 if (SizeOfSelectedDoItVector<fpProcessInfo->MAXofAtRestLoops || 00334 SizeOfSelectedDoItVector<fpProcessInfo->MAXofAlongStepLoops || 00335 SizeOfSelectedDoItVector<fpProcessInfo->MAXofPostStepLoops ) 00336 { 00337 G4cerr << "ERROR - G4ITStepProcessor::GetProcessNumber()" << G4endl 00338 << " SizeOfSelectedDoItVector= " << SizeOfSelectedDoItVector 00339 << " ; is smaller then one of MAXofAtRestLoops= " 00340 << fpProcessInfo->MAXofAtRestLoops << G4endl 00341 << " or MAXofAlongStepLoops= " << fpProcessInfo->MAXofAlongStepLoops 00342 << " or MAXofPostStepLoops= " << fpProcessInfo->MAXofPostStepLoops << G4endl; 00343 G4Exception("G4ITStepProcessor::GetProcessNumber()", 00344 "ITStepProcessor0004", FatalException, 00345 "The array size is smaller than the actual No of processes."); 00346 } 00347 00348 if(!fpProcessInfo->fpAtRestDoItVector && 00349 !fpProcessInfo->fpAlongStepDoItVector && 00350 !fpProcessInfo->fpPostStepDoItVector) 00351 { 00352 G4ExceptionDescription exceptionDescription ; 00353 exceptionDescription << "No DoIt process found " ; 00354 G4Exception("G4ITStepProcessor::DoStepping","ITStepProcessor0005", 00355 FatalErrorInArgument,exceptionDescription); 00356 return ; 00357 } 00358 00359 if(fpProcessInfo->fpAlongStepGetPhysIntVector && fpProcessInfo->MAXofAlongStepLoops>0) 00360 { 00361 fpProcessInfo->fpTransportation = dynamic_cast<G4ITTransportation*> 00362 ((*fpProcessInfo->fpAlongStepGetPhysIntVector)[fpProcessInfo->MAXofAlongStepLoops-1]); 00363 00364 if(fpProcessInfo->fpTransportation == 0) 00365 { 00366 G4ExceptionDescription exceptionDescription ; 00367 exceptionDescription << "No transportation process found " ; 00368 G4Exception("G4ITStepProcessor::SetupGeneralProcessInfo","ITStepProcessor0006", 00369 FatalErrorInArgument,exceptionDescription); 00370 } 00371 } 00372 fProcessGeneralInfoMap[particle] = fpProcessInfo; 00373 // fpProcessInfo = 0; 00374 }
void G4ITStepProcessor::SetupMembers | ( | ) | [protected] |
Definition at line 431 of file G4ITStepProcessor.cc.
References G4Step::GetfSecondary(), G4Step::GetPostStepPoint(), G4Step::GetPreStepPoint(), GetProcessInfo(), G4TrackingInformation::GetStepProcessorState(), G4IT::GetTrackingInfo(), and ResetSecondaries().
Referenced by DoStepping(), and InitDefineStep().
00432 { 00433 fpSecondary = fpStep->GetfSecondary(); 00434 fpPreStepPoint = fpStep->GetPreStepPoint(); 00435 fpPostStepPoint = fpStep->GetPostStepPoint(); 00436 00437 fpState = (G4ITStepProcessorState*) fpITrack->GetTrackingInfo()->GetStepProcessorState(); 00438 00439 GetProcessInfo(); 00440 ResetSecondaries(); 00441 }
void G4ITStepProcessor::Stepping | ( | G4Track * | , | |
const double & | ||||
) |
Definition at line 95 of file G4ITStepProcessor2.cc.
References CleanProcessor(), DoStepping(), and SetTrack().
00096 { 00097 CleanProcessor(); 00098 if(track == 0) return ; // maybe put an exception here 00099 fTimeStep = timeStep ; 00100 SetTrack(track); 00101 DoStepping(); 00102 }
void G4ITStepProcessor::UpdateTrack | ( | G4Track * | ) |