Bug #2462

Fix internal spectral nodes in GCTABackground3D

Added by Knödlseder Jürgen over 6 years ago. Updated over 6 years ago.

Status:ClosedStart date:04/26/2018
Priority:UrgentDue 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 of
double logE_bin = (m_logE_max - m_logE_min) / (nbins+1);
the line should be
double logE_bin = (m_logE_max - m_logE_min) / (nbins-1);

test.py Magnifier (841 Bytes) Knödlseder Jürgen, 04/26/2018 02:19 PM

model_src+bkg_CTA.xml Magnifier (1.14 KB) Knödlseder Jürgen, 04/26/2018 02:19 PM

IRF_ASTRI_cut_mod_2.fits (166 KB) Knödlseder Jürgen, 04/26/2018 02:19 PM


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

Also available in: Atom PDF