Hello everybody. In my simulation I was needing to simulate a not collimated particle gun (primary particle are not parallel but uniformly diverging within a cone). I was expecting to find that function inside G4RandomTools.hh or G4RandomDirection.hh but I was not able to find something like this (the nearest one was G4RandomDirection()). So I decided to create a patch in case someone need it. Best regards Michele Renda
Created git merge request: https://gitlab.cern.ch/geant4/geant4/merge_requests/2
Created attachment 450 [details] Add new function
Thanks for the proposed extension, we'll evaluate it. Please, note that in general, the policy adopted in Geant4 for tools/functions provided is to include only those limited for adoption within the toolkit itself, also for motivations of validation and testing. There is no commitment for providing a comprehensive variety of tools for general use.
Hello Gabriele. Indeed understand the policy. I created the patch because it was very easy to copy my implementation and to submit to Geant4. Feel free to don't include it, if it is not needed. Best regards
A new function G4RandomDirection(cosTheta) has been introduced. The function is already available at the trunk of the repository.