Bug #2462
Fix internal spectral nodes in GCTABackground3D
Status: | Closed | Start date: | 04/26/2018 | |
---|---|---|---|---|
Priority: | Urgent | Due date: | ||
Assigned To: | Knödlseder Jürgen | % Done: | 100% | |
Category: | - | |||
Target version: | 1.5.2 | |||
Duration: |
Description
Martina Cardillo reported a problem during the event simulations using some custom IRFs. For some reason, the simulated energies are outside the energy range of interest. Here the error message that occurs with the attached test script:
ValueError: *** ERROR in GCTABackground3D::mc(GEnergy&, GTime&, GRan&): Invalid value. Event energy 395.910126393249 TeV is outside the energy range [630.957365036011 GeV, 350.392200724172 TeV] covered by the background response table. Please restrict the energy range of the simulation to the validity range of the background response table.
It turned out that the number of internal nodes were not correctly computed in
GCTABackground3D::init_mc_cache
. Instead ofdouble logE_bin = (m_logE_max - m_logE_min) / (nbins+1);
the line should bedouble logE_bin = (m_logE_max - m_logE_min) / (nbins-1);
Recurrence
No recurrence.
History
#1 Updated by Knödlseder Jürgen over 6 years ago
- Status changed from New to Feedback
- % Done changed from 0 to 100
Changing the code did indeed fix the problem.
#2 Updated by Knödlseder Jürgen over 6 years ago
- Status changed from Feedback to Closed
Code included in release 1.5.2 and also merged into devel