diff --git a/ChangeLog b/ChangeLog index b345710..1f3bd72 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2017-08-24 + + * Bug fix version 1.4.2 released + ================================ + + Correct rate computation in GModelTemporalLightCurve::mc() (#2181) + + 2017-08-22 * Bug fix version 1.4.1 released diff --git a/NEWS b/NEWS index 08be595..29462a2 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,6 @@ -New Features and Important Changes in GammaLib 1.4.1 +New Features and Important Changes in GammaLib 1.4.2 -22 August 2017 +24 August 2017 1. Introduction @@ -63,10 +63,9 @@ None 8. Model module --------------- -A regression has been introduced in GModelSpectralNodes::mc() that led to a -GException::invalid_return_value exception in case that the energy range was -lying outside the energy range covered by the node function. This regression -was corrected (#2179). +Fixed bug where the light curve normalization was taken into account twice in +GModelTemporalLightCurve::mc() so that the number of events scaled with the +squared of the normalization instead of a linear scaling (#2181). 9. Numerics module diff --git a/README.md b/README.md index a3fa313..c83dec0 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ GammaLib information ==================== -* Version: 1.4.1 (22 August 2017) +* Version: 1.4.2 (24 August 2017) * Author: Juergen Knoedlseder (jurgen.knodlseder@irap.omp.eu) [![Build Status](https://cta-jenkins.irap.omp.eu/buildStatus/icon?job=gammalib-integrate-os)](https://cta-jenkins.irap.omp.eu/job/gammalib-integrate-os/) diff --git a/doc/source/admin/release_history/1.4.2.rst b/doc/source/admin/release_history/1.4.2.rst new file mode 100644 index 0000000..ff0b45f --- /dev/null +++ b/doc/source/admin/release_history/1.4.2.rst @@ -0,0 +1,14 @@ +.. _1.4.2: + +GammaLib 1.4.2 release (24 August 2017) +======================================= + +Overview +-------- + +GammaLib 1.4.2 is a bug fix for GammaLib release 1.4. + +The following bugs have been fixed: + +* [`2181 `_] - + Correct rate computation in ``GModelTemporalLightCurve::mc()`` diff --git a/doc/source/admin/release_history/index.rst b/doc/source/admin/release_history/index.rst index 78b0502..bb02264 100644 --- a/doc/source/admin/release_history/index.rst +++ b/doc/source/admin/release_history/index.rst @@ -19,6 +19,7 @@ Bug fix releases: .. toctree:: :maxdepth: 1 + GammaLib 1.4.2 <1.4.2> GammaLib 1.4.1 <1.4.1> GammaLib 1.3.1 <1.3.1> GammaLib 1.0.1 <1.0.1> diff --git a/src/model/GModelTemporalLightCurve.cpp b/src/model/GModelTemporalLightCurve.cpp index 59f016d..c76dfcc 100644 --- a/src/model/GModelTemporalLightCurve.cpp +++ b/src/model/GModelTemporalLightCurve.cpp @@ -313,8 +313,10 @@ GTimes GModelTemporalLightCurve::mc(const double& rate, const GTime& tmin, if (m_mc_eff_duration > 0.0 && m_mc_cum.size() > 0) { // Compute mean number of times by multiplying the rate with the - // effective duration and the normalization factor - double lambda = rate * norm() * m_mc_eff_duration; + // effective duration. Note that the light curve normalization factor + // is already included in the effective rate, hence we should not + // multiply it here again (see #2181). + double lambda = rate * m_mc_eff_duration; // Compute number of times to be sampled int ntimes = int(ran.poisson(lambda)+0.5);