-
Notifications
You must be signed in to change notification settings - Fork 173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: DetectorVolume containment check #2895
fix: DetectorVolume containment check #2895
Conversation
Forgot to add. The number of segments for polyhedronRepresentation is hardcoded to be 1k. The default option of 1 didn't work with cylindrical shapes on more complex side -- the Extent that was returned for what I think was a barrel/endcap had big enough errors in phi/radius for the check to fail |
Moved the check inside the DetectorVolumeFactory::construct(). The one that takes the surfaces and subvolumes. Also, made the number of polyhedron segments a parameter with a default value |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2895 +/- ##
==========================================
- Coverage 48.84% 48.84% -0.01%
==========================================
Files 492 492
Lines 28846 28861 +15
Branches 13677 13685 +8
==========================================
+ Hits 14091 14096 +5
- Misses 4949 4955 +6
- Partials 9806 9810 +4 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few comments.
Made minor adjustments to the geometry inside the DD4hep Cylindrical Detector test |
…gBox implementation to the parent class
📊: Physics performance monitoring for e147aa2physmon summary
|
@asalzburger, looks like it is still waiting for your approval |
@asalzburger, Just a reminder that the policy-bot is still waiting for the approval |
we need a codecov overwrite here @asalzburger @paulgessinger |
The PR makes changes to the DetectorVolume code that address the issue of the surfaces/subvolumes containment checks, i.e. making sure that they are fully inside the volume. Additionally, minor fixes are made in the Json-related parts of the code (see below). DetectorVolume checkContainment call is moved from the constructor to the end of the "construct" method, where the volume's portals are initialized. Because the containment checks rely on the volume having the initialized Extent and the Extent is derived from the volume's portals, keeping the call in the constructor prevents the proper check from happening, as there are yet no portals to derive the Extent from. Additionally, assert is replaced with invalid_argument thrown in case the internals are not contained. To check the compatibility of the external and internal extents a new "canonicalBinning" method is introduced to the VolumeBounds. It returns the binning values that should be enough to describe the relevant parts of the Extent for a given volume shape, e.g. X,Y,Z bins are returned for cubic volumes, as, for example, there is no reason to check the binMag. Some of the VolumeBounds return the bounding box binning for now as a placeholder. A UnitTest is added to the DetectorVolumeTests that checks incompatibility with internals that are not contained. A minor fixes had to be introduced to DetectorJsonConverter with respect to the geometry parameters. In Transform3 Json writer the default option "transpose" is changed to be false to be consistent with the default reading options.
The PR makes changes to the DetectorVolume code that address the issue of the surfaces/subvolumes containment checks, i.e. making sure that they are fully inside the volume. Additionally, minor fixes are made in the Json-related parts of the code (see below). DetectorVolume checkContainment call is moved from the constructor to the end of the "construct" method, where the volume's portals are initialized. Because the containment checks rely on the volume having the initialized Extent and the Extent is derived from the volume's portals, keeping the call in the constructor prevents the proper check from happening, as there are yet no portals to derive the Extent from. Additionally, assert is replaced with invalid_argument thrown in case the internals are not contained. To check the compatibility of the external and internal extents a new "canonicalBinning" method is introduced to the VolumeBounds. It returns the binning values that should be enough to describe the relevant parts of the Extent for a given volume shape, e.g. X,Y,Z bins are returned for cubic volumes, as, for example, there is no reason to check the binMag. Some of the VolumeBounds return the bounding box binning for now as a placeholder. A UnitTest is added to the DetectorVolumeTests that checks incompatibility with internals that are not contained. A minor fixes had to be introduced to DetectorJsonConverter with respect to the geometry parameters. In Transform3 Json writer the default option "transpose" is changed to be false to be consistent with the default reading options.
The PR makes changes to the DetectorVolume code that address the issue of the surfaces/subvolumes containment checks, i.e. making sure that they are fully inside the volume. Additionally, minor fixes are made in the Json-related parts of the code (see below). DetectorVolume checkContainment call is moved from the constructor to the end of the "construct" method, where the volume's portals are initialized. Because the containment checks rely on the volume having the initialized Extent and the Extent is derived from the volume's portals, keeping the call in the constructor prevents the proper check from happening, as there are yet no portals to derive the Extent from. Additionally, assert is replaced with invalid_argument thrown in case the internals are not contained. To check the compatibility of the external and internal extents a new "canonicalBinning" method is introduced to the VolumeBounds. It returns the binning values that should be enough to describe the relevant parts of the Extent for a given volume shape, e.g. X,Y,Z bins are returned for cubic volumes, as, for example, there is no reason to check the binMag. Some of the VolumeBounds return the bounding box binning for now as a placeholder. A UnitTest is added to the DetectorVolumeTests that checks incompatibility with internals that are not contained. A minor fixes had to be introduced to DetectorJsonConverter with respect to the geometry parameters. In Transform3 Json writer the default option "transpose" is changed to be false to be consistent with the default reading options.
The PR makes changes to the DetectorVolume code that address the issue of the surfaces/subvolumes containment checks, i.e. making sure that they are fully inside the volume. Additionally, minor fixes are made in the Json-related parts of the code (see below).
DetectorVolume checkContainment call is moved from the constructor to the end of the "construct" method, where the volume's portals are initialized. Because the containment checks rely on the volume having the initialized Extent and the Extent is derived from the volume's portals, keeping the call in the constructor prevents the proper check from happening, as there are yet no portals to derive the Extent from. Additionally, assert is replaced with invalid_argument thrown in case the internals are not contained.
To check the compatibility of the external and internal extents a new "canonicalBinning" method is introduced to the VolumeBounds. It returns the binning values that should be enough to describe the relevant parts of the Extent for a given volume shape, e.g. X,Y,Z bins are returned for cubic volumes, as, for example, there is no reason to check the binMag. Some of the VolumeBounds return the bounding box binning for now as a placeholder.
A UnitTest is added to the DetectorVolumeTests that checks incompatibility with internals that are not contained.
A minor fixes had to be introduced to DetectorJsonConverter with respect to the geometry parameters.
In Transform3 Json writer the default option "transpose" is changed to be false to be consistent with the default reading options.