u-solids: new geometrical primitives library for geant4 and root marek gayer cern physics department...
TRANSCRIPT
U-Solids: new geometrical primitives library for Geant4
and ROOT
U-Solids: new geometrical primitives library for Geant4
and ROOTMarek Gayer
CERN Physics Department (PH)
Group Software Development for Experiments (SFT)
Introduction, motivationIntroduction, motivation
Two geometry modellers in ROOT and Geant4
Solids are 80% of maintenance effort in geometry modeller
Consolidate algorithms into a single, new U-Solids library
Introduce few new solid shapes Optimized, adapted to new architectures
04/19/23 2
Solids to be implementedSolids to be implemented
Union of all solids from Geant4 and ROOT– Simple solids (e.g. box, tube, cone, trapezoid) -
mostly ported from the existing implementation, used to provide an initial set for tests within the new library
– Complex existing solids (e.g. polycone, extruded polygone) - to be consolidated in the new library (one of the priorities)
New solids to optimize existing use cases: union of many solids using voxelization techniques
The ordering of implementation is to be decided.
304/19/23
Currently implemented solidsCurrently implemented solids
For the start, the simplest shapes were selected
Box, Orb (done), Trapezoid (ongoing)
04/19/23 4
Navigation functionality and library services for each solid
Navigation functionality and library services for each solid
Performance critical methods:
– Location of point either inside, outside or on surface
– Shortest distance to surface for outside points
– Shortest distance to surface for inside points
– Distance to surface for inside points with given direction
– Distance to surface for outside points with given direction
– Normal vector for closest surface from given point
Additional methods: Bounding Box, Capacity, Volume,
Generating points on surface/edge/inside of solid, Creating mesh for visualization …
504/19/23
Criteria of inclusion of new and existing codes from Geant4, ROOT
Criteria of inclusion of new and existing codes from Geant4, ROOT
Validity of returned results Performance Readability, simplicity of algorithm Possibility of easy vectorization Caution about not introducing new
errors
04/19/23 6
Suite of testsSuite of tests
U-Solids codes should pass:
– Optical test
– Solid Batch Test (SBT)Original geometry and voxel testsResults comparison testPerformance test
– ROOT tests (Todo)
04/19/23 7
Optical EscapeOptical Escape
Optical photon is generated inside solid Repeatedly bounces from inner surface Particle must not escape the solid
04/19/23 8
Solids Batch Test (SBT) geometry and voxel testsSolids Batch Test (SBT) geometry and voxel tests
Random points test (groups of inside, outside and surface points)
Various distance type methods are tested by numerous checks
E.g. for each inside random point p, SafetyFromInside(p) must be > 0
It also tests random voxels with random inside points
04/19/23 9
Solids Batch Test (SBT) performance and results comparison tests
Solids Batch Test (SBT) performance and results comparison tests
Attempt to compare performance of Geant4, ROOT and new U-Solids
Similar performance as one indicator of correct implementation of new methods
Also, values and their differences from different codes can be compared
Plots are used for quick evaluation Work in progress Todo: port and measure in Linux
1004/19/23
Example plot: performance testExample plot: performance test
1104/19/23 Note: preliminary results, to be validated on Linux with standard compilation flags
Example plot: Results comparison testExample plot: Results comparison test
1204/19/23
Example plot: Results comparison testExample plot: Results comparison test
1304/19/23
Example plot: Normal vectorsExample plot: Normal vectors
1404/19/23
Example plot: Normal vectorsExample plot: Normal vectors
1504/19/23
Example plot: Normal vectorsExample plot: Normal vectors
1604/19/23
Future workFuture work
Tests consolidation Finish trapezoid based on test results From other simple solids up to the more
complex ones Continue work on union of many solids Polycone is very often used and has
room for improvement
04/19/23 17
AcknowledgmentAcknowledgment
Part of AIDA project, coordinated by Gabriele Cosmo
Definition / steering in collaboration with Andrei Gheata and John Apostolakis
Other contributors:– Jean-Marie Guyader - Multi-union
implementation (summer student)– Tatiana Nikitina - Geant4 integration and
testing
1804/19/23
1904/19/23
Thank you for your attention.Thank you for your attention.
???Do you have any questions ?