Change request #2720

Add margin to energy boundaries GCTABackground3D

Added by Specovius Andreas over 5 years ago.

Status:NewStart date:11/06/2018
Priority:NormalDue date:
Assigned To:-% Done:

0%

Category:-
Target version:-
Duration:

Description

During the simulation of background events from a given template obviously it may occur that energies are diced that are slightly beyond the energy bounds due to numerics.

This is what I get as output:

GCTABackground3D::mc()> emin=0.174448 energy=0.392216 emax=100 (diff max-energy=99.6078)
GCTABackground3D::mc()> emin=0.174448 energy=0.425866 emax=100 (diff max-energy=99.5741)
GCTABackground3D::mc()> emin=0.174448 energy=100 emax=100 (diff max-energy=-1.7053e-13)
terminate called after throwing an instance of 'GException::invalid_value'
  what():  *** ERROR in GCTABackground3D::mc(GEnergy&, GTime&, GRan&): Invalid value. Event energy 100 TeV is outside the energy range [174.448269899925 GeV, 100 TeV] covered by the background response table. Please restrict the energy range of the simulation to the validity range of the background response table.

Adding a margin to the check in GCTABackground3D::mc() would help here and solve the issue:

    // Determine energy range of response table
    GEnergy emargin = GEnergy(1.0, "MeV");
    GEnergy emin = m_mc_spectrum.energy(0);
    GEnergy emax = m_mc_spectrum.energy(m_mc_spectrum.nodes()-1);

    if (energy+emargin < emin || energy-emargin > emax) {


Recurrence

No recurrence.

Also available in: Atom PDF