Get a Gaussian Energy deposited Spectrum

Please fill out the following information to help in answering your question, and also see tips for posting code snippets. If you don’t provide this information it will take more time to help with your problem!

_Geant4 Version:_11.1.0
_Operating System:_Ubuntu 22.04
CMake Version:

I am Simulating a CdZnTe(Semiconductor) detector to detect the gamma rays emitted from sources like 137Cs, 241Am and 133Ba. but i dont get the gaussian type of spectrum. so pls help me in getting a good spectrum for in my simulation. i have attached the current spectrum below. and can i get the energy deposited by the electron hole pairs generated after the gamma is incident on my detector and combine it with the energy spectrum?

Anyone please?

Geant4 doesn’t do electron-hole pairs. You will need to have some model for your detector’s specific energy response (resolution vs. energy, noise, biases), and convolute that with the “perfect” spectrum of deposited energy from Geant4.

It is possible to do that as part of your simulation, if you store the individual energy deposits as G4VHit subclass objects. It requires more coding (and hence a deeper understanding of C++ and Geant4) than using the built-in scorers or G4Analysis histograms.

Using a find|grep pipe in G4/examples, it looks to me like three of the advanced examples, HGCal_testbeam, ChargeExchangeMC and gammaray_telescope, include digitization code that you could use as a guide.

Thank you so much I will look into it. If you could provide few more info in detail it would be very much helpful as I’m new to Geant4.

And I have one more doubt, Is it possible to add a resolution factor(sigma) during radioactive decay of 137Cs just like adding a gauss energy distribution with a certain sigma when generating gamma of specific energy in gps? how do I do it?

Thanks in advance.

No. That’s exactly the wrong thing to do. The gaussian spread is not an intrinsic feature of the decay; adding it there would break the underlying physics. The gaussian spread or resolution is an effect of your detector, combined with your readout system.

So is there any other way to get a Gaussian kind of spectrum while decaying a source? Like tracking the energy deposited by secondaries something like that…

For example, how did they get such kind of spectrum in the following?

@mkelsey is on the money.

What a Geant4 hit get’s you is the “real” energy deposition and by real I mean your 661keV gamma ray when FULLY detected will deposit EXACTLY 661keV. Physically there should NEVER be any higher energies that that.

The gaussian you are thinking of is the result of the statistics of information carriers (electron-holes pairs) as seing by a real detector. This typically is voltage pulse that gets digitized to an arbitrary range and then YOU calibrate it to mean energy. In such scenario your gaussian peak will be CENTERED at 661keV.

In Geant4 you can simulate as much as you like of the detection chain. The concept is a DIGIT and you can find the documentation where @mkelsey said.

Happy coding.

Thank you, will definitely look into it