Skip to content
Snippets Groups Projects
Commit 7f2897ec authored by Mihaly Novak's avatar Mihaly Novak
Browse files

Set the proper SD code pointer even in the case of zero energy deposit in a Woodcock step.

This will fix the problem reported with calibration runs at https://its.cern.ch/jira/browse/ATLASSIM-6923.
Calibration SD codes are also invoked in case of zero energy deposit, i.e. when a photon ends up on the
boundary. However, we did not bother to set the proper SD code pointer in such cases when doing Woodcock
tracking as normal SD codes are not invoked (early return). This should affact only the clibration but
not the normal runs.
parent 84d7877b
No related branches found
No related tags found
No related merge requests found
......@@ -299,6 +299,9 @@ G4WoodcockProcess::PostStepGetPhysicalInteractionLength(const G4Track& track, G4
// set the touchable (while relative not). That touchable will be used then for possible secondaries.
G4TransportationManager::GetTransportationManager()->GetNavigatorForTracking()->LocateGlobalPointAndUpdateTouchableHandle(track.GetPosition(), track.GetMomentumDirection(), const_cast<G4TouchableHandle&>(track.GetTouchableHandle()), false);
theTrack.GetStep()->GetPreStepPoint()->SetTouchableHandle(track.GetTouchableHandle());
// note: some (special) SD codes might be called even in case of zero energy deposit so set the SD pointer in all cases
G4LogicalVolume* postStepLogVol = track.GetTouchableHandle()->GetVolume()->GetLogicalVolume();
track.GetStep()->GetPreStepPoint()->SetSensitiveDetector(postStepLogVol->GetSensitiveDetector());
// Check if the post-step point is actually outside: physically inside for sure (i.e. distance to
// boundary along the current direction is at least 1E-3 >> kCarTolerance(1E-9)/2) but might be
// closer to the boundary than kCarTolerance/2 (i.e. we move almost parallel to the boundary)
......@@ -308,10 +311,8 @@ G4WoodcockProcess::PostStepGetPhysicalInteractionLength(const G4Track& track, G4
// - the current material-cuts couple (used in the DoIt) and the SD code (not used in this but the
// next step) need to be set
// - the next step will be (outside of the WDCK region) a normal gamma-general like step
G4LogicalVolume* postStepLogVol = track.GetTouchableHandle()->GetVolume()->GetLogicalVolume();
if ( fWDCKRegion != postStepLogVol->GetRegion() ) {
fOnWDCKRegionBoundary = true;
track.GetStep()->GetPreStepPoint()->SetSensitiveDetector(postStepLogVol->GetSensitiveDetector());
// note: need to be clear in the next step to trigger a reset (re-evaluation of mx-sec) in the gamma-general like
// step limit computation that will happen in the next step (i.e. below)
currentCouple = postStepLogVol->GetMaterialCutsCouple();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment