Multiple beams using source routine

Dear FLUKA and FLAIR experts,

I need some clarification.

Let’s say I have 3 different particles in a beam.

Using my source routine I would have something like this

My questions are:

1.- For every primary, I would have only one particle at random taking into account its probability. This process would be similar to what SPOTBEAM card does using spot weights. Is this correct?

2.- Is there a way to have multiple particles at the same time instead of one per primary in my simulation? Each kind of particle having a different distribution defined by source.f

Thank you in advance.

Best Regards,
Carlos

1 Like

Dear Carlos,

  1. Yes, this it the same idea as the spot weights.

  2. It is possible to have multiple primaries in a single event in FLUKA. However, if you are not utilizing event-by-event scorings (EVENTBIN, DETECT, etc.), the results will be the same as having only one primary particle in an event.

Cheers,
David

Dear David,

Thank you for your reply.

To your second point. I am using EVENTBIN for scoring, so I want to be able to have multiple primaries per event, but I am unable to do so.

Could you point me on how to do it?

Best Regards,
Carlos

Dear Carlos,

you need to duplicate the main part of the source routine to put another particle into the stack.

For example see: source.f (15.0 KB)
This user routine will add a proton and an electron to the stack with different energies and starting points.

Cheers,
David

1 Like

Dear David,

I am bit unfamiliar with source.f syntaxis. Is there a way to add to the stack using source_newgen.f syntaxis?

Best Regards,
Carlos

Dear Carlos,

technically it is possible to use the source_newgen.f user routine. However with source_newgen.f you can sample only from one histogram, without significant changes.

You can find the description of the source.f user routine here: 13.2.20} source.f: user-written source | FLUKA

Cheers,
David

2 Likes