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

Method ReClassify

source/event/src/G4StackManager.cc:204–239  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

202}
203
204void G4StackManager::ReClassify()
205{
206 G4StackedTrack aStackedTrack;
207 G4TrackStack tmpStack;
208
209 if( userStackingAction == nullptr ) return;
210 if( GetNUrgentTrack() == 0 ) return;
211
212 urgentStack->TransferTo(&tmpStack);
213 while( tmpStack.GetNTrack() > 0 )
214 {
215 aStackedTrack=tmpStack.PopFromStack();
216 DefineDefaultClassification( aStackedTrack.GetTrack() );
217 G4ClassificationOfNewTrack classification = fDefaultClassification;
218 if(userStackingAction!=nullptr)
219 {
220 classification = userStackingAction->ClassifyNewTrack( aStackedTrack.GetTrack() );
221 if(classification != fDefaultClassification)
222 {
223 if(fExceptionSeverity!=G4ExceptionSeverity::IgnoreTheIssue)
224 {
225 G4ExceptionDescription ed;
226 ed << "UserStackingAction has changed the track classification from "
227 << fDefaultClassification << " to " << classification << ". ";
228 G4Exception("G4StackManager::PushOneTrack","Event10052",
229 fExceptionSeverity,ed);
230 }
231 }
232 }
233 if(aStackedTrack.GetTrack()->GetTrackStatus() == fSuspendAndWait && classification > 0)
234 // to avoid this track sent to Waiting stack again
235 { aStackedTrack.GetTrack()->SetTrackStatus( fSuspend ); }
236
237 SortOut(aStackedTrack,classification);
238 }
239}
240
241G4int G4StackManager::PrepareNewEvent(G4Event* currentEvent)
242{

Callers 4

NewStageMethod · 0.80
NewStageMethod · 0.80
NewStageMethod · 0.80
NewStageMethod · 0.80

Calls 7

G4ExceptionFunction · 0.85
GetTrackStatusMethod · 0.80
TransferToMethod · 0.45
GetNTrackMethod · 0.45
PopFromStackMethod · 0.45
GetTrackMethod · 0.45
ClassifyNewTrackMethod · 0.45

Tested by

no test coverage detected