Phase-space coordinates scoring

Dear FLUKA experts,

For a propagating proton beam, I would like to record the position and slope of each particle crossing a plane in a file. The purpose is to obtain a sampling of the phase-space beam ellipse. From my search of the manual, I understand that using a collision tape might be the way to do this. Can you please confirm or clarify this, and let me know if there is a tutorial available to guide me through the process?

Thank you in advance for your help.
Kind regards, Enrico

Dear Enrico,

You can achieve this with the mgdraw.f user routine, using the BXDRAW entry. This code is run each time a particle crosses a region boundary. Here, you can filter out the crossings you are interested in (location, particle type, energy, etc.) and write the crossing coordinates, direction, particle type, energy, etc., into a file.

You can find an example here:

You may want to look at the source_newgen.f routine to see the format used there for phase-space sampling.

Cheers,
David

1 Like

Dear David,

Thank you so much for your consistently detailed and helpful replies!

Have a great day,
Enrico

A post was split to a new topic: Error: Cannot convert CHARACTER to REAL