Commit 0f741cdd3893440f7904b8b29d33cfbdfeefed5e

Authored by Jürgen Knödlseder
1 parent 5a80b6d4

Make sure that DETX/DETY are computed in GCTACubeBackground::fill

inst/cta/src/GCTACubeBackground.cpp
... ... @@ -460,6 +460,10 @@ void GCTACubeBackground::fill(const GObservations& obs, GLog* log)
460 460 continue;
461 461 }
462 462  
  463 + // Get CTA direction for this bin, including sky direction and
  464 + // DETX/DETY coordinates
  465 + GCTAInstDir dir = cta->pointing().instdir(bin->dir().dir());
  466 +
463 467 // Initialise values for integration over energy bin
464 468 double f1 = 0.0;
465 469 double f2 = 0.0;
... ... @@ -470,12 +474,14 @@ void GCTACubeBackground::fill(const GObservations& obs, GLog* log)
470 474 // If this is the first bin then compute f1 at the lower bin edge
471 475 if (iebin == 0) {
472 476 GCTAEventBin* bin = eventcube[ibin];
  477 + bin->dir(dir); // Set instrument direction
473 478 bin->energy(m_ebounds.emin(iebin));
474 479 f1 = obs.models().eval(*bin, *cta);
475 480 }
476 481  
477 482 // Compute f2 at the upper bin edge
478 483 GCTAEventBin* bin = eventcube[ibin];
  484 + bin->dir(dir); // Set instrument direction
479 485 bin->energy(m_ebounds.emax(iebin));
480 486 f2 = obs.models().eval(*bin, *cta);
481 487  
... ...