I have some problem with TGeo. I want to create a tube with several cylindric holes through it. So I create a tube and put cylinders filled with air in it as daughter volumes. The problem occurs when I want to draw this thing. I would like it to be seen as a plate with holes, but if my tube has visible daughters then only holes are drawn as cylinders but the tube is unseen, if I unset daughters then the tube with no holes is drawn.
Any idea how to solve this ?
But you won’t actually see holes… A track model would see holes as air, but visualization cannot know that you wanted holes there. If this is what you are after, you can make a composite shape subtracting the holes from the tube an use OGL viewer.
Thanks. However, I have many holes and I’m wondering what is the appropriate method to create such composite shape.
I was thinking of creating a volume assembly of holes, then get this assembly volumes shape, and then create composite shape by subtracting previous shape from TGeoTube. But this doesn’t work for me.
Is it possible to create composite shape recursively in loop ?
Adding air-filled volumes in the tube is the most efficient way to represent holes, but as I told you this just cannot be handled by visualization. If you want to make real holes, you have to make a composite shape where you subtract the hole shapes from the tube shape. You can do this using a string formula (see TGeoCompositeShape docs) or using the constructor where you provide a TGeoBoolNode. The latter you can do programatically (in a loop) if you have many holes, but nothe that this composite shape will be VERY inefficient for tracking.