Hi @dprelipc
To clarify my current implementation:
- For the energy spectrum, I’m using the following line
momentum_energy = sample_histogram_momentum_energy("Energy.txt", "MeV")
and this is working well.
- For the polar angular distribution, I’ve added:
direction_cosx = sample_discrete_file("AngleX.txt")
where AngleX.txt contains a discrete probability distribution over cos(theta) (with theta defined with respect to the x-axis). This also seems to work properly.
Now, I’d like to sample direction_cosy and direction_cosz isotropically. Is there a recommended way to do this within source_newgen.f?
Also, regarding the spatial distribution, I used two BEAMPOS cards to define a uniform distribution in a cylinder. However, I understand that when using source_newgen.f, the CYLI-VOL card is ignored (Issue with cylindrical surface source - Source Definition - FLUKA User Forum).
I also noticed that calling sample_annular_distribution does not help in my case, since I need a finite-height cylinder.
Is there a recommended approach to implement uniform sampling within a finite cylinder directly inside source_newgen.f?
Best,
Giorgia