Drawing geometry of a detector using opengl (aliceO2)

Hi guys, sorry to pop in so late… I cannot see the pictures you posted since they probably expired, but I suspect like Matevz that most problems come from the fact that the csg library behind cannot handle properly overlapping surfaces - typically extending the size of the subtracted volume on the side having the common surface (enlarge + shift) solves it without altering the geometry parameters. About the use of subtractions: in TGeoCompositeShape the internal representation ends up eventually to a binary tree, no matter how you describe them and will have n^2 complexity (yes, Geant will hate you and you will hate i if you use 40 components/subtraction).
Using an assembly is a bit tricky, because an assembly shape is only constructed by the assembly volume. You can however create a regular TGeoVolumeAssembly with dummy material, then use volume->GetShape() as substraction shape. I never tried it but should work… In this case your boolean solid will only have 2 components, since the assembly itself is “seen” as a single shape. It may also get a way faster in simulation, because the assembly uses regular volume optimization (voxelization).
In VecGeom we have another concept to handle this which is called multi-union: it is like an assembly shape (no material) but uses a smarter optimisation based on bounding volume hierarchies that even vectorize. This is probably 3-4 times faster that the assembly for large number of components. We don’t have this in ROOT yet, but eventually we will interface navigation with VecGeom and it will be there. Meanwhile you should try the assembly approach, I am curious how much faster raytracing goes using it. Sorry for the long blah-blah…

Hello,

Thanks a lot Andrea and all for your kind replies and comments. I will report the most relevant informations in my MFT working package to inform the other MFT geometry developers. Next I will try the combinaison of VolumeAssembly and GetShape and perform simulations to check the cpu time impact of the different solutions.
May be this discussion should lead to suggest general guidelines for developers?
Best regards, Franck.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.