Getting spectrum of Cs137 for calculating resulution

Hello !

I want to get the energy spectra of Cs137 so as to calculate the resolution of detector using FWHM. How should I do that. I have attached the image below for reference.
image

1 Like

Hello,

You can use the General Particle Source (GPS) to place Cs137 at rest in your simulation. It then decays and you get the Gammas.

Macro command to place ions with GPS:

/gps/particle ion
#Atomic Number / Atomic Mass / Charge of ion / Excitation energy in keV
/gps/ion 55 137 0 0 #Cs137 - 662 keV gamma from Ba137*
/gps/position 0 0 0 #GPS position of point source
/gps/energy 0. eV #at rest to study decay
/run/beamOn 1000

However, what you have attached is NOT the gamma Spectrum of decaying Cs137 - this would be a peak at 662 keV.
What you have attached is the detector response of Cs137 with the 662 keV doing different interactions. If you want to feed this into your simulation, you should take a look into this (maybe):
Can someone explain how to use a histogram energy spectrum as a source input for GPS - Particles, Track, Event, Run and Biasing - Geant4 Forum (cern.ch)
and use the GPS with an input histogram of your plot.

Regards
Max

2 Likes

Thank you so much for your response Max.
You are correct, I want to check the detector response of a scintillator detector to the 662 gamma ray.
I used the macro file for gps and analysis both but was getting error stating that- `***** COMMAND NOT FOUND </gps/verbose 2> *****

***** Batch is interrupted!! *****

-------- WWWW ------- G4Exception-START -------- WWWW -------
*** G4Exception : UIMAN0123
issued by : G4UImanager::ApplyCommand
Command aborted (100)
Error code : 100
`
It couldn’t find the gps and analysis command. Can you tell how can this error be fixed ?
Thank you so much

Regards
Deepa

General Particle Source is not mandatory.
You can do the same things with simple G4ParticleGun.

1 Like

Hello again,

There are two ways to create primaries in Geant4: ParticleGun and GeneralParticleSource.
Your error says you are not using the GPS.
As Michel pointed out, what you want to do can also be done with the ParticleGun.
I guess what you use is up to you.

Normally your PrimaryGeneratorAction.cc file includes either the ParticleGun or the GPS.
If you are using the Gun and want to switch to the GPS, i recommend you take a look at this example:
examples/extended/eventgenerator/exgps
and copy the needed code from there. There are also a lot of macro files for the GPS.

Regards
Max

1 Like

Thank you so much @MaxLoep . This example seems helpful. I will check that.

Regards
Deepa

Thank you @maire. Will try that too.

Regards
Deepa