Dear @giorgia.fossati,
-
To sample isotropically, you could:
a) sample from a uniform/constant file,
b) or you could use the available:
call sample_isotropic_direction( direction_cosx, direction_cosy, direction_cosz )
followed by your
direction_cosx = sample_discrete_file("AngleX.txt")
to superseed the previous assignment ofdirection_cosx
. -
To have a finite cylinder, you can follow the logic of the same post you mention, namely:
call sample_annular_distribution( 49.2633D0, 50.0D0, coordinate_x, coordinate_y )
then sampling uniformly along the z direction:
coordinate_z = sample_flat_distribution([min], [max])
Do let me know if you need further assistances.
Best,
Daniel