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

Method SortOut

source/event/src/G4StackManager.cc:311–378  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

309}
310
311void G4StackManager::SortOut(G4StackedTrack& aStackedTrack, G4ClassificationOfNewTrack classification)
312{
313 if(classification==fKill) // delete the without stacking
314 {
315 G4Track* newTrack = aStackedTrack.GetTrack();
316 G4VTrajectory* newTrajectory = aStackedTrack.GetTrajectory();
317#ifdef G4VERBOSE
318 if( verboseLevel > 1 )
319 {
320 G4cout << " ---> G4Track " << newTrack << " (trackID "
321 << newTrack->GetTrackID() << ", parentID "
322 << newTrack->GetParentID() << ") is not to be stored." << G4endl;
323 }
324#endif
325 delete newTrack;
326 delete newTrajectory;
327 }
328 else
329 {
330 switch (classification)
331 {
332 case fUrgent:
333 urgentStack->PushToStack( aStackedTrack );
334 break;
335 case fWaiting:
336 waitingStack->PushToStack( aStackedTrack );
337 break;
338 case fPostpone:
339 postponeStack->PushToStack( aStackedTrack );
340 break;
341 default:
342 if(classification < 100)
343 {
344 // pushing to additional waiting stack
345 G4int i = classification - 10;
346 if(i<1 || i>numberOfAdditionalWaitingStacks)
347 {
348 G4ExceptionDescription ED;
349 ED << "invalid classification " << classification << G4endl;
350 G4Exception("G4StackManager::SortOut", "Event0051",
351 FatalException,ED);
352 }
353 else
354 {
355 additionalWaitingStacks[i-1]->PushToStack( aStackedTrack );
356 }
357 }
358 else
359 {
360 // pushing to sub-event stack
361 G4int ty = classification - 100;
362 auto ses = subEvtStackMap.find(ty);
363 if(ses==subEvtStackMap.end())
364 {
365 G4ExceptionDescription ED;
366 ED << "invalid classification " << classification << G4endl;
367 G4Exception("G4StackManager::SortOut", "Event0051",
368 FatalException,ED);

Callers

nothing calls this directly

Calls 8

G4ExceptionFunction · 0.85
GetTrajectoryMethod · 0.80
GetTrackMethod · 0.45
GetTrackIDMethod · 0.45
GetParentIDMethod · 0.45
PushToStackMethod · 0.45
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected