| 85 | } |
| 86 | |
| 87 | G4int G4StackManager:: |
| 88 | PushOneTrack(G4Track* newTrack, G4VTrajectory* newTrajectory) |
| 89 | { |
| 90 | DefineDefaultClassification( newTrack ); |
| 91 | G4ClassificationOfNewTrack classification = fDefaultClassification; |
| 92 | if(userStackingAction!=nullptr) |
| 93 | { |
| 94 | classification = userStackingAction->ClassifyNewTrack( newTrack ); |
| 95 | if(classification != fDefaultClassification) |
| 96 | { |
| 97 | if(fExceptionSeverity!=G4ExceptionSeverity::IgnoreTheIssue) |
| 98 | { |
| 99 | G4ExceptionDescription ed; |
| 100 | ed << "UserStackingAction has changed the track classification from " |
| 101 | << fDefaultClassification << " to " << classification << ". "; |
| 102 | G4Exception("G4StackManager::PushOneTrack","Event10052", |
| 103 | fExceptionSeverity,ed); |
| 104 | } |
| 105 | } |
| 106 | } |
| 107 | if(newTrack->GetTrackStatus() == fSuspendAndWait && classification > 0) |
| 108 | // to avoid this track sent to Waiting stack again |
| 109 | { newTrack->SetTrackStatus( fSuspend ); } |
| 110 | |
| 111 | #ifdef G4VERBOSE |
| 112 | if( verboseLevel > 1 ) |
| 113 | { |
| 114 | G4cout << "### Storing a track (" |
| 115 | << newTrack->GetParticleDefinition()->GetParticleName() |
| 116 | << ",trackID=" << newTrack->GetTrackID() |
| 117 | << ",parentID=" << newTrack->GetParentID() << ") "; |
| 118 | if(newTrack->GetParentID()==0) |
| 119 | { G4cout << "created by a primary particle generator "; } |
| 120 | else |
| 121 | { |
| 122 | const G4VProcess* vp = newTrack->GetCreatorProcess(); |
| 123 | if(vp != nullptr) |
| 124 | { G4cout << "created by " << vp->GetProcessName() << " "; } |
| 125 | else |
| 126 | { G4cout << "creaded by unknown process "; } |
| 127 | } |
| 128 | G4cout << "into stack #" << classification << G4endl; |
| 129 | } |
| 130 | #endif |
| 131 | G4StackedTrack newStackedTrack( newTrack, newTrajectory ); |
| 132 | SortOut(newStackedTrack,classification); |
| 133 | |
| 134 | return GetNUrgentTrack(); |
| 135 | } |
| 136 | |
| 137 | G4Track* G4StackManager::PopNextTrack(G4VTrajectory** newTrajectory) |
| 138 | { |
nothing calls this directly
no test coverage detected