I’m trying to simulate an activation experiment with proton’s induced neutron.
I first launched a simulation to retrieve neutron’s angular and energy distribution.
I saved them as Ntuple in a root file :
Thanks for your reply,
No I’m using GPS, assuming it was more usefull for generating specific primary particles
So a way with G4ParticleGun is recovering the particle’s emission angle at the generation and imposing the “right” energy for this angle, that’s right ?
To be more specific, you can write any arbitrary code you want in your G4VUserPrimaryGeneratorAction::GeneratePrimaries(), and you can then pass the configuration you generate through to the fParticleGun data member for each event.
in examples/extended/eventgenerator, there are 2 examples to illustrate these features :
userPrimaryGenerator which even do not use G4ParticleGun
particleGun which use G4ParticleGun