Commit d57238122ac96c95925c51a7d3538124e5bdc8ec
1 parent
8859a6e9
Add n_off=0 special case to significance computation in ctskymap
Showing
1 changed file
with
5 additions
and
0 deletions
src/ctskymap/ctskymap.cpp
| @@ -1631,6 +1631,11 @@ double ctskymap::sigma_li_ma(const double& n_on, | @@ -1631,6 +1631,11 @@ double ctskymap::sigma_li_ma(const double& n_on, | ||
| 1631 | sigma = -2.0 * n_off * std::log(1.0+alpha); | 1631 | sigma = -2.0 * n_off * std::log(1.0+alpha); |
| 1632 | } | 1632 | } |
| 1633 | 1633 | ||
| 1634 | + // Handle special case of no Off-counts | ||
| 1635 | + else if (n_off == 0.0) { | ||
| 1636 | + sigma = 2.0 * n_on * std::log((1.0+alpha)/alpha); | ||
| 1637 | + } | ||
| 1638 | + | ||
| 1634 | // ... otherwise handle general case | 1639 | // ... otherwise handle general case |
| 1635 | else { | 1640 | else { |
| 1636 | sigma = (n_on < (alpha*n_off) ? -2.0 : 2.0) * | 1641 | sigma = (n_on < (alpha*n_off) ? -2.0 : 2.0) * |