rat-pac / ratpac-two

Open source edition of RAT-PAC
Other
11 stars 23 forks source link

Add ability to export simulation geometry to GDML/JSON #122

Closed JamesJieranShen closed 5 months ago

JamesJieranShen commented 6 months ago

This PR adds the capability for RAT-PAC to serialize and export its own simulation geometries and ratdb content so that they can be ingested by another program (for example, chroma).

The overall geometry, material properties (as seen in Geant4 during simulation) are written to a GDML file. We have copied over Geant4's GDMLWrite directories and extended it to account for RAT's custom solids (namely GLG4TorusStack), as well as extending the optical properties written (namely the dichroic surface properties).

The entirety of the ratDB content is dumped into a single file, containing database entries as separate JSON entities. Note that the dump currently only supports static tables located under the ratdb directory, but not entries grabbed from an online database instance. This file is barely needed since material properties are mostly written into GDML. The only use for it in chroma at the moment is to retrieve the PMT channel information.