Custom Gamma Source

Hello all I am wanting to know if there is a way to focus on creating a gamma source with a user defined spectrum? I am looking to create a Co-57 gamma source.

Also is there a way to use the MCParticle class to get and show the initial spectrum as a sanity check to make sure the source is outputting the desired spectrum? I was testing things out using the getTotalEnergyStart() function but was getting only 0.

Is that the correct function to look at?

Hi @oobie2142 ,

Sure! Maybe this thread can help: Implementing custom energy spectra
This can be done by defining a histogram using the General Particle Source in Geant4 (by using source type macro).
Here is an example source macro using a histogram of energies: Enable_pai flag in combination w/ gdml geometry and custom E-Field - #3 by hwennlof
You could also use a macro to define a number of gamma point sources of specific energy, with a fraction given by the different decays. Here is an example for iron-55 K-alpha and K-beta.
Fe55photons.mac (859 Bytes)

The MCParticle class will only display the initial energy of a particle interacting with your detector, so if you always miss it you won’t get anything from this. You could instead use the MCTrack objects, and the method getTotalEnergyInitial(). If you turn on record_all_tracks in [DepositionGeant4] also tracks that do not hit the sensor will be saved, so you should always get a non-zero histogram with this method.

Kind regards,
Håkan

1 Like