How to get the photo-peak efficiency of a scinitllator?

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.2.0
_Operating System:_macOS
_CMake Version:_3.29.0-rc3

I am creating a LaBr3 scintillator but not sure how to calculate its photo-peak efficiency or total gamma particles deposited at 662 keV.

As in the number of absorbed 662 kev gammas that end up in the photopeak? The easiest way would be to count the number of counts in your photopeak and divide it by the number of gamma rays emitted, absorbed, etc. Whichever efficiency you are looking for.

You could also look at the number of compton scatters vs photoelectric absorptions, etc using conditionals in your stepping action

Actually, I am a rookie and still learning geant4. Basically, I wanted to ask whether I can calculate photopeak with any specific function or not.
Also, I am currently applying both the photoelectric effect and the Compton effect for gamma particles in my physics list. Should I apply them individually?

You don’t need to apply them separately. Are you generating photons? Or just looking at energy deposition?

What you need to do to generate your spectrum is to record either the number of photons collected, or the energy deposited, and histogram it using analysismanager. You can record the energy deposited per step in your stepping action and then record the entire energy deposition from a gamma ray at the end of your event action

I am working with gamma particles. I have created a scintillator of LaBr3 and thrown gamma particles from outside the detector.
Also, if using the function GetTotalEnergyDeposit() will give me the photopeak, then how should I calculate number of gamma rays depositing Non-zero energy values?