I recently go back to GEANT4 simulation. To simulate the gamma spectrum of the high-purity Germanium (HPGe) Clover detector.

The code is in here: https://github.com/goluckyryan/HPGeClover

Here are some visualizations

The simulated setup for the 16N isomer ration determination. The simulation generate all possible gamma ray energy. We can see a lot of 120 keV gamma being stopped by the vacuum pipe.

The simulation for the 16N isomer decay at the center is like

the simulation caught all feature, but the intensity of the double escape peak from the 6130 keV peak is smaller than the experiment. And the peak to Compton scattering background is different.

Since the strength of the escape peaks are very sensitive to the position and geometry of the crystal, the simulation condition need to be adjusted.


Here is the program structure. This is also a generic program structure.

comments or to do for the code

  • is there a way to get number of clover at EventAction ? I tried to use the G4LogicalVolumeStore, but it seems that the detector is constructed after EventAction.
  • is there any way to enable or disable geometry from command ?
  • change clover position from command?
  • set list of gamma energy and distribution from command
  • read file for energy and distribution