Skip to content

Commit

Permalink
fix: Fail wrapping in case of overlap (#1090)
Browse files Browse the repository at this point in the history
It was notice in the building of the ATLAS tracking geometry that if two volumes overlap then the wrapping won't do anything but will also not return any error. This PR add a throw in case of overlapping volumes.
  • Loading branch information
Corentin-Allaire committed Nov 30, 2021
1 parent b693476 commit c700e6a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Core/include/Acts/Geometry/CylinderVolumeBuilder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,15 @@ struct WrappingConfig {
// set the Central Wrapping
wCondition = CentralWrapping;
wConditionScreen = "[centrally inserted]";
} else if ((existingVolumeConfig.rMax > containerVolumeConfig.rMin &&
existingVolumeConfig.rMin < containerVolumeConfig.rMin) ||
(existingVolumeConfig.rMax > containerVolumeConfig.rMax &&
existingVolumeConfig.rMin < containerVolumeConfig.rMax)) {
// The volumes are overlapping this shouldn't be happening return an
// error
throw std::invalid_argument(
"Volumes are overlapping, this shouldn't be happening. Please "
"check your geometry building.");
}

// check if gaps are needed
Expand Down

0 comments on commit c700e6a

Please sign in to comment.