Hi!
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/particle neutron
/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/particle neutron
#/gun/energy 14 meV
and write the same information in PrimaryGeneratorAction.cc:
void PrimaryGeneratorAction::SetDefaultKinematic()
{
G4ParticleDefinition* particle
= G4ParticleTable::GetParticleTable()->FindParticle(“neutron”);
fParticleGun->SetParticleDefinition(particle);
fParticleGun->SetParticleEnergy(14MeV);
fParticleGun->SetParticleMomentumDirection(G4ThreeVector(1.,0.,0.));
G4double position = -0.45(fDetector->GetWorldSizeX());
fParticleGun->SetParticlePosition(G4ThreeVector(position,0.*cm,0.*cm));
}
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!