diff --git a/src/ctbin/ctbin.cpp b/src/ctbin/ctbin.cpp index 13e8f07..8dce155 100644 --- a/src/ctbin/ctbin.cpp +++ b/src/ctbin/ctbin.cpp @@ -40,6 +40,9 @@ /* __ Coding definitions _________________________________________________ */ +/* __ Constants __________________________________________________________ */ +const GEnergy g_energy_margin(1.0e-12, "TeV"); + /*========================================================================== = = @@ -530,8 +533,8 @@ void ctbin::fill_cube(GCTAObservation* obs) // Determine energy bin. Skip if we are outside the energy range int index = m_ebounds.index(event->energy()); if (index == -1 || - !obs_ebounds.contains(m_ebounds.emin(index), - m_ebounds.emax(index))) { + !obs_ebounds.contains(m_ebounds.emin(index)+g_energy_margin, + m_ebounds.emax(index)-g_energy_margin)) { num_outside_ebds++; continue; } diff --git a/src/ctmodel/ctmodel.cpp b/src/ctmodel/ctmodel.cpp index 7777c33..9aa8bda 100644 --- a/src/ctmodel/ctmodel.cpp +++ b/src/ctmodel/ctmodel.cpp @@ -39,6 +39,9 @@ /* __ Coding definitions _________________________________________________ */ +/* __ Constants __________________________________________________________ */ +const GEnergy g_energy_margin(1.0e-12, "TeV"); + /*========================================================================== = = @@ -617,8 +620,8 @@ void ctmodel::fill_cube(const GCTAObservation* obs) // Skip bin if it is outside the energy range of the observation int index = cube_ebounds.index(bin->energy()); if (index == -1 || - !obs_ebounds.contains(cube_ebounds.emin(index), - cube_ebounds.emax(index))) { + !obs_ebounds.contains(cube_ebounds.emin(index)+g_energy_margin, + cube_ebounds.emax(index)-g_energy_margin)) { num_outside_ebds++; continue; }