195 fIsTrackingTime =
true;
198 fParallelWorldNavigators .clear();
199 fParallelWorldNavigatorIndeces.clear();
200 fParallelWorldSafeties .clear();
201 fParallelWorldIsLimiting .clear();
202 fParallelWorldWasLimiting .clear();
203 fCurrentVolumes .clear();
204 fPreviousVolumes .clear();
205 for (
auto parallelWorld : fParallelWorlds )
207 fParallelWorldNavigators .push_back( fTransportationManager->
GetNavigator( parallelWorld ) );
208 fParallelWorldNavigatorIndeces.push_back( fTransportationManager->
ActivateNavigator( fParallelWorldNavigators.back() ) );
209 fParallelWorldSafeties .push_back( 0.0 );
210 fParallelWorldIsLimiting .push_back(
false );
211 fParallelWorldWasLimiting .push_back(
false );
216 for (
auto navigatorIndex : fParallelWorldNavigatorIndeces )
218 fPreviousVolumes.push_back(
nullptr );
219 fCurrentVolumes .push_back( fPathFinder->
GetLocatedVolume( navigatorIndex ) );
223 fParallelWorldSafety = 0.0;
224 for (
size_t i = 0 ; i < fParallelWorldNavigatorIndeces.size() ; i++ ) fParallelWorldSafeties[i] = 0.0;
269 if (!endTrack_G4MT_TLS_) endTrack_G4MT_TLS_ =
new G4FieldTrack (
'0') ;
273 if (!eLimited_G4MT_TLS_) eLimited_G4MT_TLS_ =
new ELimited ;
274 ELimited &eLimited = *eLimited_G4MT_TLS_;
280 if ( previousStepSize > 0.0 )
282 for (
auto& parallelWorldSafety : fParallelWorldSafeties )
284 parallelWorldSafety -= previousStepSize;
285 if ( parallelWorldSafety < 0. ) parallelWorldSafety = 0.0;
286 fParallelWorldSafety = parallelWorldSafety < fParallelWorldSafety ? parallelWorldSafety : fParallelWorldSafety ;
294 if ( ( currentMinimumStep <= fParallelWorldSafety ) && ( currentMinimumStep > 0. ) )
298 returnedStep = currentMinimumStep;
299 proposedSafety = fParallelWorldSafety - currentMinimumStep;
304 G4double smallestReturnedStep = -1.0;
306 for (
size_t i = 0 ; i < fParallelWorldNavigatorIndeces.size() ; i++ )
309 if ( currentMinimumStep >= fParallelWorldSafeties[i] )
314 fParallelWorldNavigatorIndeces[i],
316 fParallelWorldSafeties[i],
321 if ( ( smallestReturnedStep < 0.0 ) || ( tmpReturnedStep <= smallestReturnedStep ) )
323 smallestReturnedStep = tmpReturnedStep;
324 eLimitedForSmallestStep = eLimited;
330 fParallelWorldSafeties[i] = fParallelWorldNavigators[i]->ComputeSafety(endTrack.
GetPosition());
331 fParallelWorldIsLimiting[i] =
false;
335 fParallelWorldIsLimiting[i] =
true;
340 fParallelWorldSafety = fParallelWorldSafeties[i] < fParallelWorldSafety ? fParallelWorldSafeties[i] : fParallelWorldSafety ;
345 if ( eLimitedForSmallestStep ==
kDoNot )
347 returnedStep = currentMinimumStep;
350 if ( eLimitedForSmallestStep ==
kUnique ||
354 returnedStep = smallestReturnedStep;
358 returnedStep = smallestReturnedStep* (1.0 + 1.0e-9);
362 proposedSafety = fParallelWorldSafety ;
virtual void Initialize(const G4Track &track)
const G4String & GetParticleName() const
G4double ComputeStep(const G4FieldTrack &pFieldTrack, G4double pCurrentProposedStepLength, G4int navigatorId, G4int stepNo, G4double &pNewSafety, ELimited &limitedStep, G4FieldTrack &EndState, G4VPhysicalVolume *currentVolume)