| 202 | } |
| 203 | |
| 204 | void 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 | |
| 241 | G4int G4StackManager::PrepareNewEvent(G4Event* currentEvent) |
| 242 | { |
no test coverage detected