Commit 9cd0c01e26f879e7f3a5a22f2b63e6b5d73dc256

Authored by Jürgen Knödlseder
1 parent 929503e5

Correct Nbgd computation in GCTAOnOffObservation for Non=0 (#2838)

ChangeLog
1   -2019-01-09
  1 +2019-03-06
2 2  
3 3 * Version 1.6.0 released
4 4 ========================
5 5  
  6 + Correct Nbgd computation in GCTAOnOffObservation for Non=0 (#2838)
6 7 Improve OpenMP handling in GWcs::dir2pix (#2770)
7 8 Add support for Fermi/LAT P8V3 response functions
8 9 CTA background rates are now per ontime (#2758)
... ...
1 1 New Features and Important Changes in GammaLib 1.6.0
2 2  
3   -9 January 2019
  3 +6 March 2019
4 4  
5 5  
6 6 1. Introduction
... ... @@ -320,6 +320,9 @@ unit tests for that response functions were added.
320 320  
321 321 20. CTA interface
322 322 -----------------
  323 +A missing term was added in GCTAOnOffObservation::wstat_value for computation
  324 +of the number of background counts in case that Non=0 (#2838).
  325 +
323 326 CTA background rates are now per ontime and not livetime. This makes the IRF
324 327 background consistent with the cube background, and is also consistent with
325 328 the open gamma data format (#2758).
... ...
doc/source/admin/release_history/1.6.rst
... ... @@ -19,6 +19,8 @@ In particular, this release provides:
19 19 Bug fixes
20 20 ---------
21 21  
  22 +* [`2838 <https://cta-redmine.irap.omp.eu/issues/2838>`_] -
  23 + Correct Nbgd computation in ``GCTAOnOffObservation`` for Non=0
22 24 * [`2708 <https://cta-redmine.irap.omp.eu/issues/2708>`_] -
23 25 Fix precision issue with ``GCTABackground3D`` Monte-Carlo simulations
24 26 * [`2706 <https://cta-redmine.irap.omp.eu/issues/2706>`_] -
... ...
inst/cta/src/GCTAOnOffObservation.cpp
1 1 /***************************************************************************
2 2 * GCTAOnOffObservation.cpp - CTA On/Off observation class *
3 3 * ----------------------------------------------------------------------- *
4   - * copyright (C) 2013-2018 by Chia-Chun Lu & Christoph Deil *
  4 + * copyright (C) 2013-2019 by Chia-Chun Lu & Christoph Deil *
5 5 * ----------------------------------------------------------------------- *
6 6 * *
7 7 * This program is free software: you can redistribute it and/or modify *
... ... @@ -3269,7 +3269,7 @@ double GCTAOnOffObservation::wstat_value(const double&amp; non,
3269 3269  
3270 3270 // Special case non = 0
3271 3271 else if (non == 0.0) {
3272   - nbgd = 0;
  3272 + nbgd = noff / alphap1;
3273 3273 nonpred = ngam + alpharat * noff;
3274 3274 logL = ngam + noff * std::log(alphap1);
3275 3275 dlogLdsky = 1.0;
... ...