Energy Deposition in my Detector is not Proper

_Geant4 Version:_11.1
_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. The energy deposited spectrum is not comparable to the actual spectrum. for example while simulating 137Cs i get two peaks one at 662keV(less intense) and just before that between 660 and 665keV(more intense). And the 241Am spectrum is also not good the x-axis scale itself changing. and I don’t get any proper peak at both 17.2keV and 59.5kev. I have attached the spectrums i got below for all the three sources. anyone please guide me through my problem.

Thanks in advance.
spectrum -1- 137Cs
Spectrum-2- 241Am
Spectrum-3- 133Ba

Anyone please?

You’ll have to give more details of your setup - what’s the shape/size of the crystal? Where is the source and how are you starting the decay ions?

Also, please have some patience in waiting for replies.

I’m using CdZnTe crystal of dimensions 552.5 mm with quasi-hemispherical gold electrode the radioactive source is 7mm away. I’m using GPS to decay ions. i have attached the snapshots of the simulation for better visualization.

Grey Volume is CdZnTe
Green is the gold electrode

Im also attaching the construction file: (4.4 KB)
construction.hh (1001 Bytes)

the macro for Decay:

/gps/particle ion
#/gps/ene/type Gauss
/gps/ang/type iso
/gps/ion 55 137
/gps/energy 0 MeV

/tracking/verbose 0
/run/beamOn 1000000


without having a look at the code. I would like to advise you to follow your simulations very carefully. You do not need to have high statistics to know something is wrong. I am personally a big advocate of good-old-fashion printing lines.

My suspicious would be in your sensitive detector class. It feels to me like you are doing a more “Calorimetric” (keep adding up energy) scoring than a “Tracking” one (register first). If you want a realistic detector (5us ADC gate or alike) you will have to code something yourself.


1 Like

Thank you for your reply, I tried placing an aluminum plate of thickness 0.5mm between my detector and the source now I’m getting a proper spectrum.

i will also definitely look into what you are suggesting but can you elaborate on that? because i am not able to understand the Tracking class of Geant4. i am attaching my class files below for your reference. (674 Bytes)
action.hh (390 Bytes) (1.4 KB) (742 Bytes)
detector.hh (408 Bytes) (432 Bytes)

event.hh (448 Bytes) (537 Bytes)
generator.hh (709 Bytes) (504 Bytes)
physics.hh (332 Bytes) (1.7 KB)
run.hh (404 Bytes) (714 Bytes)
stepping.hh (395 Bytes)

Thank you in advance


I see that you do not use Sensitive Detectors at all. That’s Ok, However the problem is that you are adding ALL the energies of the event in your detector. You are just looking into the StepAction for energy deposited and adding them up to the event.


So, for every 137Cs decay you may have both, the gamma-ray and the beta decay (or various energies, since it is beta decay), going into your detector.

When you place a physical volume before the detector you are blocking the beta particles and therefore you “see” a “correct” spectrum.


1 Like

i am it is in my

Sure, but it is doing nothing

#include "detector.hh"

MySensitiveDetector::MySensitiveDetector(G4String name) : G4VSensitiveDetector(name)


G4bool MySensitiveDetector::ProcessHits(G4Step *aStep, G4TouchableHistory *ROhist)
   // Get the energy deposited by the step
    //G4double energyDeposit = aStep->GetTotalEnergyDeposit();
    //G4cout << "Energy Deposited: " << energyDeposit /  keV  << " keV" << G4endl;
    //G4int evt = G4RunManager::GetRunManager()->GetCurrentEvent()->GetEventID();
    //G4AnalysisManager *man = G4AnalysisManager::Instance();
    //man->FillNtupleIColumn(0, evt);
    //man->FillNtupleDColumn(1, energyDeposit);

return true;