next-exp / nexus

Geant4 simulation framework of the NEXT Collaboration
5 stars 55 forks source link

Muon energy fix #186

Closed kvjmistry closed 1 year ago

kvjmistry commented 2 years ago

This PR fixes a binning issue with the energy of the simulated muon distributions. Previously the specified binning in the file did not match up with the actual bins leaving an unphysical gap at ~800 GeV. Additional bins in energy have been added.

The zenith range has also been expanded to include values from 0 to pi/2 (before a cut was applied for cos(zenith) > 0.4).

The plots below show the angular and energy spectrum of the generated muons (~800k events). I only generated up to 3000 GeV (forgot to change the range!), however, the spectrum does go up to 5500 GeV in the updated file.

image

Also added an extra catch in the code when generating from the angle+energy mode to restrict to only energies in the file (200 - 5500 GeV) otherwise there will be no available bin to sample from. The user must set an energy range if using this zenith-azimuth-energy ("zae") option.