How to get plot of beam profile

Dear Davide,
Thank you very much for your help.With your help, I have solved the problem of energy recording.
Now, I have some questions to ask you.
I want to get the proton beam cross section at different positions of Z axis. Do you need to use other record cards (such as usryied or usrbdx),I want to get this result as shown in the figure(


),This is an article published by others. I want to restore it first.

Cheers,
Chailin

Dear Chailin,
USRBDX and USRYIELD allow you to estimate respectively boundary crossing fluence as function of energy and angle and double differential particle yields. What you need is the fluence spatial distribution so USRBIN is the best candidate.

You can choose to score the fluence of all protons (secondaries included) or primary protons only setting respectively PROTON or BEAMPART in USRBIN. Once you have chosen a mesh that is fine enough it is only a matter of plotting by selecting in Flair the proper range for the 1D projection (the one below for X is completely arbitrary)

If you already know a the positions in terms of Z, you can define multiple USRBINS with just one bin in Z. This can maybe optimize a bit the scoring if you need a really fine mesh
image

Cheers,
Davide