Would anyone have any recommendations for the best way to simulate a cylindrical volume that would have a cross-section where the corners are rounded (a bulletized germanium detector)? I’m attempting to upload a picture that clarifies the volume I’m referring to. I’ve tried combining G4Tubs with G4Torus in a G4UnionSolid and subtracting the part of the torus that extrudes above the cylinder face, and at one point I tried something similar with a hemisphere, but nothing seems to work well.
The detector has been constructed as a union of a polycone and a torus.
The hole has been defined as a cylinder and a hemisphere placed in the detector as daughter volumes.
The solution that Evgueni provided is probably the quickest and most satisfocary response for your question. But I’d like to point out the existence of the GDML Workbench which allows FreeCAD CAD documents to be exported as GDML files, which can then be imported into geant: https://github.com/KeithSloan/GDML
One facility that the GDML Workbenh provides is the ability to take a drawing in a 2D plane and to generate a 3D solid by revolving the drawing around some axis. The figures below show (1) a 2D sketch, (2) the sketch revolved around the z-axis and (3) the document exported and displayed by a geant application that reads gdml files.
(Note that revolved object is exported as a genericPolycone in the gdml file). I can send you the generated file if you wish.
As I said, for your relatively simple case, coding the detector in C++ as Evgueni did is perfectly acceptable. But if you have a much more complicated geometry with multiple elements, including perhaps arrays of solids, then you might want to consider the capabilities of the GDML Workbench.