Commit 7596367ebf24ebea919b2f906fe11ede8600d3a6

Authored by Jürgen Knödlseder
1 parent c6b37d62

Put unused variables in optional compile statement

Showing 1 changed file with 15 additions and 3 deletions
inst/com/src/GCOMIaq.cpp
1 1 /***************************************************************************
2 2 * GCOMIaq.cpp - COMPTEL instrument response representation *
3 3 * ----------------------------------------------------------------------- *
4   - * copyright (C) 2017-2019 by Juergen Knoedlseder *
  4 + * copyright (C) 2017-2020 by Juergen Knoedlseder *
5 5 * ----------------------------------------------------------------------- *
6 6 * *
7 7 * This program is free software: you can redistribute it and/or modify *
... ... @@ -342,8 +342,10 @@ void GCOMIaq::set(const GModelSpectral& spectrum, const GEbounds& ebounds)
342 342 double weight = spectrum.flux(ebds.emin(i), ebds.emax(i)) /
343 343 flux_total;
344 344  
345   - // Initialise sum
  345 + // Debug: Initialise sum
  346 + #if defined(G_DEBUG_SET_CONTINUUM)
346 347 double sum = 0.0;
  348 + #endif
347 349  
348 350 // Continue only if we have weight
349 351 if (weight > 0.0) {
... ... @@ -361,12 +363,14 @@ void GCOMIaq::set(const GModelSpectral& spectrum, const GEbounds& ebounds)
361 363 for (int k = 0; k < iaq.npix(); ++k) {
362 364 double value = m_iaq(k) * weight;
363 365 iaq(k) += value;
  366 + #if defined(G_DEBUG_SET_CONTINUUM)
364 367 sum += value;
  368 + #endif
365 369 }
366 370  
367 371 } // endif: we has weight
368 372  
369   - // Debug
  373 + // Debug: print results
370 374 #if defined(G_DEBUG_SET_CONTINUUM)
371 375 std::cout << "Energy=" << energy;
372 376 std::cout << " weight=" << weight;
... ... @@ -1171,10 +1175,14 @@ void GCOMIaq::location_smearing(const double&amp; zenith)
1171 1175  
1172 1176 // Copy phigeo vector
1173 1177 std::vector<double> values;
  1178 + #if defined(G_DEBUG_LOCATION_SMEARING)
1174 1179 double sum_before = 0.0;
  1180 + #endif
1175 1181 for (int i_phigeo = 0; i_phigeo < n_phigeo; ++i_phigeo) {
1176 1182 values.push_back(m_iaq(i_phigeo, i_phibar));
  1183 + #if defined(G_DEBUG_LOCATION_SMEARING)
1177 1184 sum_before += m_iaq(i_phigeo, i_phibar);
  1185 + #endif
1178 1186 }
1179 1187  
1180 1188 // Compute convolution integral for each phigeo pixel
... ... @@ -1211,10 +1219,14 @@ void GCOMIaq::location_smearing(const double&amp; zenith)
1211 1219 } // endfor: convolution integral
1212 1220  
1213 1221 // Restore phigeo vector
  1222 + #if defined(G_DEBUG_LOCATION_SMEARING)
1214 1223 double sum_after = 0.0;
  1224 + #endif
1215 1225 for (int i_phigeo = 0; i_phigeo < n_phigeo; ++i_phigeo) {
1216 1226 m_iaq(i_phigeo, i_phibar) = convolved_values[i_phigeo];
  1227 + #if defined(G_DEBUG_LOCATION_SMEARING)
1217 1228 sum_after += convolved_values[i_phigeo];
  1229 + #endif
1218 1230 }
1219 1231  
1220 1232 // Debug
... ...