# Re: [fluka-discuss]: Re: Modelling a polychromatic X-ray source

From: Mikhail Polkovnikov <pmk_at_ihep.ru>
Date: Mon, 13 Jul 2015 22:27:17 +0300

On 13.07.2015 15:12, Hamideh Jalali wrote:
> Dear Mikhail
>
> As the problem you have explained to Faith, I am going to simulate a
> spectrum of photons (synchrotron radiation) as source. In my spectrum
> file the first column is energy and the second column is photon/sec. I
> have programmed the same source.f as you.But I did not realize this part,
>
> 5.This part calculates an energy of the random value XI as a linear
> dependency inside the "I" bin.
> C Calculating the energy inside the bin 'I' according to linear spectrum
> XI = (XI - CUM(I - 1)) / (CUM(I) - CUM(I - 1))
> IF (FLX(I) .EQ. FLX(I - 1)) THEN
> ENERGY = XI
> ELSE
> ENERGY = XI * (FLX(I) - FLX(I - 1)) * (FLX(I) + FLX(I - 1))
> ENERGY = SQRT(ENERGY + FLX(I - 1) ** 2) - FLX(I - 1)
> ENERGY = ENERGY / (FLX(I) - FLX(I - 1))
> END IF
> ENERGY = ENERGY * (ENE(I) - ENE(I - 1)) + ENE(I - 1)
>
> Should this part be embedded in my source.f too?
>
> In my problem I would like to score dose equivalent and as you know
> the results of fluka are reported per primary particle. My question
> is, how can I find the whole number of photons (actually thr number of
> primary particles)when I have the flux of photons in unit of
> photon/sec or photon/sec/energy(while the first column is energy).
>
> I would be really grateful if you help me.
>
> Best Regards
> Hamideh
>
>
>
>
>
Dear Hamideh,

The part of code is a mandatory for proper energy sampling in my example.

I didn't quite understand the second question about number of photons,
but here is my understanding.

When you calculating a normalized cumulative probability in the SOURCE
user routine (a CUM array variable) and
generating primary particles you will in any case get the results per
primary, so you can do the scoring as usual.
So to get whole number of photons you just normalize on you total
required number of primaries ( for fluence: photons/cm^2/primary *
primary = photons/cm^2).
Another way is to use SCORE card.

Best regards,
Mikhail

__________________________________________________________________________
You can manage unsubscription from this mailing list at https://www.fluka.org/fluka.php?id=acc_info
Received on Mon Jul 13 2015 - 22:59:23 CEST

This archive was generated by hypermail 2.3.0 : Mon Jul 13 2015 - 22:59:24 CEST