Re: [fluka-discuss]: High resolution x-ray imaging in two steps using mgdraw.f and source.f

From: Andrea Fontana <>
Date: Thu, 18 Apr 2019 16:31:58 +0200

Hi Thomas,
    interesting problem. One idea is the following: instead of using
NCASES, you could try to use NCASE (both are in common CASLIM).

NCASES is the number of primary particles requested in input with
command START and is fixed, while NCASE is the number of the current
primary and increases event by event. They coincide only at the end
of the run (if the run is not terminated with an error) and I think
that you could save your ouput only once because you have used NCASES.

If you use NCASE with a IF instruction, you could save the 2D matrix
every 100 or 1000 primaries, for example.

I am not sure that this will work, but you could try.

Kind regards,

On 18/04/2019 13:13, Primidis, Thomas wrote:
> Dear all,
> I wish to simulate a medical x-ray system that is equipped with a high
> resolution detector. I would like to see the effect of various source
> intensities on the image quality. The following description concerns
> only fully analogue simulations.
> After simulating just the source with an electron primary beam, I
> dumped the generated photons on a file. From this initial simulation I
> got ~6E+5(photons) with 42E+8(electrons) thus an approximate yield of
> photons/electron=1.6E-4.
> With post processing of those 6E+5 photons I managed to derive an
> analytical description of the X-ray beam phase space which then I
> wrote on a source.f card.
> I plan on using this source.f card for the second part of the
> simulation which is photon transport through the phantom and the
> detector. I have prepared an mgdraw.f card to save photons on a 2D
> array which represents the pixelated photon counting detector i.e. if
> a photon enters the detector region, add +1 to the matrix element
> depending on the photon crossing position. Do not account for any
> efficiency issues at the moment.
> I know that the real electron source has 50uA*50ms and I can translate
> this in total number of electrons and multiplying this with my 1.6E-4
> yield I get how many photons would exit the real source. That amount
> of photons I will also sample from my analytical photon source.
> However, I want not only to see the effect of nominal performance but
> several cases of lower current as well(thus lower total number of
> electrons). And do this for 45 different positions of the source as
> well. So I thought of doing one simulation per position and just save
> the 2D matrix in intervals, therefore having the image at different
> total number of electrons(total number of photons in practice).
> Is there a way I can ask fluka to save this matrix whenever it has
> finished transporting various user defined number of particles and
> save these multiple files differently? So far I have managed to only
> save it once using NUMPAR(1) and NCASES with "save matrix when
> NUMPAR(1)=NCASES(this also results in the matrix being saved before
> the last primary has finished transportation).
> One could suggest getting the <photons>/pixel/primary photons and then
> multiplying with any number of primary photons to get the resulting
> image but the high resolution of the detector does not allow for low
> statistical errors in reasonable time.
> Best regards,
> Thomas

Dr. Andrea Fontana                    tel: +39 0382 987991
Istituto Nazionale                    fax: +39 0382 423241
di Fisica Nucleare
Sezione di Pavia                      e-mail:
Via Bassi 6                           web   :
27100 PAVIA, Italy
You can manage unsubscription from this mailing list at
Received on Thu Apr 18 2019 - 17:36:55 CEST

This archive was generated by hypermail 2.3.0 : Thu Apr 18 2019 - 17:36:57 CEST