From bf27cf6fb126bd8101d7c96557b005166a7e96dd Mon Sep 17 00:00:00 2001 From: knodlseder <> Date: Thu, 8 Sep 2011 06:30:21 +0000 Subject: [PATCH] make sure that Aeff is not negative --- inst/lat/src/GLATAeff.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+), 0 deletions(-) diff --git a/inst/lat/src/GLATAeff.cpp b/inst/lat/src/GLATAeff.cpp index 7c9e871..6e5249d 100644 --- a/inst/lat/src/GLATAeff.cpp +++ b/inst/lat/src/GLATAeff.cpp @@ -164,6 +164,11 @@ double GLATAeff::operator() (const double& logE, const double& ctheta) double aeff = (ctheta >= m_min_ctheta) ? m_aeff_bins.interpolate(logE, ctheta, m_aeff) : 0.0; + // Make sure that effective area is not negative + if (aeff < 0.0) { + aeff = 0.0; + } + // Return effective area value return aeff; } @@ -185,6 +190,11 @@ double GLATAeff::operator() (const double& logE, const double& ctheta, double aeff = (ctheta >= m_min_ctheta) ? m_aeff_bins.interpolate(logE, ctheta, m_aeff) : 0.0; + // Make sure that effective area is not negative + if (aeff < 0.0) { + aeff = 0.0; + } + // Return effective area value return aeff; } -- libgit2 0.21.4