Commit c2a1beec95ee428a276dbe0343ac902672a59598

Authored by Jürgen Knödlseder
1 parent 7596367e

Reduce scope of f2 in GCTACubeBackground::fill

inst/cta/src/GCTACubeBackground.cpp
1 1 /***************************************************************************
2 2 * GCTACubeBackground.cpp - CTA cube background class *
3 3 * ----------------------------------------------------------------------- *
4   - * copyright (C) 2015-2018 by Michael Mayer *
  4 + * copyright (C) 2015-2020 by Michael Mayer *
5 5 * ----------------------------------------------------------------------- *
6 6 * *
7 7 * This program is free software: you can redistribute it and/or modify *
... ... @@ -468,7 +468,6 @@ void GCTACubeBackground::fill(const GObservations& obs, GLog* log)
468 468  
469 469 // Initialise values for integration over energy bin
470 470 double f1 = 0.0;
471   - double f2 = 0.0;
472 471  
473 472 // Loop over all energy bins of the cube
474 473 for (int iebin = 0, ibin = ipix; iebin < nebins; ++iebin, ibin += npix) {
... ... @@ -485,7 +484,7 @@ void GCTACubeBackground::fill(const GObservations&amp; obs, GLog* log)
485 484 GCTAEventBin* bin = eventcube[ibin];
486 485 bin->dir(dir); // Set instrument direction
487 486 bin->energy(m_ebounds.emax(iebin));
488   - f2 = obs.models().eval(*bin, *cta);
  487 + double f2 = obs.models().eval(*bin, *cta);
489 488  
490 489 // Add background model value to cube if the energy bin is
491 490 // fully container in the observation interval and if both f1
... ...