CAD to GEANT4 Notes

This page is really outdated, and here just for legacy.

The GEMC project will be using CADMesh, from GitHub , which looks really good, but I haven't tried it yet.

The old page at CERN (CAD and GEANT4) has not been updated since 1995.

It seems that the direct way to convert a CAD file (through some intermediate format) to GEANT4 is to use a tesselated geometry in GEANT4. This is OK for parts of the detector that do not see a lot of particles. It will lead to a very slow simulation for those parts of the detector that do see a lot of particles or particle showers, see also CAD-GDML document.

Methods I found:

  1. CadMesh - Also see their article: arXiv:1105.0963 -- Open Source project. This uses the G4TessellatedSolid method, and directly loads the CAD file without intermediate.
  2. CSR - Goes with a Python macro from FreeCad to CadMesh, and then to GEANT4.
  3. FastRad - Commercial product suite, runs on Windows only. No clue how it really works, though the FAQ seems to indicate that is also uses tessellation, and then allows the user to superimpose some GEANT4 primitive objects on top.
  4. GEANT4 G4GDMLParser - will read in a STEP file and create a tessellated volume.
  5. inline G4LogicalVolume* ParseST(const G4String& name,
    G4Material* medium,
    G4Material* solid);
    //
    // Imports a tessellated geometry stored as STEP-Tools files
    // 'name.geom' and 'name.tree'. It returns a pointer of a generated
    // mother volume with 'medium' material associated, including the
    // imported tessellated geometry with 'solid' material associated.

  6. GSI - Catia - GDML converter -- Link has a nice poster showing the difficulties of converting. Associated paper here. Approach seems to be a set of tools for CATIA, which allows one to build GEANT4 compatible models using CATIA.
  7. Solveering - STL to GDML Conversion -Creative Commons License -- Converts a STEP file to GDML which can then be used by GEANT4.Uses tessellated objects.
  8. FreeCAD-GDML (http://cad-gdml.in2p3.fr) -- new development (2012).

 

GEANT4 to CAD

Until 2012, I had not come across any package that will go the other way, or some package that reads a GDML file and converts it to CAD. This would be useful for verifying a GEANT4 model build from GEANT4 primitives, which can then be checked in a CAD program and perhaps expanded using the tessellated solids. A new effort at IN2P3 in France is trying to accomplish this, see their website: CAD-GDML (http://cad-gdml.in2p3.fr) They are developing exactly what would be the most useful for everyone, a GDML module for FreeCad. I haven't had a chance to test this yet, but it looks very promising.

My old comment: "Anyone really good with AutoLisp should be able to create this? Or perhaps create a GDML input/output module for FreeCad?" is no longer needed!