I’m trying to simulate the gamma production due to neutron activation in carbon. An official project in ./examples/extended/radioactivedecay/Activation was run. I created a C.mac file where the command for setting up the neutron source is:
/gun/energy 14 meV
And then I got the gamma spectrum：
C.mac.pdf (13.5 KB)
When I comment out these codes in C.mac:
#/gun/energy 14 meV
and write the same information in PrimaryGeneratorAction.cc:
G4double position = -0.45(fDetector->GetWorldSizeX());
I got the gamma spectrum:
CommentOut.pdf (15.3 KB)
I do not know Why the same particle conditions in PrimaryGeneratorAction.cc and .mac file give different results? Are the two ways of setting up particles actually different?
Thank you very much for your help!