Linking angular and energy distribution

Hi all!

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 :

In a way to reduce my computing time, I now want to launch neutron directly according to this distribution.

And I’m stuck at this point because I can’t found a way to link energy and angular distribution.

Maybe is there a way by using my file to generate this distribution ?

Thanks in advance!

I can barely reproduce the distribution but I can’t found a way to link them:

Hi,

Are you using the G4ParticleGun? It allows to generate primary particles with total freedom.

Cheers

1 Like

Hi,

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 ?

Thanks

yes, correct. You can do that with the G4ParticleGun.

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

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.