190 likes | 293 Views
U-Solids: new geometrical primitives library for Geant4 and ROOT. Marek Gayer CERN Physics Department (PH) Group Software Development for Experiments (SFT). Introduction, motivation.
E N D
U-Solids: new geometrical primitives library for Geant4 and ROOT Marek Gayer CERN Physics Department (PH) Group Software Development for Experiments(SFT)
Introduction, 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
Solids 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.
Currently implemented solids • For the start, the simplest shapes were selected • Box, Orb (done), Trapezoid (ongoing)
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 …
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
Suite of tests • U-Solids codes should pass: • Optical test • Solid Batch Test (SBT) • Original geometry and voxel tests • Results comparison test • Performance test • ROOT tests (Todo)
Optical Escape • Optical photon is generated inside solid • Repeatedly bounces from inner surface • Particle must not escape the solid
Solids 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
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
Example plot: performance test Note: preliminary results, to be validated on Linux with standard compilation flags
Future 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
Acknowledgment • 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
Thank you for your attention. ??? Do you have any questions ?