Commit 3640d1892cbe6087bec5e994f7338c9a31b990d8
1 parent
4a7b17d0
Correct rate computation in GModelTemporalLightCurve::mc() (#2181)
Showing
6 changed files
with
33 additions
and
9 deletions
ChangeLog
NEWS
| 1 | -New Features and Important Changes in GammaLib 1.4.1 | |
| 1 | +New Features and Important Changes in GammaLib 1.4.2 | |
| 2 | 2 | |
| 3 | -22 August 2017 | |
| 3 | +24 August 2017 | |
| 4 | 4 | |
| 5 | 5 | |
| 6 | 6 | 1. Introduction |
| ... | ... | @@ -63,10 +63,9 @@ None |
| 63 | 63 | |
| 64 | 64 | 8. Model module |
| 65 | 65 | --------------- |
| 66 | -A regression has been introduced in GModelSpectralNodes::mc() that led to a | |
| 67 | -GException::invalid_return_value exception in case that the energy range was | |
| 68 | -lying outside the energy range covered by the node function. This regression | |
| 69 | -was corrected (#2179). | |
| 66 | +Fixed bug where the light curve normalization was taken into account twice in | |
| 67 | +GModelTemporalLightCurve::mc() so that the number of events scaled with the | |
| 68 | +squared of the normalization instead of a linear scaling (#2181). | |
| 70 | 69 | |
| 71 | 70 | |
| 72 | 71 | 9. Numerics module | ... | ... |
README.md
| 1 | 1 | GammaLib information |
| 2 | 2 | ==================== |
| 3 | -* Version: 1.4.1 (22 August 2017) | |
| 3 | +* Version: 1.4.2 (24 August 2017) | |
| 4 | 4 | * Author: Juergen Knoedlseder (jurgen.knodlseder@irap.omp.eu) |
| 5 | 5 | |
| 6 | 6 | [](https://cta-jenkins.irap.omp.eu/job/gammalib-integrate-os/) | ... | ... |
doc/source/admin/release_history/1.4.2.rst
0 → 100644
| 1 | +.. _1.4.2: | |
| 2 | + | |
| 3 | +GammaLib 1.4.2 release (24 August 2017) | |
| 4 | +======================================= | |
| 5 | + | |
| 6 | +Overview | |
| 7 | +-------- | |
| 8 | + | |
| 9 | +GammaLib 1.4.2 is a bug fix for GammaLib release 1.4. | |
| 10 | + | |
| 11 | +The following bugs have been fixed: | |
| 12 | + | |
| 13 | +* [`2181 <https://cta-redmine.irap.omp.eu/issues/2181>`_] - | |
| 14 | + Correct rate computation in ``GModelTemporalLightCurve::mc()`` | ... | ... |
doc/source/admin/release_history/index.rst
src/model/GModelTemporalLightCurve.cpp
| ... | ... | @@ -313,8 +313,10 @@ GTimes GModelTemporalLightCurve::mc(const double& rate, const GTime& tmin, |
| 313 | 313 | if (m_mc_eff_duration > 0.0 && m_mc_cum.size() > 0) { |
| 314 | 314 | |
| 315 | 315 | // Compute mean number of times by multiplying the rate with the |
| 316 | - // effective duration and the normalization factor | |
| 317 | - double lambda = rate * norm() * m_mc_eff_duration; | |
| 316 | + // effective duration. Note that the light curve normalization factor | |
| 317 | + // is already included in the effective rate, hence we should not | |
| 318 | + // multiply it here again (see #2181). | |
| 319 | + double lambda = rate * m_mc_eff_duration; | |
| 318 | 320 | |
| 319 | 321 | // Compute number of times to be sampled |
| 320 | 322 | int ntimes = int(ran.poisson(lambda)+0.5); | ... | ... |