From c2a1beec95ee428a276dbe0343ac902672a59598 Mon Sep 17 00:00:00 2001 From: Jürgen Knödlseder Date: Thu, 9 Jul 2020 15:45:08 +0200 Subject: [PATCH] Reduce scope of f2 in GCTACubeBackground::fill --- inst/cta/src/GCTACubeBackground.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/inst/cta/src/GCTACubeBackground.cpp b/inst/cta/src/GCTACubeBackground.cpp index c6c4098..7ac7a7c 100644 --- a/inst/cta/src/GCTACubeBackground.cpp +++ b/inst/cta/src/GCTACubeBackground.cpp @@ -1,7 +1,7 @@ /*************************************************************************** * GCTACubeBackground.cpp - CTA cube background class * * ----------------------------------------------------------------------- * - * copyright (C) 2015-2018 by Michael Mayer * + * copyright (C) 2015-2020 by Michael Mayer * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -468,7 +468,6 @@ void GCTACubeBackground::fill(const GObservations& obs, GLog* log) // Initialise values for integration over energy bin double f1 = 0.0; - double f2 = 0.0; // Loop over all energy bins of the cube for (int iebin = 0, ibin = ipix; iebin < nebins; ++iebin, ibin += npix) { @@ -485,7 +484,7 @@ void GCTACubeBackground::fill(const GObservations& obs, GLog* log) GCTAEventBin* bin = eventcube[ibin]; bin->dir(dir); // Set instrument direction bin->energy(m_ebounds.emax(iebin)); - f2 = obs.models().eval(*bin, *cta); + double f2 = obs.models().eval(*bin, *cta); // Add background model value to cube if the energy bin is // fully container in the observation interval and if both f1 -- libgit2 0.21.4