diff --git a/inst/cta/src/GCTAAeffArf.cpp b/inst/cta/src/GCTAAeffArf.cpp index c9372e5..65e7840 100644 --- a/inst/cta/src/GCTAAeffArf.cpp +++ b/inst/cta/src/GCTAAeffArf.cpp @@ -377,7 +377,7 @@ void GCTAAeffArf::remove_thetacut(const GCTAResponseIrf& rsp) for (int i = 0; i < m_aeff.size(); ++i) { // Setup integration kernel for on-axis PSF - cta_npsf_kern_rad_azsym integrand(rsp, + cta_npsf_kern_rad_azsym integrand(&rsp, rmax, 0.0, m_logE[i], diff --git a/inst/cta/src/GCTACubeSourceDiffuse.cpp b/inst/cta/src/GCTACubeSourceDiffuse.cpp index cadceb0..0506126 100644 --- a/inst/cta/src/GCTACubeSourceDiffuse.cpp +++ b/inst/cta/src/GCTACubeSourceDiffuse.cpp @@ -382,8 +382,9 @@ double GCTACubeSourceDiffuse::psf(const GCTAResponseCube* rsp, // Setup integration kernel. We take here the observed photon arrival // direction as the true photon arrival direction because the PSF does // not vary significantly over a small region. - cta_psf_diffuse_kern_delta integrand(rsp, model, obsDir, srcEng, srcTime, - rot, iter_phi); + cta_psf_diffuse_kern_delta integrand(rsp, model, &rot, + obsDir, srcEng, srcTime, + iter_phi); // Setup integration GIntegral integral(&integrand); diff --git a/inst/cta/src/GCTAResponseIrf.cpp b/inst/cta/src/GCTAResponseIrf.cpp index d1b1dc8..c33b705 100644 --- a/inst/cta/src/GCTAResponseIrf.cpp +++ b/inst/cta/src/GCTAResponseIrf.cpp @@ -498,7 +498,7 @@ double GCTAResponseIrf::nroi(const GModelSky& model, if (emax > emin) { // Setup integration function - cta_nroi_kern integrand(model, *this, srcTime, obsEng, obsTime, obs); + cta_nroi_kern integrand(this, &obs, &model, srcTime, obsEng, obsTime); GIntegral integral(&integrand); // Set fixed number of iterations @@ -1852,7 +1852,7 @@ double GCTAResponseIrf::npsf(const GSkyDir& srcDir, if (rmax > rmin) { // Setup integration kernel - cta_npsf_kern_rad_azsym integrand(*this, + cta_npsf_kern_rad_azsym integrand(this, roi_radius, roi_psf_distance, srcLogEng, @@ -2208,8 +2208,8 @@ double GCTAResponseIrf::irf_radial(const GEvent& event, if (rho_max > rho_min) { // Setup integration kernel - cta_irf_radial_kern_rho integrand(*this, - *model, + cta_irf_radial_kern_rho integrand(this, + model, zenith, azimuth, srcEng, @@ -2423,8 +2423,8 @@ double GCTAResponseIrf::irf_elliptical(const GEvent& event, if (rho_max > rho_min) { // Setup integration kernel - cta_irf_elliptical_kern_rho integrand(*this, - *model, + cta_irf_elliptical_kern_rho integrand(this, + model, semimajor, semiminor, posangle, @@ -2617,8 +2617,9 @@ double GCTAResponseIrf::irf_diffuse(const GEvent& event, GMatrix rot = (ry * rz).transpose(); // Setup integration kernel - cta_irf_diffuse_kern_theta integrand(*this, - *model, + cta_irf_diffuse_kern_theta integrand(this, + model, + &rot, theta, phi, zenith, @@ -2627,7 +2628,6 @@ double GCTAResponseIrf::irf_diffuse(const GEvent& event, srcTime, srcLogEng, obsEng, - rot, eta, iter_phi); @@ -2828,14 +2828,14 @@ double GCTAResponseIrf::nroi_radial(const GModelSky& model, double omega0 = centre.posang(roi.centre().dir()); // Setup integration kernel - cta_nroi_radial_kern_rho integrand(*this, - *spatial, + cta_nroi_radial_kern_rho integrand(this, + &cta, + spatial, + &rot, srcEng, srcTime, obsEng, obsTime, - cta, - rot, roi_model_distance, roi_psf_radius, omega0, @@ -3033,8 +3033,10 @@ double GCTAResponseIrf::nroi_elliptical(const GModelSky& model, double posangle_roi = centre.posang(roi.centre().dir()); // Setup integration kernel - cta_nroi_elliptical_kern_rho integrand(*this, - *spatial, + cta_nroi_elliptical_kern_rho integrand(this, + &cta, + spatial, + &rot, semimajor, semiminor, posangle, @@ -3042,8 +3044,6 @@ double GCTAResponseIrf::nroi_elliptical(const GModelSky& model, srcTime, obsEng, obsTime, - cta, - rot, rho_roi, posangle_roi, radius_roi, @@ -3213,14 +3213,14 @@ double GCTAResponseIrf::nroi_diffuse(const GModelSky& model, GMatrix rot = (ry * rz).transpose(); // Setup integration kernel - cta_nroi_diffuse_kern_theta integrand(*this, - *spatial, + cta_nroi_diffuse_kern_theta integrand(this, + &cta, + spatial, + &rot, srcEng, srcTime, obsEng, obsTime, - cta, - rot, iter_phi); // Integrate over model's zenith angle diff --git a/inst/cta/src/GCTAResponse_helpers.cpp b/inst/cta/src/GCTAResponse_helpers.cpp index ab499ee..d4cc4c8 100644 --- a/inst/cta/src/GCTAResponse_helpers.cpp +++ b/inst/cta/src/GCTAResponse_helpers.cpp @@ -199,8 +199,8 @@ double cta_npsf_kern_rad_azsym::eval(const double& delta) if (phi > 0) { // Compute PSF value - value = m_rsp.psf(delta, m_theta, m_phi, m_zenith, m_azimuth, m_logE) * - phi * std::sin(delta); + value = m_rsp->psf(delta, m_theta, m_phi, m_zenith, m_azimuth, m_logE) * + phi * std::sin(delta); // Compile option: Check for NaN/Inf #if defined(G_NAN_CHECK) @@ -235,9 +235,9 @@ double cta_nroi_kern::eval(const double& logEsrc) srcEng.MeV(expx); // Compute response components - double nroi_spatial = m_rsp.nroi(m_model, srcEng, m_srcTime, m_obsEng, m_obsTime, m_obs); - double nroi_spectral = m_model.spectral()->eval(srcEng, m_srcTime); - double nroi_temporal = m_model.temporal()->eval(m_srcTime); + double nroi_spatial = m_rsp->nroi(*m_model, srcEng, m_srcTime, m_obsEng, m_obsTime, *m_obs); + double nroi_spectral = m_model->spectral()->eval(srcEng, m_srcTime); + double nroi_temporal = m_model->temporal()->eval(m_srcTime); // Compute response double nroi = nroi_spatial * nroi_spectral * nroi_temporal * expx; @@ -301,7 +301,7 @@ double cta_irf_radial_kern_rho::eval(const double& rho) } // Evaluate sky model - double model = m_model.eval(rho_kluge, m_srcEng, m_srcTime); + double model = m_model->eval(rho_kluge, m_srcEng, m_srcTime); // Debug: test if model is non positive #if defined(G_DEBUG_MODEL_ZERO) @@ -422,12 +422,12 @@ double cta_irf_radial_kern_omega::eval(const double& omega) double azimuth = 0.0; // Evaluate IRF - double irf = m_rsp.aeff(offset, azimuth, m_zenith, m_azimuth, m_srcLogEng) * - m_rsp.psf(delta, offset, azimuth, m_zenith, m_azimuth, m_srcLogEng); + double irf = m_rsp->aeff(offset, azimuth, m_zenith, m_azimuth, m_srcLogEng) * + m_rsp->psf(delta, offset, azimuth, m_zenith, m_azimuth, m_srcLogEng); // Optionally take energy dispersion into account - if (m_rsp.use_edisp() && irf > 0.0) { - irf *= m_rsp.edisp(m_obsEng, offset, azimuth, m_zenith, m_azimuth, m_srcLogEng); + if (m_rsp->use_edisp() && irf > 0.0) { + irf *= m_rsp->edisp(m_obsEng, offset, azimuth, m_zenith, m_azimuth, m_srcLogEng); } // Compile option: Check for NaN/Inf @@ -499,7 +499,7 @@ double cta_nroi_radial_kern_rho::eval(const double& rho) } // Get radial model value - double model = m_model.eval(rho_kluge, m_srcEng, m_srcTime); + double model = m_model->eval(rho_kluge, m_srcEng, m_srcTime); // Debug: test if model is non positive #if defined(G_DEBUG_MODEL_ZERO) @@ -521,12 +521,12 @@ double cta_nroi_radial_kern_rho::eval(const double& rho) // Setup phi integration kernel cta_nroi_radial_kern_omega integrand(m_rsp, + m_obs, + m_rot, m_srcEng, m_srcTime, m_obsEng, m_obsTime, - m_obs, - m_rot, sin_rho, cos_rho); @@ -578,7 +578,7 @@ double cta_nroi_radial_kern_omega::eval(const double& omega) GVector native(-cos_omega*m_sin_rho, sin_omega*m_sin_rho, m_cos_rho); // Rotate from native into celestial system - GVector cel = m_rot * native; + GVector cel = *m_rot * native; // Set sky direction GSkyDir srcDir; @@ -588,7 +588,7 @@ double cta_nroi_radial_kern_omega::eval(const double& omega) GPhoton photon(srcDir, m_srcEng, m_srcTime); // Compute point source Nroi for this sky direction - double nroi = m_rsp.nirf(photon, m_obsEng, m_obsTime, m_obs); + double nroi = m_rsp->nirf(photon, m_obsEng, m_obsTime, *m_obs); // Debug: Check for NaN #if defined(G_NAN_CHECK) @@ -850,14 +850,14 @@ double cta_irf_elliptical_kern_omega::eval(const double& omega) double omega_model = omega + m_posangle_obs; // Evaluate sky model - double model = m_model.eval(m_rho, omega_model, m_srcEng, m_srcTime); + double model = m_model->eval(m_rho, omega_model, m_srcEng, m_srcTime); // Debug: test if model is non positive #if defined(G_DEBUG_MODEL_ZERO) if (model <= 0.0) { - double m_semiminor_rad = m_model.semiminor() * gammalib::deg2rad; - double m_semimajor_rad = m_model.semimajor() * gammalib::deg2rad; - double diff_angle = omega_model - m_model.posangle() * gammalib::deg2rad; + double m_semiminor_rad = m_model->semiminor() * gammalib::deg2rad; + double m_semimajor_rad = m_model->semimajor() * gammalib::deg2rad; + double diff_angle = omega_model - m_model->posangle() * gammalib::deg2rad; double cosinus = std::cos(diff_angle); double sinus = std::sin(diff_angle); double arg1 = m_semiminor_rad * cosinus; @@ -885,14 +885,14 @@ double cta_irf_elliptical_kern_omega::eval(const double& omega) double phi = 0.0; //TODO: Implement IRF Phi dependence // Evaluate IRF * model - irf = m_rsp.aeff(theta, phi, m_zenith, m_azimuth, m_srcLogEng) * - m_rsp.psf(delta, theta, phi, m_zenith, m_azimuth, m_srcLogEng) * + irf = m_rsp->aeff(theta, phi, m_zenith, m_azimuth, m_srcLogEng) * + m_rsp->psf(delta, theta, phi, m_zenith, m_azimuth, m_srcLogEng) * model; // Optionally take energy dispersion into account - if (m_rsp.use_edisp() && irf > 0.0) { - irf *= m_rsp.edisp(m_obsEng, theta, phi, - m_zenith, m_azimuth, m_srcLogEng); + if (m_rsp->use_edisp() && irf > 0.0) { + irf *= m_rsp->edisp(m_obsEng, theta, phi, + m_zenith, m_azimuth, m_srcLogEng); } // Compile option: Check for NaN/Inf @@ -979,13 +979,13 @@ double cta_nroi_elliptical_kern_rho::eval(const double& rho) // Setup phi integration kernel cta_nroi_elliptical_kern_omega integrand(m_rsp, + m_obs, m_model, + m_rot, m_srcEng, m_srcTime, m_obsEng, m_obsTime, - m_obs, - m_rot, rho_kluge, sin_rho, cos_rho, @@ -1123,14 +1123,14 @@ double cta_nroi_elliptical_kern_omega::eval(const double& omega) double omega_model = omega + m_posangle_roi; // Evaluate sky model - double model = m_model.eval(m_rho, omega_model, m_srcEng, m_srcTime); + double model = m_model->eval(m_rho, omega_model, m_srcEng, m_srcTime); // Debug: test if model is non positive #if defined(G_DEBUG_MODEL_ZERO) if (model <= 0.0) { - double m_semiminor_rad = m_model.semiminor() * gammalib::deg2rad; - double m_semimajor_rad = m_model.semimajor() * gammalib::deg2rad; - double diff_angle = omega_model - m_model.posangle() * gammalib::deg2rad; + double m_semiminor_rad = m_model->semiminor() * gammalib::deg2rad; + double m_semimajor_rad = m_model->semimajor() * gammalib::deg2rad; + double diff_angle = omega_model - m_model->posangle() * gammalib::deg2rad; double cosinus = std::cos(diff_angle); double sinus = std::sin(diff_angle); double arg1 = m_semiminor_rad * cosinus; @@ -1155,7 +1155,7 @@ double cta_nroi_elliptical_kern_omega::eval(const double& omega) GVector native(-cos_omega*m_sin_rho, sin_omega*m_sin_rho, m_cos_rho); // Rotate from native into celestial system - GVector cel = m_rot * native; + GVector cel = *m_rot * native; // Set sky direction GSkyDir srcDir; @@ -1165,7 +1165,7 @@ double cta_nroi_elliptical_kern_omega::eval(const double& omega) GPhoton photon(srcDir, m_srcEng, m_srcTime); // Compute Nroi for this sky direction - nroi = m_rsp.nirf(photon, m_obsEng, m_obsTime, m_obs) * model; + nroi = m_rsp->nirf(photon, m_obsEng, m_obsTime, *m_obs) * model; // Debug: Check for NaN #if defined(G_NAN_CHECK) @@ -1228,7 +1228,7 @@ double cta_irf_diffuse_kern_theta::eval(const double& theta) // integration as the PSF is so far azimuthally symmetric. Once // we introduce asymmetries, we have to move this done into the // Phi kernel method/ - double psf = m_rsp.psf(theta, m_theta, m_phi, m_zenith, m_azimuth, m_srcLogEng); + double psf = m_rsp->psf(theta, m_theta, m_phi, m_zenith, m_azimuth, m_srcLogEng); // Continue only if PSF is positive if (psf > 0.0) { @@ -1244,13 +1244,13 @@ double cta_irf_diffuse_kern_theta::eval(const double& theta) // Setup kernel for azimuthal integration cta_irf_diffuse_kern_phi integrand(m_rsp, m_model, + m_rot, m_zenith, m_azimuth, m_srcEng, m_srcTime, m_srcLogEng, m_obsEng, - m_rot, sin_theta, cos_theta, sin_ph, @@ -1335,14 +1335,14 @@ double cta_irf_diffuse_kern_phi::eval(const double& phi) GVector native(-cos_phi*m_sin_theta, sin_phi*m_sin_theta, m_cos_theta); // Rotate from native into celestial system - GVector cel = m_rot * native; + GVector cel = *m_rot * native; // Set sky direction GSkyDir srcDir; srcDir.celvector(cel); // Get sky intensity for this sky direction - double intensity = m_model.eval(GPhoton(srcDir, m_srcEng, m_srcTime)); + double intensity = m_model->eval(GPhoton(srcDir, m_srcEng, m_srcTime)); // Continue only if sky intensity is positive if (intensity > 0.0) { @@ -1355,12 +1355,12 @@ double cta_irf_diffuse_kern_phi::eval(const double& phi) // Evaluate model times the effective area irf = intensity * - m_rsp.aeff(offset, azimuth, m_zenith, m_azimuth, m_srcLogEng); + m_rsp->aeff(offset, azimuth, m_zenith, m_azimuth, m_srcLogEng); // Optionally take energy dispersion into account - if (m_rsp.use_edisp() && irf > 0.0) { - irf *= m_rsp.edisp(m_obsEng, offset, azimuth, - m_zenith, m_azimuth, m_srcLogEng); + if (m_rsp->use_edisp() && irf > 0.0) { + irf *= m_rsp->edisp(m_obsEng, offset, azimuth, + m_zenith, m_azimuth, m_srcLogEng); } // Compile option: Check for NaN/Inf @@ -1424,13 +1424,13 @@ double cta_nroi_diffuse_kern_theta::eval(const double& theta) // Setup phi integration kernel cta_nroi_diffuse_kern_phi integrand(m_rsp, + m_obs, m_model, + m_rot, m_srcEng, m_srcTime, m_obsEng, m_obsTime, - m_obs, - m_rot, theta, sin_theta); @@ -1491,7 +1491,7 @@ double cta_nroi_diffuse_kern_phi::eval(const double& phi) GVector native(-cos_phi*m_sin_theta, sin_phi*m_sin_theta, m_cos_theta); // Rotate from native into celestial system - GVector cel = m_rot * native; + GVector cel = *m_rot * native; // Set sky direction GSkyDir srcDir; @@ -1501,13 +1501,13 @@ double cta_nroi_diffuse_kern_phi::eval(const double& phi) GPhoton photon(srcDir, m_srcEng, m_srcTime); // Get sky intensity for this photon - double intensity = m_model.eval(photon); + double intensity = m_model->eval(photon); // Continue only if sky intensity is positive if (intensity > 0.0) { // Compute Nroi for this sky direction - nroi = m_rsp.nirf(photon, m_obsEng, m_obsTime, m_obs) * intensity; + nroi = m_rsp->nirf(photon, m_obsEng, m_obsTime, *m_obs) * intensity; // Debug: Check for NaN #if defined(G_NAN_CHECK) @@ -2181,8 +2181,8 @@ double cta_psf_diffuse_kern_delta::eval(const double& delta) double cos_delta = std::cos(delta); // Setup kernel for azimuthal integration of the diffuse model - cta_psf_diffuse_kern_phi integrand(m_model, m_srcEng, m_srcTime, - m_rot, + cta_psf_diffuse_kern_phi integrand(m_model, m_rot, + m_srcEng, m_srcTime, sin_delta, cos_delta); // Setup untegration @@ -2233,7 +2233,7 @@ double cta_psf_diffuse_kern_phi::eval(const double& phi) GVector native(-cos_phi*m_sin_delta, sin_phi*m_sin_delta, m_cos_delta); // Rotate from native into celestial system - GVector cel = m_rot * native; + GVector cel = *m_rot * native; // Set sky direction GSkyDir srcDir; diff --git a/inst/cta/src/GCTAResponse_helpers.hpp b/inst/cta/src/GCTAResponse_helpers.hpp index ddbad40..921e335 100644 --- a/inst/cta/src/GCTAResponse_helpers.hpp +++ b/inst/cta/src/GCTAResponse_helpers.hpp @@ -20,7 +20,7 @@ ***************************************************************************/ /** * @file GCTAResponse_helpers.hpp - * @brief CTA response hepler classes definition + * @brief CTA response helper classes definition * @author Juergen Knoedlseder */ @@ -74,7 +74,7 @@ namespace gammalib { ***************************************************************************/ class cta_npsf_kern_rad_azsym : public GFunction { public: - cta_npsf_kern_rad_azsym(const GCTAResponseIrf& rsp, + cta_npsf_kern_rad_azsym(const GCTAResponseIrf* rsp, const double& roi, const double& psf, const double& logE, @@ -95,7 +95,7 @@ public: m_azimuth(azimuth) { } double eval(const double& delta); protected: - const GCTAResponseIrf& m_rsp; //!< CTA response function + const GCTAResponseIrf* m_rsp; //!< CTA response function double m_roi; //!< ROI radius in radians double m_cosroi; //!< Cosine of ROI radius double m_psf; //!< PSF-ROI centre distance in radians @@ -121,26 +121,26 @@ protected: ***************************************************************************/ class cta_nroi_kern : public GFunction { public: - cta_nroi_kern(const GModelSky& model, - const GCTAResponseIrf& rsp, + cta_nroi_kern(const GCTAResponseIrf* rsp, + const GObservation* obs, + const GModelSky* model, const GTime& srcTime, const GEnergy& obsEng, - const GTime& obsTime, - const GObservation& obs) : - m_model(model), + const GTime& obsTime) : m_rsp(rsp), + m_obs(obs), + m_model(model), m_srcTime(srcTime), m_obsEng(obsEng), - m_obsTime(obsTime), - m_obs(obs) {} + m_obsTime(obsTime) {} double eval(const double& logEsrc); protected: - const GModelSky& m_model; - const GCTAResponseIrf& m_rsp; //!< CTA response function - const GObservation& m_obs; - GTime m_srcTime; - GEnergy m_obsEng; - GTime m_obsTime; + const GCTAResponseIrf* m_rsp; //!< CTA response function + const GObservation* m_obs; //!< Observation + const GModelSky* m_model; //!< Sky model + GTime m_srcTime; //!< True arrival time + GEnergy m_obsEng; //!< Measured energy + GTime m_obsTime; //!< Measured arrival time }; @@ -174,8 +174,8 @@ protected: ***************************************************************************/ class cta_irf_radial_kern_rho : public GFunction { public: - cta_irf_radial_kern_rho(const GCTAResponseIrf& rsp, - const GModelSpatialRadial& model, + cta_irf_radial_kern_rho(const GCTAResponseIrf* rsp, + const GModelSpatialRadial* model, const double& zenith, const double& azimuth, const GEnergy& srcEng, @@ -207,8 +207,8 @@ public: m_iter(iter) { } double eval(const double& rho); protected: - const GCTAResponseIrf& m_rsp; //!< CTA response - const GModelSpatialRadial& m_model; //!< Radial spatial model + const GCTAResponseIrf* m_rsp; //!< CTA response + const GModelSpatialRadial* m_model; //!< Radial spatial model double m_zenith; //!< Zenith angle double m_azimuth; //!< Azimuth angle GEnergy m_srcEng; //!< True photon energy @@ -248,7 +248,7 @@ protected: ***************************************************************************/ class cta_irf_radial_kern_omega : public GFunction { public: - cta_irf_radial_kern_omega(const GCTAResponseIrf& rsp, + cta_irf_radial_kern_omega(const GCTAResponseIrf* rsp, const double& zenith, const double& azimuth, const double& srcLogEng, @@ -276,7 +276,7 @@ public: m_sin_ph(sin_ph) { } double eval(const double& omega); protected: - const GCTAResponseIrf& m_rsp; //!< CTA response + const GCTAResponseIrf* m_rsp; //!< CTA response double m_zenith; //!< Zenith angle double m_azimuth; //!< Azimuth angle double m_srcLogEng; //!< True photon energy @@ -324,26 +324,26 @@ protected: ***************************************************************************/ class cta_nroi_radial_kern_rho : public GFunction { public: - cta_nroi_radial_kern_rho(const GCTAResponseIrf& rsp, - const GModelSpatialRadial& model, + cta_nroi_radial_kern_rho(const GCTAResponseIrf* rsp, + const GCTAObservation* obs, + const GModelSpatialRadial* model, + const GMatrix* rot, const GEnergy& srcEng, const GTime& srcTime, const GEnergy& obsEng, const GTime& obsTime, - const GCTAObservation& obs, - const GMatrix& rot, const double& dist, const double& radius, const double& omega0, const int& iter) : m_rsp(rsp), + m_obs(obs), m_model(model), + m_rot(rot), m_srcEng(srcEng), m_srcTime(srcTime), m_obsEng(obsEng), m_obsTime(obsTime), - m_obs(obs), - m_rot(rot), m_dist(dist), m_cos_dist(std::cos(dist)), m_sin_dist(std::sin(dist)), @@ -353,10 +353,10 @@ public: m_iter(iter) { } double eval(const double& rho); protected: - const GCTAResponseIrf& m_rsp; //!< CTA response - const GModelSpatialRadial& m_model; //!< Radial spatial model - const GCTAObservation& m_obs; //!< CTA observation - const GMatrix& m_rot; //!< Rotation matrix + const GCTAResponseIrf* m_rsp; //!< CTA response + const GCTAObservation* m_obs; //!< CTA observation + const GModelSpatialRadial* m_model; //!< Radial spatial model + const GMatrix* m_rot; //!< Rotation matrix GEnergy m_srcEng; //!< True photon energy GTime m_srcTime; //!< True photon arrival time GEnergy m_obsEng; //!< Observed photon energy @@ -393,29 +393,29 @@ protected: ***************************************************************************/ class cta_nroi_radial_kern_omega : public GFunction { public: - cta_nroi_radial_kern_omega(const GCTAResponseIrf& rsp, + cta_nroi_radial_kern_omega(const GCTAResponseIrf* rsp, + const GCTAObservation* obs, + const GMatrix* rot, const GEnergy& srcEng, const GTime& srcTime, const GEnergy& obsEng, const GTime& obsTime, - const GCTAObservation& obs, - const GMatrix& rot, double sin_rho, double cos_rho) : m_rsp(rsp), + m_obs(obs), + m_rot(rot), m_srcEng(srcEng), m_srcTime(srcTime), m_obsEng(obsEng), m_obsTime(obsTime), - m_obs(obs), - m_rot(rot), m_cos_rho(cos_rho), m_sin_rho(sin_rho) { } double eval(const double& omega); protected: - const GCTAResponseIrf& m_rsp; //!< CTA response - const GCTAObservation& m_obs; //!< CTA observation - GMatrix m_rot; //!< Rotation matrix + const GCTAResponseIrf* m_rsp; //!< CTA response + const GCTAObservation* m_obs; //!< CTA observation + const GMatrix* m_rot; //!< Rotation matrix GEnergy m_srcEng; //!< True photon energy GTime m_srcTime; //!< True photon arrival time GEnergy m_obsEng; //!< Observed photon energy @@ -456,8 +456,8 @@ protected: ***************************************************************************/ class cta_irf_elliptical_kern_rho : public GFunction { public: - cta_irf_elliptical_kern_rho(const GCTAResponseIrf& rsp, - const GModelSpatialElliptical& model, + cta_irf_elliptical_kern_rho(const GCTAResponseIrf* rsp, + const GModelSpatialElliptical* model, const double& semimajor, const double& semiminor, const double& posangle, @@ -497,8 +497,8 @@ public: m_iter(iter) { } double eval(const double& rho); public: - const GCTAResponseIrf& m_rsp; //!< CTA response - const GModelSpatialElliptical& m_model; //!< Elliptical model + const GCTAResponseIrf* m_rsp; //!< CTA response + const GModelSpatialElliptical* m_model; //!< Elliptical model double m_semimajor; //!< Ellipse boundary semimajor axis double m_semiminor; //!< Ellipse boundary semiminor axis double m_posangle; //!< Ellipse boundary position angle @@ -543,8 +543,8 @@ public: ***************************************************************************/ class cta_irf_elliptical_kern_omega : public GFunction { public: - cta_irf_elliptical_kern_omega(const GCTAResponseIrf& rsp, - const GModelSpatialElliptical& model, + cta_irf_elliptical_kern_omega(const GCTAResponseIrf* rsp, + const GModelSpatialElliptical* model, const double& zenith, const double& azimuth, const GEnergy& srcEng, @@ -575,8 +575,8 @@ public: m_sin_ph(sin_ph) { } double eval(const double& omega); public: - const GCTAResponseIrf& m_rsp; //!< CTA response - const GModelSpatialElliptical& m_model; //!< Spatial model + const GCTAResponseIrf* m_rsp; //!< CTA response + const GModelSpatialElliptical* m_model; //!< Spatial model double m_zenith; //!< Zenith angle double m_azimuth; //!< Azimuth angle GEnergy m_srcEng; //!< True photon energy @@ -626,8 +626,10 @@ public: ***************************************************************************/ class cta_nroi_elliptical_kern_rho : public GFunction { public: - cta_nroi_elliptical_kern_rho(const GCTAResponseIrf& rsp, - const GModelSpatialElliptical& model, + cta_nroi_elliptical_kern_rho(const GCTAResponseIrf* rsp, + const GCTAObservation* obs, + const GModelSpatialElliptical* model, + const GMatrix* rot, const double& semimajor, const double& semiminor, const double& posangle, @@ -635,14 +637,14 @@ public: const GTime& srcTime, const GEnergy& obsEng, const GTime& obsTime, - const GCTAObservation& obs, - const GMatrix& rot, const double& rho_roi, const double& posangle_roi, const double& radius_roi, const int& iter) : m_rsp(rsp), + m_obs(obs), m_model(model), + m_rot(rot), m_semimajor(semimajor), m_semiminor(semiminor), m_posangle(posangle), @@ -650,8 +652,6 @@ public: m_srcTime(srcTime), m_obsEng(obsEng), m_obsTime(obsTime), - m_obs(obs), - m_rot(rot), m_rho_roi(rho_roi), m_cos_rho_roi(std::cos(rho_roi)), m_sin_rho_roi(std::sin(rho_roi)), @@ -661,10 +661,10 @@ public: m_iter(iter) { } double eval(const double& rho); protected: - const GCTAResponseIrf& m_rsp; //!< CTA response - const GModelSpatialElliptical& m_model; //!< Elliptical model - const GCTAObservation& m_obs; //!< CTA observation - const GMatrix& m_rot; //!< Rotation matrix + const GCTAResponseIrf* m_rsp; //!< CTA response + const GCTAObservation* m_obs; //!< CTA observation + const GModelSpatialElliptical* m_model; //!< Elliptical model + const GMatrix* m_rot; //!< Rotation matrix double m_semimajor; //!< Ellipse boundary semimajor axis double m_semiminor; //!< Ellipse boundary semiminor axis double m_posangle; //!< Ellipse boundary position angle @@ -706,36 +706,36 @@ protected: ***************************************************************************/ class cta_nroi_elliptical_kern_omega : public GFunction { public: - cta_nroi_elliptical_kern_omega(const GCTAResponseIrf& rsp, - const GModelSpatialElliptical& model, + cta_nroi_elliptical_kern_omega(const GCTAResponseIrf* rsp, + const GCTAObservation* obs, + const GModelSpatialElliptical* model, + const GMatrix* rot, const GEnergy& srcEng, const GTime& srcTime, const GEnergy& obsEng, const GTime& obsTime, - const GCTAObservation& obs, - const GMatrix& rot, const double& rho, const double& sin_rho, const double& cos_rho, const double& posangle_roi) : m_rsp(rsp), + m_obs(obs), m_model(model), + m_rot(rot), m_srcEng(srcEng), m_srcTime(srcTime), m_obsEng(obsEng), m_obsTime(obsTime), - m_obs(obs), - m_rot(rot), m_rho(rho), m_sin_rho(sin_rho), m_cos_rho(cos_rho), m_posangle_roi(posangle_roi) { } double eval(const double& omega); protected: - const GCTAResponseIrf& m_rsp; //!< CTA response - const GModelSpatialElliptical& m_model; //!< Model - const GCTAObservation& m_obs; //!< Pointer to observation - const GMatrix& m_rot; //!< Rotation matrix + const GCTAResponseIrf* m_rsp; //!< CTA response + const GCTAObservation* m_obs; //!< CTA observation + const GModelSpatialElliptical* m_model; //!< Elliptical model + const GMatrix* m_rot; //!< Rotation matrix GEnergy m_srcEng; //!< True photon energy GTime m_srcTime; //!< True photon arrival time GEnergy m_obsEng; //!< Observed photon energy @@ -779,8 +779,9 @@ protected: ***************************************************************************/ class cta_irf_diffuse_kern_theta : public GFunction { public: - cta_irf_diffuse_kern_theta(const GCTAResponseIrf& rsp, - const GModelSpatial& model, + cta_irf_diffuse_kern_theta(const GCTAResponseIrf* rsp, + const GModelSpatial* model, + const GMatrix* rot, const double& theta, const double& phi, const double& zenith, @@ -789,11 +790,11 @@ public: const GTime& srcTime, const double& srcLogEng, const GEnergy& obsEng, - const GMatrix& rot, const double& eta, const int& iter) : m_rsp(rsp), m_model(model), + m_rot(rot), m_theta(theta), m_phi(phi), m_zenith(zenith), @@ -802,15 +803,14 @@ public: m_srcTime(srcTime), m_srcLogEng(srcLogEng), m_obsEng(obsEng), - m_rot(rot), m_sin_eta(std::sin(eta)), m_cos_eta(std::cos(eta)), m_iter(iter) { } double eval(const double& theta); protected: - const GCTAResponseIrf& m_rsp; //!< CTA response - const GModelSpatial& m_model; //!< Spatial model - const GMatrix& m_rot; //!< Rotation matrix + const GCTAResponseIrf* m_rsp; //!< CTA response + const GModelSpatial* m_model; //!< Spatial model + const GMatrix* m_rot; //!< Rotation matrix double m_theta; //!< Photon offset angle double m_phi; //!< Photon azimuth angle double m_zenith; //!< Pointing zenith angle @@ -851,37 +851,37 @@ protected: ***************************************************************************/ class cta_irf_diffuse_kern_phi : public GFunction { public: - cta_irf_diffuse_kern_phi(const GCTAResponseIrf& rsp, - const GModelSpatial& model, + cta_irf_diffuse_kern_phi(const GCTAResponseIrf* rsp, + const GModelSpatial* model, + const GMatrix* rot, const double& zenith, const double& azimuth, const GEnergy& srcEng, const GTime& srcTime, const double& srcLogEng, const GEnergy& obsEng, - const GMatrix& rot, const double& sin_theta, const double& cos_theta, const double& sin_ph, const double& cos_ph) : m_rsp(rsp), m_model(model), + m_rot(rot), m_zenith(zenith), m_azimuth(azimuth), m_srcEng(srcEng), m_srcTime(srcTime), m_srcLogEng(srcLogEng), m_obsEng(obsEng), - m_rot(rot), m_sin_theta(sin_theta), m_cos_theta(cos_theta), m_sin_ph(sin_ph), m_cos_ph(cos_ph) { } double eval(const double& phi); protected: - const GCTAResponseIrf& m_rsp; //!< CTA response - const GModelSpatial& m_model; //!< Spatial model - const GMatrix& m_rot; //!< Rotation matrix + const GCTAResponseIrf* m_rsp; //!< CTA response + const GModelSpatial* m_model; //!< Spatial model + const GMatrix* m_rot; //!< Rotation matrix double m_zenith; //!< Zenith angle double m_azimuth; //!< Azimuth angle GEnergy m_srcEng; //!< True photon energy @@ -927,30 +927,30 @@ protected: ***************************************************************************/ class cta_nroi_diffuse_kern_theta : public GFunction { public: - cta_nroi_diffuse_kern_theta(const GCTAResponseIrf& rsp, - const GModelSpatial& model, + cta_nroi_diffuse_kern_theta(const GCTAResponseIrf* rsp, + const GCTAObservation* obs, + const GModelSpatial* model, + const GMatrix* rot, const GEnergy& srcEng, const GTime& srcTime, const GEnergy& obsEng, const GTime& obsTime, - const GCTAObservation& obs, - const GMatrix& rot, const int& iter) : m_rsp(rsp), + m_obs(obs), m_model(model), + m_rot(rot), m_srcEng(srcEng), m_srcTime(srcTime), m_obsEng(obsEng), m_obsTime(obsTime), - m_obs(obs), - m_rot(rot), m_iter(iter) { } double eval(const double& theta); protected: - const GCTAResponseIrf& m_rsp; //!< CTA response - const GModelSpatial& m_model; //!< Spatial model - const GCTAObservation& m_obs; //!< CTA observation - const GMatrix& m_rot; //!< Rotation matrix + const GCTAResponseIrf* m_rsp; //!< CTA response + const GCTAObservation* m_obs; //!< CTA observation + const GModelSpatial* m_model; //!< Spatial model + const GMatrix* m_rot; //!< Rotation matrix GEnergy m_srcEng; //!< True photon energy GTime m_srcTime; //!< True photon arrival time GEnergy m_obsEng; //!< Observed photon energy @@ -981,33 +981,33 @@ protected: ***************************************************************************/ class cta_nroi_diffuse_kern_phi : public GFunction { public: - cta_nroi_diffuse_kern_phi(const GCTAResponseIrf& rsp, - const GModelSpatial& model, + cta_nroi_diffuse_kern_phi(const GCTAResponseIrf* rsp, + const GCTAObservation* obs, + const GModelSpatial* model, + const GMatrix* rot, const GEnergy& srcEng, const GTime& srcTime, const GEnergy& obsEng, const GTime& obsTime, - const GCTAObservation& obs, - const GMatrix& rot, const double& theta, const double& sin_theta) : m_rsp(rsp), + m_obs(obs), m_model(model), + m_rot(rot), m_srcEng(srcEng), m_srcTime(srcTime), m_obsEng(obsEng), m_obsTime(obsTime), - m_obs(obs), - m_rot(rot), m_theta(theta), m_cos_theta(std::cos(theta)), m_sin_theta(sin_theta) { } double eval(const double& phi); protected: - const GCTAResponseIrf& m_rsp; //!< CTA response - const GModelSpatial& m_model; //!< Spatial model - const GCTAObservation& m_obs; //!< CTA observation - const GMatrix& m_rot; //!< Rotation matrix + const GCTAResponseIrf* m_rsp; //!< CTA response + const GCTAObservation* m_obs; //!< CTA observation + const GModelSpatial* m_model; //!< Spatial model + const GMatrix* m_rot; //!< Rotation matrix GEnergy m_srcEng; //!< True photon energy GTime m_srcTime; //!< True photon arrival time GEnergy m_obsEng; //!< Observed photon energy @@ -1314,7 +1314,7 @@ public: double eval(const double& omega); public: const GCTAResponseCube* m_rsp; //!< CTA response - const GModelSpatialElliptical* m_model; //!< Spatial model + const GModelSpatialElliptical* m_model; //!< Elliptical model GSkyDir m_srcDir; //!< True photon sky direction GEnergy m_srcEng; //!< True photon energy GTime m_srcTime; //!< True photon time @@ -1334,24 +1334,24 @@ class cta_psf_diffuse_kern_delta : public GFunction { public: cta_psf_diffuse_kern_delta(const GCTAResponseCube* rsp, const GModelSpatial* model, + const GMatrix* rot, const GSkyDir& srcDir, const GEnergy& srcEng, const GTime& srcTime, - const GMatrix& rot, const int& iter) : m_rsp(rsp), m_model(model), + m_rot(rot), m_srcDir(srcDir), m_srcEng(srcEng), m_srcTime(srcTime), - m_rot(rot), m_iter (iter), m_psf_max(rsp->psf()(srcDir, 0.0, srcEng)) { } double eval(const double& delta); protected: const GCTAResponseCube* m_rsp; //!< Response cube const GModelSpatial* m_model; //!< Spatial model - const GMatrix& m_rot; //!< Rotation matrix + const GMatrix* m_rot; //!< Rotation matrix GSkyDir m_srcDir; //!< True photon arrival direction GEnergy m_srcEng; //!< True photon energy GTime m_srcTime; //!< True photon arrival time @@ -1368,21 +1368,21 @@ protected: class cta_psf_diffuse_kern_phi : public GFunction { public: cta_psf_diffuse_kern_phi(const GModelSpatial* model, + const GMatrix* rot, const GEnergy& srcEng, const GTime& srcTime, - const GMatrix& rot, const double& sin_delta, const double& cos_delta) : m_model(model), + m_rot(rot), m_srcEng(srcEng), m_srcTime(srcTime), - m_rot(rot), m_sin_delta(sin_delta), m_cos_delta(cos_delta) { } double eval(const double& phi); protected: const GModelSpatial* m_model; //!< Spatial model - const GMatrix& m_rot; //!< Rotation matrix + const GMatrix* m_rot; //!< Rotation matrix GEnergy m_srcEng; //!< True photon energy GTime m_srcTime; //!< True photon arrival time double m_sin_delta; //!< sin(delta)