Different momentum directions in the same event

Hi All,

I would like to generate two protons with different momentum directions in the same event. Actually i want to plot the envelope of my beam trajectory. my code is based on GPS commands. do you have any suggestion or guidance? or there is any example in source that i can use to help?

Thanks

with simple particle Gun: examples/extended/eventgenerator/particleGun case 1

1 Like

Thank you for your solution but i dont want use particle Gun. Is it possible with GPS?

You can substitute G4GeneralParticleSource in place of G4ParticleGun. The former includes all of the “simple” commands that the latter has, but then you get all of the additional stuff, too. So take a look at Maire’s example, and you should be able to adapt it to your use case.

GPS documentation is here :

You can also have a look to
examples/extended/eventgenerator/exgps/macros/README

Thank you for your answer

Thank you dear @maire1 for your guidance.