# Simulating a energy spectrum

**URL:** <https://fluka-forum.web.cern.ch/t/simulating-a-energy-spectrum/8319>\
**Category:** Source Definition\
**Created:** [20 April 2026 13:32 UTC](https://fluka-forum.web.cern.ch/t/simulating-a-energy-spectrum/8319 "2026-04-20T13:32:26Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![2018016051](https://fluka-forum.web.cern.ch/letter_avatar_proxy/v4/letter/2/7ab992/32.png) [@2018016051](https://fluka-forum.web.cern.ch/u/2018016051)\
**Post date:** [20 April 2026 13:32 UTC](https://fluka-forum.web.cern.ch/t/simulating-a-energy-spectrum/8319/1 "2026-04-20T13:32:26Z")

</div>

### Versions

> Please provide the used software versions.

_FLUKA_:4-5.1  
_Flair_:3.4-5.2

### Description

> Dear Fluka experts,
> 
> I am a student and am currently working on simulating brachytherapy sources. I can reproduce the source geometry and simulate a monoenergetic cylindrical core. Can someone please assist or direct me in the right direction to simulate a source spectrum?
> 
> Thank you in advance for your help.

### Input files

> Please upload all relevant files. (FLUKA input file, Flair project file, user routines, and data files)

[Brachy.flair](https://fluka-forum.web.cern.ch/uploads/short-url/nztpzb47kggkGKxKSLFV0XvmFDd.flair) (3.2 KB)

[Brachy.inp](https://fluka-forum.web.cern.ch/uploads/short-url/4GGEZpoOYgGNNnuHHrUb380c5Ls.inp) (2.4 KB)

---

<div class="post-metadata">

**Author:** ![wenlong.zhang](https://fluka-forum.web.cern.ch/letter_avatar_proxy/v4/letter/w/0ea827/32.png) [@wenlong.zhang](https://fluka-forum.web.cern.ch/u/wenlong.zhang)\
**Post date:** [20 April 2026 14:42 UTC](https://fluka-forum.web.cern.ch/t/simulating-a-energy-spectrum/8319/2 "2026-04-20T14:42:35Z")

</div>

Hi, can you explain a little bit more about the task or study you want to do? I didn’t immediately understand your inp file. It seems that you initialized a photon beam and let it interact with a metal compound?

In terms of energy spectrum, I am also exploring this. I have managed to output the spectrum using USRBDX. It gives the fluence or current on a boundary (surface) between two regions. You need to create the regions for the boundary (surface) you want to study. You can check the CERN materials. [https://indico.cern.ch/event/1498636/contributions/6486100/attachments/3066983/5426841/12\_Scoring\_II\_2025\_JRC.pdf](https://indico.cern.ch/event/1498636/contributions/6486100/attachments/3066983/5426841/12_Scoring_II_2025_JRC.pdf)

---

<div class="post-metadata">

**Author:** ![2018016051](https://fluka-forum.web.cern.ch/letter_avatar_proxy/v4/letter/2/7ab992/32.png) [@2018016051](https://fluka-forum.web.cern.ch/u/2018016051)\
**Post date:** [20 April 2026 15:05 UTC](https://fluka-forum.web.cern.ch/t/simulating-a-energy-spectrum/8319/3 "2026-04-20T15:05:59Z")

</div>

Hi, thank you for your response.

I am currently simulating brachytherapy sources in a water phantom. My goal is to determine the TG-43 parameters for the source from the dose distribution obtained via Monte Carlo simulations. The beam simulated must not be monoenergetic, but a spectrum of energies.

---

<div class="post-metadata">

**Author:** ![wenlong.zhang](https://fluka-forum.web.cern.ch/letter_avatar_proxy/v4/letter/w/0ea827/32.png) [@wenlong.zhang](https://fluka-forum.web.cern.ch/u/wenlong.zhang)\
**Post date:** [20 April 2026 15:23 UTC](https://fluka-forum.web.cern.ch/t/simulating-a-energy-spectrum/8319/4 "2026-04-20T15:23:48Z")

</div>

OK. Got your goal. I think my answer doesn’t help then.

---

<div class="post-metadata">

**Author:** ![Ramzy1990](https://fluka-forum.web.cern.ch/letter_avatar_proxy/v4/letter/r/e56c9b/32.png) [@Ramzy1990](https://fluka-forum.web.cern.ch/u/Ramzy1990)\
**Post date:** [20 April 2026 23:07 UTC](https://fluka-forum.web.cern.ch/t/simulating-a-energy-spectrum/8319/5 "2026-04-20T23:07:25Z")

</div>

Hi Izak,

I am no FLUKA expert but maybe the following website from the FLUKA manual could help:

> **[7.22.70. SOURCE — FLUKA Manual](https://flukafiles.web.cern.ch/manual/chapters/description_input/description_options/source.html#source)**
>
> Invokes the use of a user-defined source routine SOURCE. This option allows to input up to 18 double precision parameters chosen by the user, to be passed to the user routine SOURCE. To pass more than 6 parameters, two continuation SOURCE cards are...

In particular, the following

> **[NOMORE - 13.2.19. source.f — FLUKA Manual](https://flukafiles.web.cern.ch/manual/chapters/user_routines/user_routines/source.html#source-f)**
>
> User-written source

And then this:

> **[BEGINNING - 13.2.20. source\_newgen.f — FLUKA Manual](https://flukafiles.web.cern.ch/manual/chapters/user_routines/user_routines/source_newgen.html#source-newgen-f)**
>
> This new-generation source user routine provides a new-user-friendly alternative to the legacy source routine (which retains all validity and backward compatibility). This is achieved by using modern Fortran, allowing longer, descriptive variable...

This is ought to get you started. Also, please [see here a discussion](https://claude.ai/share/b84a3569-4111-4f10-bb5d-20457b1cd16a) from an AI online model (consider it an online search). You will have to _ **scrutinize** _ every aspect of that discussion as it could contain hallucinations.

---

<div class="post-metadata">

**Author:** ![2018016051](https://fluka-forum.web.cern.ch/letter_avatar_proxy/v4/letter/2/7ab992/32.png) [@2018016051](https://fluka-forum.web.cern.ch/u/2018016051)\
**Post date:** [22 April 2026 10:02 UTC](https://fluka-forum.web.cern.ch/t/simulating-a-energy-spectrum/8319/6 "2026-04-22T10:02:49Z")

</div>

Hi Muhammad, sorry for the late reply. Thank you for the information.

---

<div class="post-metadata">

**Author:** ![rversaci](https://fluka-forum.web.cern.ch/letter_avatar_proxy/v4/letter/r/cc9497/32.png) [@rversaci](https://fluka-forum.web.cern.ch/u/rversaci)\
**Post date:** [28 April 2026 06:09 UTC](https://fluka-forum.web.cern.ch/t/simulating-a-energy-spectrum/8319/7 "2026-04-28T06:09:40Z")

</div>

Closed on 28 April 2026 06:09 UTC


