I am fairly new to G4, sorry for the potentially basic question.
I have is a histogram of the intensity as a function of energy, which I understand can be included into GPS as a custom energy distribution. The problem is that this spectrum also varies as a function of zenith angle and I am unsure as to how to go about implementing this angular dependence.
Has anyone had any experience doing this or any advice on how to go with this?
you can use GPS and UI commands to asign the angular distribution. /gps/hist/type theta for theta distribution, and /gps/hist/type phi for phi distribution.
you can refer to this GPS examples. The example 23 can solve your problem.
Best
Hi, just define particleGun = new G4GeneralParticleSource() in the ` PrimaryGeneratorAction.cc file. The UI commands are expected to write into a mac file.
you can see the GPS UI mac examples and the whole codes of that example are available in your geant4 directory /examples/extended/eventgenerator/exgps/