Creating a beam spectrum from sampling a file

Dear FLUKA experts,

I am new to Flair and FLUKA and I am trying to setup an electron source whose energy distribution is sampled from spectrum given in an external text file.

I think I need to setup a Source.f file but I not sure where to start.
If anyone has a good guide or example file they can share I would greatly appreciate it.

Thank you,
Itamar Cohen

Dear Itamar,

My suggestion is to utilise source_newgen.f
Usage is described here:

An example with spectrum sampling can be found here 2023-fluka-beginner-course

Best wishes,
Volodymyr