I was simulating a germanium crystal and as the source I placed a 5 MeV monoenergetic electron with isotropic distribution using GPS. I am attaching the GPS macro and the visualisation of geometry along with this. I have written the energy deposition data to root file and while analysing that, I could find there is an unusually large value at the first bin of the histogram. I tried the simulation with different types of detectors like silicon detectors, BC408 scintillators and all. But always there is a large peak in the first bin. I tried the simulations using different radioactive sources as well and I could find the same peak remains there.
When I integrated the total number of counts under the curve I obtained, I could see that it is 10^6 which is the same as the number of electrons I had projected isotropically. Now I did the simulation in a different way that all the projectile electrons are falling directly on the detector active area and no one is escaping. (The geometry and spectrum attached for reference.) .
Interestingly, the peak in the first bin vanishes.
So it is my guess that Geant 4 is putting all the particles not registered in the first bin of the histogram. But I couldn’t figure out how and why this happens. I have edited the example B4 for making the simulation and I am attaching my runmanager.cc along with this post. I couldn’t find any part responsible for this. I am also confused if it is some built in properties of the GPS package.
B4RunAction.cc (3.8 KB)
B4PrimaryGeneratorAction.cc (1.0 KB)
B4aSteppingAction.cc (1.5 KB)
B4aEventAction.cc (2.7 KB)
Thanks a lot in advance for your interest and time and the help is deeply appreciated.