-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Zero size bounding box for some TGeoVolumeAssembly nodes after transformation by translation or rotation #12242
Comments
Looking into this. There is a provision for recomputing the bounding boxes and voxel structures for hierarchies of assemblies affected by TGeoPhysicalNode::Align, I have to check what gets wrong there. |
Ok, I've had a first quick look. This is rather a feature than a bug. During alignment, some bounding boxes and voxels need to be recomputed (see the logic in TGeoPhysicalNode::Align). Since a given volume may be changed by many physical node alignments, their bounding boxes and voxels are only marked to be recomputed, otherwise the operation takes too long for complex cases. This lazy recomputation occurs only when any navigation function is called for the given volume, but not when calling just the getter of the box dimensions. So the behavior runtime should be OK, even if you see that some bounding boxes appear to be zero just after alignment. The recomputation of boxes/voxels can be however triggered manually using the following code:
I guess this code could be automatically called inside TGeoManager::RefreshPhysicalNodes() which needs to be called anyway by the user to recover pointer consistency after all alignments are applied. Let me know if this code does the job for you and I'll put it there. |
Thanks for the hint, I tested the following two cases and did not see a problem:
So I would think that your proposal would be perfect for us, as I had anyway introduced a @fuhlig1 Do you think I should also do the full test with the original error report? (= removing the fix in FairRoot + replacing the fix in Cbmroot by this block + re-running the mCBM macro) |
- cf discussion in root-project/root#12242 - Improvement of PR FairRootGroup#1244 - see also Issue FairRootGroup#1243 - Solves new sub-case of Cbmroot issue https://redmine.cbm.gsi.de/issues/2620 More generic solution also catching edge case where only Nodes inside assembly are aligned but not assembly itself
The patch is in fact working quite well and one of our users just found a case where it is needed because our original solution was too coarse. We covered it on our side (cf pinged PR on FairRoot) as our adoption of new ROOT releases is typically quite slow, but I think it would indeed be a nice feature to have it done automatically on refresh (as far as I could test it will not hurt even if for some transition period in the future we have it executed once both in ROOT and FairRoot) |
- cf discussion in root-project/root#12242 - Improvement of PR FairRootGroup#1244 - see also Issue FairRootGroup#1243 - Solves new sub-case of Cbmroot issue https://redmine.cbm.gsi.de/issues/2620 More generic solution also catching edge case where only Nodes inside assembly are aligned but not assembly itself
- cf discussion in root-project/root#12242 - Improvement of PR FairRootGroup#1244 - see also Issue FairRootGroup#1243 - Solves new sub-case of Cbmroot issue https://redmine.cbm.gsi.de/issues/2620 More generic solution also catching edge case where only Nodes inside assembly are aligned but not assembly itself
- cf discussion in root-project/root#12242 - Improvement of PR FairRootGroup#1244 - see also Issue FairRootGroup#1243 - Solves new sub-case of Cbmroot issue https://redmine.cbm.gsi.de/issues/2620 More generic solution also catching edge case where only Nodes inside assembly are aligned but not assembly itself (cherry picked from commit b4b5f0e)
- cf discussion in root-project/root#12242 - Improvement of PR FairRootGroup#1244 - see also Issue FairRootGroup#1243 - Solves new sub-case of Cbmroot issue https://redmine.cbm.gsi.de/issues/2620 More generic solution also catching edge case where only Nodes inside assembly are aligned but not assembly itself (cherry picked from commit b4b5f0e)
- cf discussion in root-project/root#12242 - Improvement of PR FairRootGroup#1244 - see also Issue FairRootGroup#1243 - Solves new sub-case of Cbmroot issue https://redmine.cbm.gsi.de/issues/2620 More generic solution also catching edge case where only Nodes inside assembly are aligned but not assembly itself (cherry picked from commit b4b5f0e)
- cf discussion in root-project/root#12242 - Improvement of PR #1244 - see also Issue #1243 - Solves new sub-case of Cbmroot issue https://redmine.cbm.gsi.de/issues/2620 More generic solution also catching edge case where only Nodes inside assembly are aligned but not assembly itself (cherry picked from commit b4b5f0e)
- cf discussion in root-project/root#12242 - Improvement of PR #1244 - see also Issue #1243 - Solves new sub-case of Cbmroot issue https://redmine.cbm.gsi.de/issues/2620 More generic solution also catching edge case where only Nodes inside assembly are aligned but not assembly itself (cherry picked from commit b4b5f0e)
Hi @agheata, It appears this issue is closed, but wasn't yet added to a project. Please add upcoming versions that will include the fix, or 'not applicable' otherwise. Sincerely, |
=> Maybe linked/similar to https://sft.its.cern.ch/jira/browse/ROOT-7420 ? (Zero size BBox after using AddNode)
Describe the bug
After a translation/rotation is applied to a TGeoVolumeAssembly through the
MakePhysicalNode > Align
sequence, the BoundingBox of this TGeoVolumeAssembly may end up with 0 size (GetDX, GetDY and GetDZ returning 0).This is not expected as it means there are other effects on the Volume aside from the translation/rotation, even when shifting something without leaving its parent volume.
Something similar happens if a translation/rotation is applied to a Node which is part of a TGeoVolumeAssembly, but there it probably happens only if the changes leads to part of the assembly exceeding the original boundaries.
We (me and @fuhlig1) suspect that this may partially be recursive (affecting the parent of the aligned volume).
This can be cured by forcing the recomputation of the BoundingBox of the affected Volume.
Expected behavior
After alignment of the nodes, all volumes/nodes are offset/rotated with their other properties valid.
Or if not possible due to performance, a warning should be printout with hint of the proper way to restore/recompute these values.
A temporary fix was introduced for now in FairRoot, which is to simply do the recompute for all TGeoVolumeAssembly in the geometry tree, which seems to be fast enough that we do not have to try to track affected Volumes to be more selective.
This may however not be the case later when applied to complete geometries for experiments like CBM.
To Reproduce
Steps to reproduce the behavior with the attached files (includes "ROOT-only" examples both for problem and for macro-level fix):
Of the 3 transformations visible in the printout
/cave_1/sts_v22e_mcbm_0
and/cave_1/sts_v22e_mcbm_0/Station01_1
)/cave_1/sts_v22e_mcbm_0/Station02_2/Ladder10_2/HalfLadder10d_2/HalfLadder10d_Module04_2
)Setup
Additional context
gGeoManager->CloseGeometry();
instead of the fix used in FairRoot (as advised in ROOT-7420 for the AddNode case) does not cure the problem and results in a warning that the geometry is already closedThe text was updated successfully, but these errors were encountered: