Commit dabe9da8baa1e48bd545892d95e3a71e972ea826

Authored by Jürgen Knödlseder
1 parent 79d77c05

Use true energy for all CTA response cube computation (#2461)

inst/cta/src/GCTAResponseCube.cpp
@@ -1199,6 +1199,9 @@ double GCTAResponseCube::irf_ptsrc(const GEvent& event, @@ -1199,6 +1199,9 @@ double GCTAResponseCube::irf_ptsrc(const GEvent& event,
1199 * @return Instrument response to radial source. 1199 * @return Instrument response to radial source.
1200 * 1200 *
1201 * Returns the instrument response to a specified radial source. 1201 * Returns the instrument response to a specified radial source.
  1202 + *
  1203 + * @todo Correct assumptions in exposure computation, PSF computation and
  1204 + * energy dispersion computation.
1202 ***************************************************************************/ 1205 ***************************************************************************/
1203 double GCTAResponseCube::irf_radial(const GEvent& event, 1206 double GCTAResponseCube::irf_radial(const GEvent& event,
1204 const GSource& source, 1207 const GSource& source,
@@ -1249,7 +1252,7 @@ double GCTAResponseCube::irf_radial(const GEvent& event, @@ -1249,7 +1252,7 @@ double GCTAResponseCube::irf_radial(const GEvent& event,
1249 // true event direction does not vary significantly. In other words, 1252 // true event direction does not vary significantly. In other words,
1250 // the code assumes that the exposure is constant over the size of 1253 // the code assumes that the exposure is constant over the size of
1251 // the PSF. 1254 // the PSF.
1252 - irf = exposure()(obsDir, obsEng); 1255 + irf = exposure()(obsDir, srcEng);
1253 1256
1254 // Continue only if exposure is positive 1257 // Continue only if exposure is positive
1255 if (irf > 0.0) { 1258 if (irf > 0.0) {
@@ -1258,7 +1261,7 @@ double GCTAResponseCube::irf_radial(const GEvent& event, @@ -1258,7 +1261,7 @@ double GCTAResponseCube::irf_radial(const GEvent& event,
1258 irf /= livetime; 1261 irf /= livetime;
1259 1262
1260 // Get PSF component 1263 // Get PSF component
1261 - irf *= psf_radial(model, rho_obs, obsDir, obsEng, obsTime); 1264 + irf *= psf_radial(model, rho_obs, obsDir, srcEng, obsTime);
1262 1265
1263 // Multiply-in energy dispersion 1266 // Multiply-in energy dispersion
1264 if (use_edisp() && irf > 0.0) { 1267 if (use_edisp() && irf > 0.0) {
@@ -1304,6 +1307,9 @@ double GCTAResponseCube::irf_radial(const GEvent& event, @@ -1304,6 +1307,9 @@ double GCTAResponseCube::irf_radial(const GEvent& event,
1304 * @return Instrument response to elliptical source. 1307 * @return Instrument response to elliptical source.
1305 * 1308 *
1306 * Returns the instrument response to a specified elliptical source. 1309 * Returns the instrument response to a specified elliptical source.
  1310 + *
  1311 + * @todo Correct assumptions in exposure computation, PSF computation and
  1312 + * energy dispersion computation.
1307 ***************************************************************************/ 1313 ***************************************************************************/
1308 double GCTAResponseCube::irf_elliptical(const GEvent& event, 1314 double GCTAResponseCube::irf_elliptical(const GEvent& event,
1309 const GSource& source, 1315 const GSource& source,
@@ -1354,7 +1360,7 @@ double GCTAResponseCube::irf_elliptical(const GEvent& event, @@ -1354,7 +1360,7 @@ double GCTAResponseCube::irf_elliptical(const GEvent& event,
1354 // true event direction does not vary significantly. In other words, 1360 // true event direction does not vary significantly. In other words,
1355 // the code assumes that the exposure is constant over the size of 1361 // the code assumes that the exposure is constant over the size of
1356 // the PSF. 1362 // the PSF.
1357 - irf = exposure()(obsDir, obsEng); 1363 + irf = exposure()(obsDir, srcEng);
1358 1364
1359 // Continue only if exposure is positive 1365 // Continue only if exposure is positive
1360 if (irf > 0.0) { 1366 if (irf > 0.0) {
@@ -1363,7 +1369,7 @@ double GCTAResponseCube::irf_elliptical(const GEvent& event, @@ -1363,7 +1369,7 @@ double GCTAResponseCube::irf_elliptical(const GEvent& event,
1363 irf /= livetime; 1369 irf /= livetime;
1364 1370
1365 // Get PSF component 1371 // Get PSF component
1366 - irf *= psf_elliptical(model, rho_obs, posangle_obs, obsDir, obsEng, obsTime); 1372 + irf *= psf_elliptical(model, rho_obs, posangle_obs, obsDir, srcEng, obsTime);
1367 1373
1368 // Multiply-in energy dispersion 1374 // Multiply-in energy dispersion
1369 if (use_edisp() && irf > 0.0) { 1375 if (use_edisp() && irf > 0.0) {