Plotting ParticleGun with source particle direction

Dear all,

I am using ParticleGun for my source, where I define energy, direction and position of neutrons and I am using OpenGL for the visualization. Is there a way to plot only the source (defined with ParticleGun) with the arrow, related to the direction of each particle generated? I would like to do it without running the simulation with beamOn.
I found the command /vis/scene/add/gps, but wihout finding a way to plot the arrows.
Thank you very much for your time.
Best regards,

Christian

1 Like

Hi Christian

When you say “defined with ParticleGun”, I assume you the General Particle Source. Then /vis/scene/add/gps should draw the source. But to get the directions, I don’t see any way other than to /run/beamOn with enough events to see a good sample generated particles. To avoid triggering lots of interactions you could /gps/particle geantino, which does not interact.

John

2 Likes

Dear John,

thanks for your advice regarding the adoption of Geantino particles. In this case, I have the source defined as a ParticleGun, not with GPS. Indeed, I noticed that with the command /vis/scene/add/gps, it doesn’t work with respect how I defined the source. Unfortunately, I didn’t find an analogue command, like /vis/scene/add/gun.

Christian

The /vis/scene/add/gps command is for use with GPS only (as the name implies). ParticleGun has no structure – it shoots a single particle, from a single point, in a single direction. To visualize what it’s doing, you can use /run/beamOn 1 after setting up your visualization to draw the generated particle track.

1 Like

Ok thank you!

Christian