Commit 3640d1892cbe6087bec5e994f7338c9a31b990d8

Authored by Jürgen Knödlseder
1 parent 4a7b17d0

Correct rate computation in GModelTemporalLightCurve::mc() (#2181)

ChangeLog
  1 +2017-08-24
  2 +
  3 + * Bug fix version 1.4.2 released
  4 + ================================
  5 +
  6 + Correct rate computation in GModelTemporalLightCurve::mc() (#2181)
  7 +
  8 +
1 9 2017-08-22
2 10  
3 11 * Bug fix version 1.4.1 released
... ...
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 [![Build Status](https://cta-jenkins.irap.omp.eu/buildStatus/icon?job=gammalib-integrate-os)](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
... ... @@ -19,6 +19,7 @@ Bug fix releases:
19 19 .. toctree::
20 20 :maxdepth: 1
21 21  
  22 + GammaLib 1.4.2 <1.4.2>
22 23 GammaLib 1.4.1 <1.4.1>
23 24 GammaLib 1.3.1 <1.3.1>
24 25 GammaLib 1.0.1 <1.0.1>
... ...
src/model/GModelTemporalLightCurve.cpp
... ... @@ -313,8 +313,10 @@ GTimes GModelTemporalLightCurve::mc(const double&amp; rate, const GTime&amp; 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);
... ...